*** mirror.old Mon Nov 21 21:00:40 1994 --- mirror Tue Nov 22 17:28:15 1994 *************** *** 155,161 **** $default{ 'remote_dir' } = ''; # remote directory to mirror $default{ 'local_dir' } = ''; # local directory to copy into $default{ 'remote_user' } = 'anonymous'; # the remote guest account name ! $default{ 'remote_password' } = "$me@$hostname"; $default{ 'get_patt' } = "."; # regex of pathnames to retrieve $default{ 'exclude_patt' } = ''; # regex of pathnames to ignore $default{ 'update_local' } = 0; # Don't just update local dirs --- 155,161 ---- $default{ 'remote_dir' } = ''; # remote directory to mirror $default{ 'local_dir' } = ''; # local directory to copy into $default{ 'remote_user' } = 'anonymous'; # the remote guest account name ! $default{ 'remote_password' } = "$me\@$hostname"; $default{ 'get_patt' } = "."; # regex of pathnames to retrieve $default{ 'exclude_patt' } = ''; # regex of pathnames to ignore $default{ 'update_local' } = 0; # Don't just update local dirs *************** *** 405,416 **** push( @get_patt, '.' ); } else { ! push( @get_patt, "^$2$" ); } } else { push( @get_paths, '.' ); ! push( @get_patt, "^$path$" ); } } else { --- 405,416 ---- push( @get_patt, '.' ); } else { ! push( @get_patt, "^$2\$" ); } } else { push( @get_paths, '.' ); ! push( @get_patt, "^$path\$" ); } } else { *************** *** 1239,1245 **** &msg( "Cannot append to $update_log\n\n" ); return $exit_fail; } ! print logg "mirroring $package ($site:$remote_dir) completed successfully @ $now\n"; print logg @log; close( logg ); } --- 1239,1245 ---- &msg( "Cannot append to $update_log\n\n" ); return $exit_fail; } ! print logg "mirroring $package ($site:$remote_dir) completed successfully \@ $now\n"; print logg @log; close( logg ); } *************** *** 1251,1257 **** &msg( "Cannot run: $com\n\n" ); return $exit_fail; } ! print mail "Mirrored $package ($site:$remote_dir -> $local_dir) $comment @ $now\n"; print mail @log; close( mail ); } --- 1251,1257 ---- &msg( "Cannot run: $com\n\n" ); return $exit_fail; } ! print mail "Mirrored $package ($site:$remote_dir -> $local_dir) $comment \@ $now\n"; print mail @log; close( mail ); } *************** *** 1342,1365 **** sub clear_local { - undef( @local_sorted ); if( ! $use_files ){ undef( %local_map ); } ! undef( @local_time, @local_size, ! @local_type, @local_mode, ! @local_keep, @local_totals, @local_keep_totals ); } sub clear_remote { ! undef( @remote_sorted ); if( ! $use_files ){ undef( %remote_map ); } ! undef( @remote_time, @remote_size, ! @remote_type, @remote_mode, ! @remote_keep, @remote_totals, @remote_keep_totals ); } sub get_local_directory_details --- 1342,1364 ---- sub clear_local { if( ! $use_files ){ undef( %local_map ); } ! @local_sorted = @local_time = @local_size = ! @local_type = @local_mode = ! @local_keep = @local_totals, @local_keep_totals = (); } sub clear_remote { ! @remote_sorted = (); if( ! $use_files ){ undef( %remote_map ); } ! @remote_time = @remote_size = ! @remote_type = @remote_mode = ! @remote_keep = @remote_totals = @remote_keep_totals = (); } sub get_local_directory_details *************** *** 1372,1381 **** &clear_local(); # Make sure the first elem is 0. ! push( @local_time, 0 ); ! push( @local_size, 0 ); ! push( @local_type, 0 ); ! push( @local_mode, 0 ); @get_top = (); --- 1371,1380 ---- &clear_local(); # Make sure the first elem is 0. ! $local_time[ 0 ] = 0; ! $local_size[ 0 ] = 0; ! $local_type[ 0 ] = 0; ! $local_mode[ 0 ] = 0; @get_top = (); *************** *** 1485,1497 **** next; } - push( @local_sorted, $path ); local( $mapi ) = $next_local_mapi++; $local_map{ $path } = $mapi; ! push( @local_time, $time ); ! push( @local_size, $size ); ! push( @local_type, $type ); ! push( @local_mode, $mode ); if( $type eq 'd' ){ $local_totals[ 0 ]++; } --- 1484,1497 ---- next; } local( $mapi ) = $next_local_mapi++; + # push( @local_sorted, $path ); + $local_sorted[ $mapi - 1 ] = $path; $local_map{ $path } = $mapi; ! $local_time[ $mapi ] = $time; ! $local_size[ $mapi ] = $size; ! $local_type[ $mapi ] = $type; ! $local_mode[ $mapi ] = $mode; if( $type eq 'd' ){ $local_totals[ 0 ]++; } *************** *** 1512,1518 **** # Return true if the remote directory listing was brought back safely. sub get_remote_directory_details { - local( $use_rls ) = 0; local( $type_changed ) = 0; local( $udirtmp ); --- 1512,1517 ---- *************** *** 1522,1531 **** &clear_remote(); # Make sure the first elem is 0. ! push( @remote_time, 0 ); ! push( @remote_size, 0 ); ! push( @remote_type, 0 ); ! push( @remote_mode, 0 ); if( ! &ftp'cwd( $remote_dir ) ){ if( $get_file ){ --- 1521,1530 ---- &clear_remote(); # Make sure the first elem is 0. ! $remote_time[ 0 ] = 0; ! $remote_size[ 0 ] = 0; ! $remote_type[ 0 ] = 0; ! $remote_mode[ 0 ] = 0; if( ! &ftp'cwd( $remote_dir ) ){ if( $get_file ){ *************** *** 1544,1549 **** --- 1543,1550 ---- local( $rls ); + $use_ls = 0; + if( $local_ls_lR_file ){ &msg( " Using local file $local_ls_lR_file for remote dir listing\n" ) if $debug; if( ! open( dirtmp, $local_ls_lR_file ) ){ *************** *** 1772,1784 **** } } - push( @remote_sorted, $path ); local( $mapi ) = $next_remote_mapi++; $remote_map{ $path } = $mapi; ! push( @remote_time, $time ); ! push( @remote_size, $size ); ! push( @remote_type, $type ); ! push( @remote_mode, $mode ); if( $type eq 'd' ){ $remote_totals[ 0 ]++; } --- 1773,1786 ---- } } local( $mapi ) = $next_remote_mapi++; + # push( @remote_sorted, $path ); + $remote_sorted[ $mapi - 1 ] = $path; $remote_map{ $path } = $mapi; ! $remote_time[ $mapi ] = $time; ! $remote_size[ $mapi ] = $size; ! $remote_type[ $mapi ] = $type; ! $remote_mode[ $mapi ] = $mode; if( $type eq 'd' ){ $remote_totals[ 0 ]++; } .