Changeset 367

Show
Ignore:
Timestamp:
06/07/06 12:55:32 (3 years ago)
Author:
gary
Message:

rename scripts so that all nightly scripts have names starting nightly_xxx

reorder dir work in nightly_copy_tsuite.pl so that cluster work done first, so that, in case of abort, unix and win versions are not deleted

Location:
trunk/scripts
Files:
1 modified
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/scripts/nightly_copy_files.pl

    r324 r367  
    2828} 
    2929 
    30  
    3130# this is where the scripts live 
    3231$scripts = "c:/projects/cloudy/trunk/scripts"; 
     
    3635 
    3736# execute source script 
    38 system( "perl copy_source.pl" ); 
     37system( "perl nightly_copy_source.pl" ); 
    3938 
    4039# execute copy tsuite script 
    41 system( "perl copy_tsuite.pl" ); 
     40system( "perl nightly_copy_tsuite.pl" ); 
    4241 
    4342# execute source script 
    44 system( "perl copy_data.pl" ); 
     43system( "perl nightly_copy_data.pl" ); 
    4544 
  • trunk/scripts/nightly_copy_tsuite.pl

    r267 r367  
    4141for ($ndir=0; $ndir<2; $ndir++) 
    4242{ 
    43  
    44 # -------------------------------------------------------------------------- 
    45 # this block - clean out the target directories so we get fresh copies 
    46 # 
    47 # move to the pc unix tsuite dir 
    48 $dir = "$unix_copy_dir"."/"."$subdirs[$ndir]"; 
    49 chdir( "$dir" ) or die " could not move to test suite directory \n"; 
    50 print(" moved to tsuite unix target directory, about to delete all files\n"); 
    51 # remove all files 
    52 unlink <*> ;  
    53  
    54 # move to the win tsuite directory 
    55 $dir = "$win_copy_dir"."/"."$subdirs[$ndir]"; 
    56 chdir( "$dir" ) or die " could not move to test suite directory \n"; 
    57 print(" moved to tsuite win target directory, about to delete all files\n"); 
    58 # remove the win tsuite files 
    59 unlink <*> ;  
    60  
    61 # move to cluster tsuite directory 
    62 $dir = "$cluster_copy_dir"."/"."$subdirs[$ndir]"; 
    63 chdir( "$dir" ) or die " could not move to cluster target directory \n"; 
    64 print(" moved to cluster tsuite directory, about to delete in files\n"); 
    65 # remove the old unix tsuite files - do not do * since want to keep perl files 
    66 unlink <*.in>;  
    67 # do not remove the *.out since a job may be running 
    68  
    69 # end block - all target directories cleaned out the so we get fresh copies 
    70 # -------------------------------------------------------------------------- 
    71  
    72  
    73 # -------------------------------------------------------------------------- 
    74 # now copy files from trunk to copy dirs 
    75 # 
    76 # move to original tsuite directory 
    77 $dir = "$trunk_dir"."/"."$subdirs[$ndir]"; 
    78 chdir( "$dir" ) or die " could not move to trunk directory \n"; 
    79  
    80 # this loops over all input files in the original tsuite directory 
    81 # and copies unix eol version to subdir unix, which is now empty 
    82 # and windows eol version to subdir win/tsuite, which is empty 
    83 while( defined( $input = glob("*.in") ) ) 
    84 { 
    85         print( "$input going to " ); 
    86         $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    87         print("$output\n"); 
    88         # actually copy the file 
    89         system "dos2unix < $input  > $output"; 
    90 # 
    91 #       now do win version 
    92         print( "$input going to " ); 
    93         $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    94         print("$output\n"); 
    95         # actually execute the code 
    96         copy( $input  , $output ); 
     43    
     44   # -------------------------------------------------------------------------- 
     45   # clean out the target directories so we get fresh copies 
     46    
     47   # move to cluster tsuite directory - do this first since this will abort if 
     48   # u drive is not mounted  
     49   $dir = "$cluster_copy_dir"."/"."$subdirs[$ndir]"; 
     50   chdir( "$dir" ) or die " could not move to cluster target directory \n"; 
     51   print(" moved to cluster tsuite directory, about to delete in files\n"); 
     52   # remove the old unix tsuite files - do not do * since want to keep perl files 
     53   unlink <*.in>;  
     54   # 
     55   # move to the unix tsuite dir 
     56   $dir = "$unix_copy_dir"."/"."$subdirs[$ndir]"; 
     57   chdir( "$dir" ) or die " could not move to test suite directory \n"; 
     58   print(" moved to tsuite unix target directory, about to delete all files\n"); 
     59   # remove all files 
     60   unlink <*> ;  
     61    
     62   # move to the win tsuite directory 
     63   $dir = "$win_copy_dir"."/"."$subdirs[$ndir]"; 
     64   chdir( "$dir" ) or die " could not move to test suite directory \n"; 
     65   print(" moved to tsuite win target directory, about to delete all files\n"); 
     66   # remove the win tsuite files 
     67   unlink <*> ;  
     68   # do not remove the *.out since a job may be running 
     69    
     70   # end block - all target directories cleaned out the so we get fresh copies 
     71   # -------------------------------------------------------------------------- 
     72    
     73    
     74   # -------------------------------------------------------------------------- 
     75   # now copy files from trunk to copy dirs 
     76   # 
     77   # move to original tsuite directory 
     78   $dir = "$trunk_dir"."/"."$subdirs[$ndir]"; 
     79   chdir( "$dir" ) or die " could not move to trunk directory \n"; 
     80    
     81   # this loops over all input files in the original tsuite directory 
     82   # and copies unix eol version to subdir unix, which is now empty 
     83   # and windows eol version to subdir win/tsuite, which is empty 
     84   while( defined( $input = glob("*.in") ) ) 
     85   { 
     86           print( "$input going to " ); 
     87           $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     88           print("$output\n"); 
     89           # actually copy the file 
     90           system "dos2unix < $input  > $output"; 
     91   # 
     92   #       now do win version 
     93           print( "$input going to " ); 
     94           $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     95           print("$output\n"); 
     96           # actually execute the code 
     97           copy( $input  , $output ); 
     98   } 
     99    
     100   # now copy all html files  
     101   while( defined( $input = glob("*.htm") ) ) 
     102   { 
     103           print( "$input going to " ); 
     104           $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     105           print("$output\n"); 
     106           # actually execute the code 
     107           system "dos2unix < $input  > $output"; 
     108           $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     109           print("$output\n"); 
     110           # actually execute the code 
     111           copy( $input , $output ); 
     112   } 
     113    
     114   # now copy all ini files  
     115   while( defined( $input = glob("*.ini") ) ) 
     116   { 
     117           print( "$input going to " ); 
     118           $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     119           print("$output\n"); 
     120           # actually execute the code 
     121           system "dos2unix < $input  > $output"; 
     122           $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     123           print("$output\n"); 
     124           # actually execute the code 
     125           copy( $input , $output ); 
     126   } 
     127    
     128   # now copy all dat files  
     129   while( defined( $input = glob("*.dat") ) ) 
     130   { 
     131           print( "$input going to " ); 
     132           $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     133           print("$output\n"); 
     134           # actually execute the code 
     135           system "dos2unix < $input  > $output"; 
     136           $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     137           print("$output\n"); 
     138           # actually execute the code 
     139           copy( $input , $output ); 
     140   } 
     141    
     142   # the clouds image is a binary file do a straight copy 
     143   copy( "clouds.jpg" , "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."clouds.jpg" ); 
     144   # the clouds image is a binary file 
     145   copy( "clouds.jpg" , "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."clouds.jpg" ); 
     146    
     147   # now copy all perl scripts  
     148   while( defined( $input = glob("*.pl") ) ) 
     149   { 
     150           print( "$input going to " ); 
     151           $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     152           print("$output\n"); 
     153           # actually execute the code 
     154           system "dos2unix < $input  > $output"; 
     155           $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     156           print("$output\n"); 
     157           # actually execute the code 
     158           copy( $input , $output ); 
     159   } 
     160    
     161   print("All tsuite files have been copied to pc unix and win subdirs\n"); 
     162    
     163   # move to pc unix copy tsuite directory and copy across to cluster 
     164   $dir = "$unix_copy_dir"."/"."$subdirs[$ndir]"; 
     165   chdir( "$dir" ) or die " could not move to pc unix directory \n"; 
     166   # this loops over all files in the pc unix tsuite directory 
     167   # and copies unix version to subdir unix on cluster, which is now empty 
     168   while( defined( $input = glob("*") ) ) 
     169   { 
     170           print( "$input going to " ); 
     171           $output = "$cluster_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
     172           print("$output\n"); 
     173           # actually copy the file 
     174           copy( $input  , $output ); 
     175   } 
     176   # end copying files around 
     177   # -------------------------------------------------------------------------- 
     178    
     179    
     180   # now zip up the directories we created - move into each do it from there 
     181   # so that dir name is not included 
     182    
     183   # base name of tar file 
     184   $tarfile_basename = "tsuite_"."$subdirs[$ndir]"; 
     185    
     186   $dir = "$unix_copy_dir"."/"."$subdirs[$ndir]"; 
     187   chdir( "$dir" ) or die " could not move to pc unix directory \n"; 
     188   print(" moved to unix copy directory\n"); 
     189    
     190   $tarfile = "$unix_copy_basedir"."/"."$tarfile_basename".".tar"; 
     191   # remove old gzipd file if it exists 
     192   if( -e "$tarfile" ) 
     193   { 
     194      unlink("$tarfile" ); 
     195   } 
     196    
     197   #   tar the files 
     198   #   NB we must do this in the directory so that we do not keep the dir structure, just names 
     199   # the cygwin tar chocked on the fully resolved tarfile name  
     200   #system "tar -cf $tarfile * "; 
     201   system "C:\\u\\mks\\mksnt\\tar_mks.exe -cf $tarfile * "; 
     202   print( "about to gzip $tarfile\n" ); 
     203   # remove old gzipd file if it exists 
     204   if( -e "$tarfile".".gz" ) 
     205   { 
     206      unlink("$tarfile".".gz" ); 
     207   } 
     208   system "gzip $tarfile "; 
     209    
     210   # copy to the ftp site 
     211   copy( "$tarfile".".gz" , $ftp_last ); 
     212    
     213   # how go to win home and zip the win source dir 
     214   $dir = "$win_copy_dir"."/"."$subdirs[$ndir]"; 
     215   chdir( "$dir" ) or die " could not move to pc win directory \n"; 
     216   print(" moved to win copy directory\n"); 
     217    
     218   # remove old gzipd file if it exists 
     219   $tarfile = "$win_copy_basedir"."/"."$tarfile_basename".".zip"; 
     220   if( -e "$tarfile" ) 
     221   { 
     222      unlink("$tarfile" ); 
     223   } 
     224    
     225   # create zip file 
     226   #system "c:\\u\\wzzip $tarfile  "; 
     227   system "wzzip $tarfile  "; 
     228    
     229   # finally copy the newly created files to the ftp site 
     230   copy( "$tarfile" , $ftp_last ); 
     231    
     232   print("\ndone\n"); 
     233 
    97234} 
    98  
    99 # now copy all html files  
    100 while( defined( $input = glob("*.htm") ) ) 
    101 { 
    102         print( "$input going to " ); 
    103         $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    104         print("$output\n"); 
    105         # actually execute the code 
    106         system "dos2unix < $input  > $output"; 
    107         $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    108         print("$output\n"); 
    109         # actually execute the code 
    110         copy( $input , $output ); 
    111 } 
    112  
    113 # now copy all ini files  
    114 while( defined( $input = glob("*.ini") ) ) 
    115 { 
    116         print( "$input going to " ); 
    117         $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    118         print("$output\n"); 
    119         # actually execute the code 
    120         system "dos2unix < $input  > $output"; 
    121         $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    122         print("$output\n"); 
    123         # actually execute the code 
    124         copy( $input , $output ); 
    125 } 
    126  
    127 # now copy all dat files  
    128 while( defined( $input = glob("*.dat") ) ) 
    129 { 
    130         print( "$input going to " ); 
    131         $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    132         print("$output\n"); 
    133         # actually execute the code 
    134         system "dos2unix < $input  > $output"; 
    135         $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    136         print("$output\n"); 
    137         # actually execute the code 
    138         copy( $input , $output ); 
    139 } 
    140  
    141 # the clouds image is a binary file do a straight copy 
    142 copy( "clouds.jpg" , "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."clouds.jpg" ); 
    143 # the clouds image is a binary file 
    144 copy( "clouds.jpg" , "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."clouds.jpg" ); 
    145  
    146 # now copy all perl scripts  
    147 while( defined( $input = glob("*.pl") ) ) 
    148 { 
    149         print( "$input going to " ); 
    150         $output = "$unix_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    151         print("$output\n"); 
    152         # actually execute the code 
    153         system "dos2unix < $input  > $output"; 
    154         $output = "$win_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    155         print("$output\n"); 
    156         # actually execute the code 
    157         copy( $input , $output ); 
    158 } 
    159  
    160 print("All tsuite files have been copied to pc unix and win subdirs\n"); 
    161  
    162 # move to pc unix copy tsuite directory and copy across to cluster 
    163 $dir = "$unix_copy_dir"."/"."$subdirs[$ndir]"; 
    164 chdir( "$dir" ) or die " could not move to pc unix directory \n"; 
    165 # this loops over all files in the pc unix tsuite directory 
    166 # and copies unix version to subdir unix on cluster, which is now empty 
    167 while( defined( $input = glob("*") ) ) 
    168 { 
    169         print( "$input going to " ); 
    170         $output = "$cluster_copy_dir"."/"."$subdirs[$ndir]"."/"."$input"; 
    171         print("$output\n"); 
    172         # actually copy the file 
    173         copy( $input  , $output ); 
    174 } 
    175 # end copying files around 
    176 # -------------------------------------------------------------------------- 
    177  
    178  
    179 # now zip up the directories we created - move into each do it from there 
    180 # so that dir name is not included 
    181  
    182 # base name of tar file 
    183 $tarfile_basename = "tsuite_"."$subdirs[$ndir]"; 
    184  
    185 $dir = "$unix_copy_dir"."/"."$subdirs[$ndir]"; 
    186 chdir( "$dir" ) or die " could not move to pc unix directory \n"; 
    187 print(" moved to unix copy directory\n"); 
    188  
    189 $tarfile = "$unix_copy_basedir"."/"."$tarfile_basename".".tar"; 
    190 # remove old gzipd file if it exists 
    191 if( -e "$tarfile" ) 
    192 { 
    193    unlink("$tarfile" ); 
    194 } 
    195  
    196 #   tar the files 
    197 #   NB we must do this in the directory so that we do not keep the dir structure, just names 
    198 # the cygwin tar chocked on the fully resolved tarfile name  
    199 #system "tar -cf $tarfile * "; 
    200 system "C:\\u\\mks\\mksnt\\tar_mks.exe -cf $tarfile * "; 
    201 print( "about to gzip $tarfile\n" ); 
    202 # remove old gzipd file if it exists 
    203 if( -e "$tarfile".".gz" ) 
    204 { 
    205    unlink("$tarfile".".gz" ); 
    206 } 
    207 system "gzip $tarfile "; 
    208  
    209 # copy to the ftp site 
    210 copy( "$tarfile".".gz" , $ftp_last ); 
    211  
    212 # how go to win home and zip the win source dir 
    213 $dir = "$win_copy_dir"."/"."$subdirs[$ndir]"; 
    214 chdir( "$dir" ) or die " could not move to pc win directory \n"; 
    215 print(" moved to win copy directory\n"); 
    216  
    217 # remove old gzipd file if it exists 
    218 $tarfile = "$win_copy_basedir"."/"."$tarfile_basename".".zip"; 
    219 if( -e "$tarfile" ) 
    220 { 
    221    unlink("$tarfile" ); 
    222 } 
    223  
    224 # create zip file 
    225 #system "c:\\u\\wzzip $tarfile  "; 
    226 system "wzzip $tarfile  "; 
    227  
    228 # finally copy the newly created files to the ftp site 
    229 copy( "$tarfile" , $ftp_last ); 
    230  
    231 print("\ndone\n"); 
    232  
    233 }