blob: 4426ff9bdc297d116f29d211472ba6a12446c3c4 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001#!/usr/bin/perl
2#
3# Copyright Statement:
4# --------------------
5# This software is protected by Copyright and the information contained
6# herein is confidential. The software may not be copied and the information
7# contained herein may not be used or disclosed except with the written
8# permission of MediaTek Inc. (C) 2005
9#
10# BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
11# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
12# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
13# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
14# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
15# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
16# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
17# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
18# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
19# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
20# NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
21# SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
22#
23# BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
24# LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
25# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
26# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
27# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
28#
29# THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
30# WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
31# LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
32# RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
33# THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
34#
35#
36#*****************************************************************************
37#*
38#* Filename:
39#* ---------
40#* libinfo.pl
41#*
42#* Project:
43#* --------
44#*
45#*
46#* Description:
47#* ------------
48#*
49#*
50#* Author:
51#* -------
52#* Amber Su (mtk03389)
53#*
54#*============================================================================
55#* HISTORY
56#* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57#*------------------------------------------------------------------------------
58#* $Revision$
59#* $Modtime$
60#* $Log$
61#*
62#*------------------------------------------------------------------------------
63#* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
64#*============================================================================
65#*****************************************************************************
66
67#*****************************************************************************
68# Included Modules
69#*****************************************************************************
70use File::stat;
71
72#*************************************************************************************************
73# Input and Parameters Initialization
74#*************************************************************************************************
75my ($lib_list) = @ARGV;
76my %processd_libs;
77my $sperate_line = "==============================================================";
78 $sperate_line .= "============================================================\n";
79#*************************************************************************************************
80# Main Flow
81#*************************************************************************************************
82&error_handler("$lib_list: NOT exist!", __FILE__, __LINE__) if (!-e $lib_list);
83open(FILE,"<$lib_list") or &error_handler("$lib_list: file error!", __FILE__, __LINE__);
84
85print sprintf ("%-80s %-15s %s\n","Library Name","Size(byte)","Modified Time");
86print "$sperate_line";
87foreach my $line (<FILE>)
88{
89 my $lib_size = undef;
90 my $m_time = undef;
91 chomp($line);
92 next if(exists $processd_libs{"$line"});
93 if(-e "$line") {
94 $lib_size = stat("$line")->size;
95 $lib_time = stat("$line")->mtime;
96 ($sec, $min, $hour, $mday, $mon, $year) = localtime ($lib_time);
97 $m_time = sprintf("%4.4d.%2.2d.%2.2d.%2.2d.%2.2d.%2.2d", $year+1900, $mon+1, $mday, $hour, $min, $sec);
98 }
99 print sprintf ("%-80s %-15s %s\n","$line","$lib_size","$m_time");
100 $processd_libs{"$line"} = 1;
101}
102print "$sperate_line";
103close FILE;
104
105#*************************************************************************************************
106# Error Handling Message
107#*************************************************************************************************
108sub error_handler
109{
110 my ($error_msg, $file, $line_no) = @_;
111 my $final_error_msg = "Error: $error_msg at $file line $line_no\n";
112 print "$final_error_msg";
113 exit 1;
114}