rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | #!/usr/local/bin/perl
|
| 2 |
|
| 3 | #
|
| 4 | # Copyright Statement:
|
| 5 | # --------------------
|
| 6 | # This software is protected by Copyright and the information contained
|
| 7 | # herein is confidential. The software may not be copied and the information
|
| 8 | # contained herein may not be used or disclosed except with the written
|
| 9 | # permission of MediaTek Inc. (C) 2005
|
| 10 | #
|
| 11 | # BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
|
| 12 | # THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
|
| 13 | # RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
|
| 14 | # AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
|
| 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
|
| 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
|
| 17 | # NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
|
| 18 | # SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
|
| 19 | # SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
|
| 20 | # THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
|
| 21 | # NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
|
| 22 | # SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
|
| 23 | #
|
| 24 | # BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
|
| 25 | # LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
|
| 26 | # AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
|
| 27 | # OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
|
| 28 | # MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
|
| 29 | #
|
| 30 | # THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
|
| 31 | # WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
|
| 32 | # LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
|
| 33 | # RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
|
| 34 | # THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
|
| 35 | #
|
| 36 | #################################################################################
|
| 37 |
|
| 38 | use Win32::Process;
|
| 39 | use Win32;
|
| 40 | use File::Basename;
|
| 41 |
|
| 42 |
|
| 43 | # ..\make\comp.mak
|
| 44 |
|
| 45 | # mount net use from G to Z except M: K: U: , T:
|
| 46 | # W:\ is first priority
|
| 47 |
|
| 48 | my @drvs = ("W","X","Y","Z","G","H","I","J","L","N","O","P","Q","R","S","V");
|
| 49 |
|
| 50 | my $CheckPath;
|
| 51 | my $result="FALSE";
|
| 52 | my $gotNetDrvChar;
|
| 53 |
|
| 54 | my $complintlogdir;
|
| 55 | my $component;
|
| 56 | #print " \$argv[0]= $ARGV[0] \n";
|
| 57 |
|
| 58 | #$(COMPLINTLOGDIR)
|
| 59 |
|
| 60 | $complintlogdir = $ARGV[1];
|
| 61 | $component = $ARGV[2];
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 | #######################
|
| 66 |
|
| 67 |
|
| 68 | foreach $adrv ( @drvs )
|
| 69 | {
|
| 70 | if ( $result ne "TRUE" )
|
| 71 | {
|
| 72 | $CheckPath = $adrv;
|
| 73 | # print " drv == $adrv \n";
|
| 74 | &checkLoop;
|
| 75 | $idx++;
|
| 76 | } else
|
| 77 | {
|
| 78 | break;
|
| 79 | }
|
| 80 | }
|
| 81 |
|
| 82 | #######################
|
| 83 |
|
| 84 |
|
| 85 | my $env_tmp = $ENV{TMP};
|
| 86 |
|
| 87 | if ( $env_tmp !~ /\\$/ )
|
| 88 | {
|
| 89 | $env_tmp = "$env_tmp"."\\";
|
| 90 | }
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 | #if( ! -e "$env_tmp"."aa.lnt" )
|
| 95 | #{
|
| 96 | # print("copy pcore\\tools\\aa.lnt $env_tmp \n");
|
| 97 | # system("copy pcore\\tools\\aa.lnt $env_tmp \n");
|
| 98 | #}
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 | open(F, ">$ARGV[0]") or die $!;
|
| 105 |
|
| 106 | print F "Net_ReadOnly_DIR = $FullCheckPath\n";
|
| 107 | print F "COMPLINTLOGDIR = $complintlogdir\n";
|
| 108 | print F "COMPONENT = $component\n";
|
| 109 |
|
| 110 | close(F);
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 | ###############################################
|
| 117 |
|
| 118 | sub checkLintFile {
|
| 119 | if ( -d $_[0] )
|
| 120 | {
|
| 121 | if (( -e $_[0]."lint-nt.exe" ) && ( -e $_[0]."co-ads.lnt" ) )
|
| 122 | {
|
| 123 | return "TRUE";
|
| 124 | } else
|
| 125 | {
|
| 126 | return "FALSE";
|
| 127 | }
|
| 128 | } else
|
| 129 | {
|
| 130 | return "FALSE";
|
| 131 | }
|
| 132 | }
|
| 133 | ########################################
|
| 134 | sub checkLoop {
|
| 135 | $FullCheckPath = $CheckPath.":\\";
|
| 136 | if ( -d $FullCheckPath )
|
| 137 | {
|
| 138 | $result = &checkLintFile( $FullCheckPath );
|
| 139 |
|
| 140 | if ( $result eq "TRUE" )
|
| 141 | {
|
| 142 | $gotNetDrvChar = $CheckPath;
|
| 143 | #print " Lint Net Drv == $gotNetDrvChar \n";
|
| 144 | return;
|
| 145 | }
|
| 146 | } else
|
| 147 | {
|
| 148 | system "net use "."$CheckPath".": /delete \n"; # delete Unavailable NET driver
|
| 149 | print " cmd==". " net use "."$CheckPath".": \\\\srdfs01\\lint \n";
|
| 150 | system "net use "."$CheckPath".": \\\\srdfs01\\lint \n";
|
| 151 | }
|
| 152 |
|
| 153 | if ( -d $FullCheckPath )
|
| 154 | {
|
| 155 | $result = &checkLintFile( $FullCheckPath );
|
| 156 | if ( $result eq "TRUE" )
|
| 157 | {
|
| 158 | $gotNetDrvChar = $CheckPath;
|
| 159 | print " Lint Net Drv == $gotNetDrvChar \n";
|
| 160 | return;
|
| 161 | }
|
| 162 | }
|
| 163 |
|
| 164 | } # sub checkLoop
|