View | Details | Raw Unified | Return to bug 1214412
Collapse All | Expand All

(-)/usr/bin/mirror (-73 / +73 lines)
Lines 51-57 Link Here
51
# Allow strip_cr (from Andrew).
51
# Allow strip_cr (from Andrew).
52
# More symlink handling...
52
# More symlink handling...
53
# Set type for vms correctly.
53
# Set type for vms correctly.
54
# Changed response from ftp::delete, also corrected path used.
54
# Changed response from ftp'delete, also corrected path used.
55
#
55
#
56
# Revision 2.4  1994/04/29  20:11:09  lmjm
56
# Revision 2.4  1994/04/29  20:11:09  lmjm
57
# Use correct variable for hostname
57
# Use correct variable for hostname
Lines 1054-1063 Link Here
1054
1054
1055
	if( $debug ){
1055
	if( $debug ){
1056
		# Keep the ftp debugging lower than the rest.
1056
		# Keep the ftp debugging lower than the rest.
1057
		&ftp::debug( $debug - 1);
1057
		&ftp'debug( $debug - 1);
1058
	}
1058
	}
1059
	else {
1059
	else {
1060
		&ftp::debug( $verbose );
1060
		&ftp'debug( $verbose );
1061
	}
1061
	}
1062
1062
1063
	if( $recurse_hard ){
1063
	if( $recurse_hard ){
Lines 1070-1088 Link Here
1070
	}
1070
	}
1071
1071
1072
	if( ! $interactive ){
1072
	if( ! $interactive ){
1073
		$ftp::showfd = 'STDOUT';
1073
		$ftp'showfd = 'STDOUT';
1074
	}
1074
	}
1075
	&ftp::set_timeout( $timeout );
1075
	&ftp'set_timeout( $timeout );
1076
	&ftp::set_signals( "main::msg" );
1076
	&ftp'set_signals( "main'msg" );
1077
1077
1078
	# set passive ftp mode
1078
	# set passive ftp mode
1079
	if( $passive_ftp ){
1079
	if( $passive_ftp ){
1080
		$ftp::use_pasv = 1;
1080
		$ftp'use_pasv = 1;
1081
	}
1081
	}
1082
1082
1083
	# Are we using the SOCKS version of perl?
1083
	# Are we using the SOCKS version of perl?
1084
	if( $using_socks ){
1084
	if( $using_socks ){
1085
		$chat::using_socks = 1;
1085
		$chat'using_socks = 1;
1086
	}
1086
	}
1087
1087
1088
	# Useful string in prints
1088
	# Useful string in prints
Lines 1217-1229 Link Here
1217
	if( $con == 1 ){
1217
	if( $con == 1 ){
1218
		&msg( "login as $remote_user\n" ) if $debug > 1;
1218
		&msg( "login as $remote_user\n" ) if $debug > 1;
1219
		$curr_remote_user = $remote_user;
1219
		$curr_remote_user = $remote_user;
1220
		if( ! &ftp::login( $remote_user, $remote_password, $remote_account ) ){
1220
		if( ! &ftp'login( $remote_user, $remote_password, $remote_account ) ){
1221
			&msg( "Cannot login, skipping package\n" );
1221
			&msg( "Cannot login, skipping package\n" );
1222
			&disconnect();
1222
			&disconnect();
1223
			&msg( "\n" );
1223
			&msg( "\n" );
1224
			return $exit_status;
1224
			return $exit_status;
1225
		}
1225
		}
1226
		$can_restart = (&ftp::restart(0) == 1);
1226
		$can_restart = (&ftp'restart(0) == 1);
1227
		if( $debug > 1 ){
1227
		if( $debug > 1 ){
1228
			&msg( "Can " . ($can_restart ? '' : "not ") . "do restarts\n" );
1228
			&msg( "Can " . ($can_restart ? '' : "not ") . "do restarts\n" );
1229
1229
Lines 1234-1240 Link Here
1234
		&msg( "Already connected to site $site\n" ) if $debug;
1234
		&msg( "Already connected to site $site\n" ) if $debug;
1235
	}
1235
	}
1236
1236
1237
	if( ! &ftp::type( $text_mode ? 'A' : 'I' ) ){
1237
	if( ! &ftp'type( $text_mode ? 'A' : 'I' ) ){
1238
		&msg( "Cannot set type\n" );
1238
		&msg( "Cannot set type\n" );
1239
	}
1239
	}
1240
1240
Lines 1245-1260 Link Here
1245
	# setting the namemap functions.
1245
	# setting the namemap functions.
1246
	if( $remote_fs =~ /vms/i ){
1246
	if( $remote_fs =~ /vms/i ){
1247
		$vms = 1;
1247
		$vms = 1;
1248
		&ftp::set_namemap( "main::unix2vms", "main::vms2unix" );
1248
		&ftp'set_namemap( "main'unix2vms", "main'vms2unix" );
1249
	}
1249
	}
1250
	else {
1250
	else {
1251
		$vms = 0;
1251
		$vms = 0;
1252
		# No mapping necessary
1252
		# No mapping necessary
1253
		&ftp::set_namemap( '' );
1253
		&ftp'set_namemap( '' );
1254
	}
1254
	}
1255
1255
1256
	if( ! $get_file || $remote_idle ){
1256
	if( ! $get_file || $remote_idle ){
1257
		local( @rhelp ) = &ftp::site_commands();
1257
		local( @rhelp ) = &ftp'site_commands();
1258
		$remote_has_chmod = grep( $_ eq 'CHMOD', @rhelp);
1258
		$remote_has_chmod = grep( $_ eq 'CHMOD', @rhelp);
1259
		$remote_has_rename = grep( $_ eq 'RNFR', @rhelp) && grep( $_ eq 'RNTO', @rhelp);
1259
		$remote_has_rename = grep( $_ eq 'RNFR', @rhelp) && grep( $_ eq 'RNTO', @rhelp);
1260
		$remote_has_idle = grep( $_ eq 'IDLE', @rhelp);
1260
		$remote_has_idle = grep( $_ eq 'IDLE', @rhelp);
Lines 1265-1271 Link Here
1265
	}
1265
	}
1266
	
1266
	
1267
	if( $remote_has_idle && $remote_idle ){
1267
	if( $remote_has_idle && $remote_idle ){
1268
		if( ! &ftp::quote( "site idle $remote_idle" ) ){
1268
		if( ! &ftp'quote( "site idle $remote_idle" ) ){
1269
			&msg( "Cannot set remote idle\n" );
1269
			&msg( "Cannot set remote idle\n" );
1270
		}
1270
		}
1271
		elsif( $debug > 2 ){
1271
		elsif( $debug > 2 ){
Lines 1274-1280 Link Here
1274
	}
1274
	}
1275
1275
1276
	if( $remote_group ){
1276
	if( $remote_group ){
1277
		if( ! &ftp::quote( "site group $remote_group" ) ){
1277
		if( ! &ftp'quote( "site group $remote_group" ) ){
1278
			&msg( "Cannot set remote group\n" );
1278
			&msg( "Cannot set remote group\n" );
1279
		}
1279
		}
1280
		elsif( $debug > 2 ){
1280
		elsif( $debug > 2 ){
Lines 1283-1289 Link Here
1283
	}
1283
	}
1284
	
1284
	
1285
	if( $remote_gpass ){
1285
	if( $remote_gpass ){
1286
		if( ! &ftp::quote( "site gpass $remote_gpass" ) ){
1286
		if( ! &ftp'quote( "site gpass $remote_gpass" ) ){
1287
			&msg( "Cannot set remote gpass\n" );
1287
			&msg( "Cannot set remote gpass\n" );
1288
		}
1288
		}
1289
		elsif( $debug > 2 ){
1289
		elsif( $debug > 2 ){
Lines 1497-1507 Link Here
1497
{
1497
{
1498
	if( $connected ){
1498
	if( $connected ){
1499
		&msg( "disconnecting from $connected\n" ) if $debug;
1499
		&msg( "disconnecting from $connected\n" ) if $debug;
1500
		if( ! $ftp::fatalerror ){
1500
		if( ! $ftp'fatalerror ){
1501
			&ftp::close();
1501
			&ftp'close();
1502
		}
1502
		}
1503
		else {
1503
		else {
1504
			&ftp::service_closed();
1504
			&ftp'service_closed();
1505
		}
1505
		}
1506
	}
1506
	}
1507
	$connected = '';
1507
	$connected = '';
Lines 1525-1535 Link Here
1525
	&disconnect();
1525
	&disconnect();
1526
1526
1527
	if( $proxy ){
1527
	if( $proxy ){
1528
	    $ftp::proxy = $proxy;
1528
	    $ftp'proxy = $proxy;
1529
	    $ftp::proxy_gateway = $proxy_gateway;
1529
	    $ftp'proxy_gateway = $proxy_gateway;
1530
	    $ftp::proxy_ftp_port = $proxy_ftp_port;
1530
	    $ftp'proxy_ftp_port = $proxy_ftp_port;
1531
	}
1531
	}
1532
	$res = &ftp::open( $site, $ftp_port, $retry_call, $attempts );
1532
	$res = &ftp'open( $site, $ftp_port, $retry_call, $attempts );
1533
	if( $res == 1 ){
1533
	if( $res == 1 ){
1534
		# Connected
1534
		# Connected
1535
		$connected = $site;
1535
		$connected = $site;
Lines 1545-1551 Link Here
1545
	if( $debug > 2 ){
1545
	if( $debug > 2 ){
1546
		&msg( " prodding remote ftpd\n" );
1546
		&msg( " prodding remote ftpd\n" );
1547
	}
1547
	}
1548
	&ftp::pwd();
1548
	&ftp'pwd();
1549
}
1549
}
1550
1550
1551
# checkout and fixup any regexps.
1551
# checkout and fixup any regexps.
Lines 1775-1781 Link Here
1775
	$remote_type[ 0 ] = 0;
1775
	$remote_type[ 0 ] = 0;
1776
	$remote_mode[ 0 ] = 0;
1776
	$remote_mode[ 0 ] = 0;
1777
1777
1778
	if( $remote_fs !~ /cms/ && ! &ftp::cwd( $remote_dir ) ){
1778
	if( $remote_fs !~ /cms/ && ! &ftp'cwd( $remote_dir ) ){
1779
		if( $get_file ){
1779
		if( $get_file ){
1780
			# no files to get
1780
			# no files to get
1781
			return 0;
1781
			return 0;
Lines 1784-1791 Link Here
1784
		&msg( "Failed to change to remote directory ($remote_dir) trying to create it\n" );
1784
		&msg( "Failed to change to remote directory ($remote_dir) trying to create it\n" );
1785
		&mkdirs( $remote_dir );
1785
		&mkdirs( $remote_dir );
1786
1786
1787
		if( ! &ftp::cwd( $remote_dir ) ){
1787
		if( ! &ftp'cwd( $remote_dir ) ){
1788
			&msg( "Cannot change to remote directory ($remote_dir) because: $ftp::response\n" );
1788
			&msg( "Cannot change to remote directory ($remote_dir) because: $ftp'response\n" );
1789
			return 0;
1789
			return 0;
1790
		}
1790
		}
1791
	}
1791
	}
Lines 1814-1820 Link Here
1814
			&msg( "Cannot open $dirtmp\n" );
1814
			&msg( "Cannot open $dirtmp\n" );
1815
			return 0;
1815
			return 0;
1816
		}
1816
		}
1817
		$rls = "main::DIRTMP";
1817
		$rls = "main'DIRTMP";
1818
		# Now we don't want to overwrite our input... better test?
1818
		# Now we don't want to overwrite our input... better test?
1819
		if( $local_ls_lR_file eq $storename ){
1819
		if( $local_ls_lR_file eq $storename ){
1820
			$storename = "/dev/null";
1820
			$storename = "/dev/null";
Lines 1828-1834 Link Here
1828
		}
1828
		}
1829
1829
1830
		&msg( " Getting directory listing from remote file $ls_lR_file\n" ) if $debug;
1830
		&msg( " Getting directory listing from remote file $ls_lR_file\n" ) if $debug;
1831
		if( ! &ftp::get( $ls_lR_file, $dirtmp, 0 ) ){
1831
		if( ! &ftp'get( $ls_lR_file, $dirtmp, 0 ) ){
1832
			&msg( "Cannot get dir listing file\n" );
1832
			&msg( "Cannot get dir listing file\n" );
1833
			return 0;
1833
			return 0;
1834
		}
1834
		}
Lines 1857-1867 Link Here
1857
		}
1857
		}
1858
1858
1859
		open( DIRTMP, $dirtmp ) || die "Cannot open $dirtmp";
1859
		open( DIRTMP, $dirtmp ) || die "Cannot open $dirtmp";
1860
		$rls = "main::DIRTMP";
1860
		$rls = "main'DIRTMP";
1861
	}
1861
	}
1862
	else {
1862
	else {
1863
		$use_ls = 1;
1863
		$use_ls = 1;
1864
		if( ! &ftp::type( 'A' ) ){
1864
		if( ! &ftp'type( 'A' ) ){
1865
			&msg( "Cannot set type to ascii for dir listing, ignored\n" );
1865
			&msg( "Cannot set type to ascii for dir listing, ignored\n" );
1866
			$type_changed = 0;
1866
			$type_changed = 0;
1867
		}
1867
		}
Lines 1870-1886 Link Here
1870
		}
1870
		}
1871
	}
1871
	}
1872
	
1872
	
1873
	$lsparse::fstype = $remote_fs;
1873
	$lsparse'fstype = $remote_fs;
1874
	$lsparse::name = "$site:$package";
1874
	$lsparse'name = "$site:$package";
1875
	
1875
	
1876
	if( $use_ls ){
1876
	if( $use_ls ){
1877
		local( $flags ) = $flags_nonrecursive;
1877
		local( $flags ) = $flags_nonrecursive;
1878
		if( $recursive && ! $recurse_hard ){
1878
		if( $recursive && ! $recurse_hard ){
1879
			$flags = $flags_recursive;
1879
			$flags = $flags_recursive;
1880
		}
1880
		}
1881
		$lsparse::report_subdirs = (! $recurse_hard && $algorithm == 0);
1881
		$lsparse'report_subdirs = (! $recurse_hard && $algorithm == 0);
1882
	 	if( !&ftp::dir_open( $flags ) ){
1882
	 	if( !&ftp'dir_open( $flags ) ){
1883
			&msg( "Cannot get remote directory listing because: $ftp::response\n" );
1883
			&msg( "Cannot get remote directory listing because: $ftp'response\n" );
1884
			return 0;
1884
			return 0;
1885
		}
1885
		}
1886
		
1886
		
Lines 1893-1900 Link Here
1893
		# relative to the remote_dir
1893
		# relative to the remote_dir
1894
		$rcwd = $remote_dir;
1894
		$rcwd = $remote_dir;
1895
	}
1895
	}
1896
	$dateconv::use_timelocal = $use_timelocal;
1896
	$dateconv'use_timelocal = $use_timelocal;
1897
	if( !&lsparse::reset( $rcwd ) ){
1897
	if( !&lsparse'reset( $rcwd ) ){
1898
		&msg( "$remote_fs: unknown fstype\n" );
1898
		&msg( "$remote_fs: unknown fstype\n" );
1899
		return 0;
1899
		return 0;
1900
	}
1900
	}
Lines 1924-1930 Link Here
1924
		# Could optimise this out - but it makes sure that
1924
		# Could optimise this out - but it makes sure that
1925
		# the other end gets a command straight after a possibly
1925
		# the other end gets a command straight after a possibly
1926
		# long dir listing.
1926
		# long dir listing.
1927
		if( ! &ftp::type( $text_mode ? 'A' : 'I' ) ){
1927
		if( ! &ftp'type( $text_mode ? 'A' : 'I' ) ){
1928
			local( $msg ) = "Cannot reset type after dir listing, ";
1928
			local( $msg ) = "Cannot reset type after dir listing, ";
1929
			if( $type_changed ){
1929
			if( $type_changed ){
1930
				# I changed it before - so I must be able to
1930
				# I changed it before - so I must be able to
Lines 1996-2002 Link Here
1996
	while( 1 ){
1996
	while( 1 ){
1997
		while( !eof( $rls ) ){
1997
		while( !eof( $rls ) ){
1998
			( $path, $size, $time, $type, $mode ) =
1998
			( $path, $size, $time, $type, $mode ) =
1999
				&lsparse::line( $rls );
1999
				&lsparse'line( $rls );
2000
			last if $path eq '';
2000
			last if $path eq '';
2001
			if( $ls_fix_mappings ){
2001
			if( $ls_fix_mappings ){
2002
				local( $old_path ) = $path;
2002
				local( $old_path ) = $path;
Lines 2087-2095 Link Here
2087
		}
2087
		}
2088
2088
2089
		if( $use_ls ){
2089
		if( $use_ls ){
2090
			if( ! &ftp::dir_close() ){
2090
			if( ! &ftp'dir_close() ){
2091
				&msg( "Failure at end of remote directory" .
2091
				&msg( "Failure at end of remote directory" .
2092
				 " ($rdir) because: $ftp::response\n" );
2092
				 " ($rdir) because: $ftp'response\n" );
2093
				return 0;
2093
				return 0;
2094
			}
2094
			}
2095
		}
2095
		}
Lines 2099-2107 Link Here
2099
			while( 1 ){
2099
			while( 1 ){
2100
				if( $#dir_list < 0 ){
2100
				if( $#dir_list < 0 ){
2101
					# Make sure we end in the right directory.
2101
					# Make sure we end in the right directory.
2102
					if( ! &ftp::cwd( $remote_dir ) ){
2102
					if( ! &ftp'cwd( $remote_dir ) ){
2103
						&msg( "Cannot change to remote directory" .
2103
						&msg( "Cannot change to remote directory" .
2104
						 " ($rdir) because: $ftp::response\n" );
2104
						 " ($rdir) because: $ftp'response\n" );
2105
						return 0;
2105
						return 0;
2106
					}
2106
					}
2107
					$done = 1;
2107
					$done = 1;
Lines 2112-2120 Link Here
2112
				if( $debug > 2 ){
2112
				if( $debug > 2 ){
2113
					print "scanning: $remote_dir / $rcwd\n";
2113
					print "scanning: $remote_dir / $rcwd\n";
2114
				}
2114
				}
2115
				if( ! &ftp::cwd( $rdir ) ){
2115
				if( ! &ftp'cwd( $rdir ) ){
2116
					&msg( "Cannot change to remote directory" .
2116
					&msg( "Cannot change to remote directory" .
2117
					 " ($rdir) because: $ftp::response\n" );
2117
					 " ($rdir) because: $ftp'response\n" );
2118
					next;
2118
					next;
2119
				}
2119
				}
2120
				last;
2120
				last;
Lines 2122-2133 Link Here
2122
			if( $done ){
2122
			if( $done ){
2123
				last;
2123
				last;
2124
			}
2124
			}
2125
		 	if( !&ftp::dir_open( $flags_nonrecursive ) ){
2125
		 	if( !&ftp'dir_open( $flags_nonrecursive ) ){
2126
				&msg( "Cannot get remote directory" .
2126
				&msg( "Cannot get remote directory" .
2127
				  	" listing because: $ftp::response\n" );
2127
				  	" listing because: $ftp'response\n" );
2128
				return 0;
2128
				return 0;
2129
			}
2129
			}
2130
			&lsparse::reset( $rcwd );
2130
			&lsparse'reset( $rcwd );
2131
			
2131
			
2132
			# round the loop again.
2132
			# round the loop again.
2133
			next;
2133
			next;
Lines 2527-2533 Link Here
2527
	
2527
	
2528
	if( $external_mapping ){
2528
	if( $external_mapping ){
2529
		$old_name = $name;
2529
		$old_name = $name;
2530
		local( $tmp ) = &extmap::map( $name );
2530
		local( $tmp ) = &extmap'map( $name );
2531
		if( $tmp ne $old_name ){
2531
		if( $tmp ne $old_name ){
2532
			$name = $tmp;
2532
			$name = $tmp;
2533
		}
2533
		}
Lines 2688-2698 Link Here
2688
			&transfer_file( $src_path, $dest_path,
2688
			&transfer_file( $src_path, $dest_path,
2689
				       $attribs, $remote_time[ $srci ] );
2689
				       $attribs, $remote_time[ $srci ] );
2690
		if( $get_file && $newpath eq '' ){
2690
		if( $get_file && $newpath eq '' ){
2691
			&msg( $log, "Failed to $XFER file $ftp::response\n" );
2691
			&msg( $log, "Failed to $XFER file $ftp'response\n" );
2692
			if( $ftp::response =~ /timeout|timed out/i ){
2692
			if( $ftp'response =~ /timeout|timed out/i ){
2693
				$timeouts++;
2693
				$timeouts++;
2694
			}
2694
			}
2695
			if( $ftp::fatalerror || $timeouts > $max_timeouts ){
2695
			if( $ftp'fatalerror || $timeouts > $max_timeouts ){
2696
				&msg( $log, "Fatal error talking to site, skipping rest of transfers\n" );
2696
				&msg( $log, "Fatal error talking to site, skipping rest of transfers\n" );
2697
				&disconnect();
2697
				&disconnect();
2698
				return;
2698
				return;
Lines 2752-2762 Link Here
2752
	}
2752
	}
2753
	
2753
	
2754
	if( $vms ){
2754
	if( $vms ){
2755
		&ftp::type( ($src_path =~ /$vms_xfer_text/i) ? 'A' : 'I' );
2755
		&ftp'type( ($src_path =~ /$vms_xfer_text/i) ? 'A' : 'I' );
2756
	}
2756
	}
2757
	
2757
	
2758
	if( $remote_fs eq 'macos' && ! $get_file ){
2758
	if( $remote_fs eq 'macos' && ! $get_file ){
2759
		&ftp::type( 'A' );
2759
		&ftp'type( 'A' );
2760
	}
2760
	}
2761
	
2761
	
2762
	if( ! $get_file ){
2762
	if( ! $get_file ){
Lines 2778-2792 Link Here
2778
			$temp = $dest_path;
2778
			$temp = $dest_path;
2779
		}
2779
		}
2780
2780
2781
		if( ! &ftp::put( $src_file, $temp, $restart ) ){
2781
		if( ! &ftp'put( $src_file, $temp, $restart ) ){
2782
			&msg( $log, "Failed to put $src_file: $ftp::response\n" );
2782
			&msg( $log, "Failed to put $src_file: $ftp'response\n" );
2783
			unlink( $comptemp ) if $comptemp;
2783
			unlink( $comptemp ) if $comptemp;
2784
			return '';
2784
			return '';
2785
		}
2785
		}
2786
	
2786
	
2787
		unlink( $comptemp ) if $comptemp;
2787
		unlink( $comptemp ) if $comptemp;
2788
		if( !$no_rename && ! &ftp::rename( $temp, $dest_path ) ){
2788
		if( !$no_rename && ! &ftp'rename( $temp, $dest_path ) ){
2789
			&msg( $log, "Failed to remote rename $temp to $dest_path: $ftp::response\n" );
2789
			&msg( $log, "Failed to remote rename $temp to $dest_path: $ftp'response\n" );
2790
			return '';
2790
			return '';
2791
		}
2791
		}
2792
2792
Lines 2810-2820 Link Here
2810
	# it.
2810
	# it.
2811
2811
2812
	# Get a file
2812
	# Get a file
2813
	&ftp::dostrip( $strip_cr );
2813
	&ftp'dostrip( $strip_cr );
2814
	$start_time = time;
2814
	$start_time = time;
2815
	if( ! &ftp::get( $src_path, $temp, $restart ) ){
2815
	if( ! &ftp'get( $src_path, $temp, $restart ) ){
2816
		if( !$failed_gets_excl || $ftp::response !~ /$failed_gets_excl/ ){
2816
		if( !$failed_gets_excl || $ftp'response !~ /$failed_gets_excl/ ){
2817
			&msg( $log, "Failed to get $src_path: $ftp::response\n" );
2817
			&msg( $log, "Failed to get $src_path: $ftp'response\n" );
2818
		}
2818
		}
2819
2819
2820
		# Time stamp the temp file to allow for a restart
2820
		# Time stamp the temp file to allow for a restart
Lines 2833-2839 Link Here
2833
2833
2834
	# delete source file after successful transfer
2834
	# delete source file after successful transfer
2835
	if( $delete_source ){
2835
	if( $delete_source ){
2836
		if( &ftp::delete( $src_path ) ){
2836
		if( &ftp'delete( $src_path ) ){
2837
			&msg( $log, "Deleted remote $src_path\n");
2837
			&msg( $log, "Deleted remote $src_path\n");
2838
		}
2838
		}
2839
		else {
2839
		else {
Lines 3185-3191 Link Here
3185
			}
3185
			}
3186
			else {
3186
			else {
3187
				&msg( $log, "delete DIR $del\n" );
3187
				&msg( $log, "delete DIR $del\n" );
3188
				&ftp::delete( "$del" ) ||
3188
				&ftp'delete( "$del" ) ||
3189
					&msg( $log, "ftp delete DIR $del failed\n" );
3189
					&msg( $log, "ftp delete DIR $del failed\n" );
3190
			}
3190
			}
3191
		}
3191
		}
Lines 3209-3215 Link Here
3209
		}
3209
		}
3210
		else {
3210
		else {
3211
			&msg( $log, "delete FILE $del\n" );
3211
			&msg( $log, "delete FILE $del\n" );
3212
			&ftp::delete( "$del" ) ||
3212
			&ftp'delete( "$del" ) ||
3213
				&msg( $log, "ftp delete FILE $del failed\n" );
3213
				&msg( $log, "ftp delete FILE $del failed\n" );
3214
		}
3214
		}
3215
	}
3215
	}
Lines 3355-3366 Link Here
3355
	}
3355
	}
3356
	else {
3356
	else {
3357
		# make a remote directory
3357
		# make a remote directory
3358
		$val = &ftp::mkdir( $dir );
3358
		$val = &ftp'mkdir( $dir );
3359
3359
3360
		# The mkdir might have failed due to bad mode
3360
		# The mkdir might have failed due to bad mode
3361
		# So try to chmod it anyway
3361
		# So try to chmod it anyway
3362
		if( $remote_has_chmod ){
3362
		if( $remote_has_chmod ){
3363
			$val = &ftp::chmod( $dir, $mode );
3363
			$val = &ftp'chmod( $dir, $mode );
3364
		}
3364
		}
3365
	}
3365
	}
3366
3366
Lines 3379-3392 Link Here
3379
	}
3379
	}
3380
	else {
3380
	else {
3381
		# check if remote directory exists
3381
		# check if remote directory exists
3382
		local($old_dir) = &ftp::pwd();		
3382
		local($old_dir) = &ftp'pwd();		
3383
		
3383
		
3384
		$val = &ftp::cwd($dir);
3384
		$val = &ftp'cwd($dir);
3385
3385
3386
		# If I didn't manage to change dir should be where I was!
3386
		# If I didn't manage to change dir should be where I was!
3387
		if( $val ){
3387
		if( $val ){
3388
			# go back to the original directory
3388
			# go back to the original directory
3389
			&ftp::cwd($old_dir) || die "Cannot cd to original remote directory";
3389
			&ftp'cwd($old_dir) || die "Cannot cd to original remote directory";
3390
		}
3390
		}
3391
	}
3391
	}
3392
	return $val;
3392
	return $val;
Lines 3440-3446 Link Here
3440
	else {
3440
	else {
3441
		# change the remote file
3441
		# change the remote file
3442
		if( $remote_has_chmod ){
3442
		if( $remote_has_chmod ){
3443
			&ftp::chmod( $path, $mode );
3443
			&ftp'chmod( $path, $mode );
3444
		}
3444
		}
3445
	}
3445
	}
3446
}
3446
}
(-)/lib/perl5/vendor_perl/5.38.2/dateconv.pl (-4 / +4 lines)
Lines 75-81 Link Here
75
# input date and time string from ftp "ls -l", such as Mmm dd yyyy or
75
# input date and time string from ftp "ls -l", such as Mmm dd yyyy or
76
# Mmm dd HH:MM,
76
# Mmm dd HH:MM,
77
# return $time number via gmlocal( $string ).
77
# return $time number via gmlocal( $string ).
78
sub main::lstime_to_time
78
sub main'lstime_to_time
79
{
79
{
80
	package dateconv;
80
	package dateconv;
81
81
Lines 127-141 Link Here
127
	}
127
	}
128
128
129
	if( $use_timelocal ){
129
	if( $use_timelocal ){
130
		return &::timelocal( $secs, $mins, $hours, $day, $month, $year );
130
		return &'timelocal( $secs, $mins, $hours, $day, $month, $year );
131
	}
131
	}
132
	else {
132
	else {
133
		return &::timegm( $secs, $mins, $hours, $day, $month, $year );
133
		return &'timegm( $secs, $mins, $hours, $day, $month, $year );
134
	}
134
	}
135
}
135
}
136
136
137
# input time number, output GMT string as "dd Mmm YYYY HH:MM"
137
# input time number, output GMT string as "dd Mmm YYYY HH:MM"
138
sub main::time_to_standard
138
sub main'time_to_standard
139
{
139
{
140
	package dateconv;
140
	package dateconv;
141
141
(-)/lib/perl5/vendor_perl/5.38.2/lchat.pl (-21 / +21 lines)
Lines 34-40 Link Here
34
# Lots of changes.  See CHANGES since 2.8 file.
34
# Lots of changes.  See CHANGES since 2.8 file.
35
#
35
#
36
# Revision 2.3  1994/02/03  13:45:35  lmjm
36
# Revision 2.3  1994/02/03  13:45:35  lmjm
37
# Correct chat::read (bfriesen@simple.sat.tx.us)
37
# Correct chat'read (bfriesen@simple.sat.tx.us)
38
#
38
#
39
# Revision 2.2  1993/12/14  11:09:03  lmjm
39
# Revision 2.2  1993/12/14  11:09:03  lmjm
40
# Only include sys/socket.ph if not already there.
40
# Only include sys/socket.ph if not already there.
Lines 55-61 Link Here
55
	eval "use Socket";
55
	eval "use Socket";
56
}
56
}
57
else {
57
else {
58
	unless( defined &::PF_INET ){
58
	unless( defined &'PF_INET ){
59
		eval "sub ATT { 0; } sub INTEL { 0; }";
59
		eval "sub ATT { 0; } sub INTEL { 0; }";
60
		do 'sys/socket.ph';
60
		do 'sys/socket.ph';
61
	}
61
	}
Lines 63-82 Link Here
63
63
64
# Get the correct magic numbers for socket work.
64
# Get the correct magic numbers for socket work.
65
if( $] =~ /^5\.\d+$/ ){
65
if( $] =~ /^5\.\d+$/ ){
66
	# Perl 5 has a special way of getting them via the 'use Socket::
66
	# Perl 5 has a special way of getting them via the 'use Socket'
67
	# above.
67
	# above.
68
	$main::pf_inet = &Socket::PF_INET;
68
	$main'pf_inet = &Socket'PF_INET;
69
	$main::sock_stream = &Socket::SOCK_STREAM;
69
	$main'sock_stream = &Socket'SOCK_STREAM;
70
	local($name, $aliases, $proto) = getprotobyname( 'tcp' );
70
	local($name, $aliases, $proto) = getprotobyname( 'tcp' );
71
	$main::tcp_proto = $proto;
71
	$main'tcp_proto = $proto;
72
}
72
}
73
elsif( defined( &::PF_INET ) ){
73
elsif( defined( &'PF_INET ) ){
74
	# Perl 4 needs to have the socket.ph file created when perl was
74
	# Perl 4 needs to have the socket.ph file created when perl was
75
	# installed.
75
	# installed.
76
	$main::pf_inet = &::PF_INET;
76
	$main'pf_inet = &'PF_INET;
77
	$main::sock_stream = &::SOCK_STREAM;
77
	$main'sock_stream = &'SOCK_STREAM;
78
	local($name, $aliases, $proto) = getprotobyname( 'tcp' );
78
	local($name, $aliases, $proto) = getprotobyname( 'tcp' );
79
	$main::tcp_proto = $proto;
79
	$main'tcp_proto = $proto;
80
}
80
}
81
else {
81
else {
82
	# Whoever installed perl didn't run h2ph !!!
82
	# Whoever installed perl didn't run h2ph !!!
Lines 84-92 Link Here
84
	#  last resort
84
	#  last resort
85
	# Use hardwired versions
85
	# Use hardwired versions
86
	# but who the heck would change these anyway? (:-)
86
	# but who the heck would change these anyway? (:-)
87
	$main::pf_inet = 2;
87
	$main'pf_inet = 2;
88
	$main::sock_stream = 1; # Sigh... On Solaris set this to 2
88
	$main'sock_stream = 1; # Sigh... On Solaris set this to 2
89
	$main::tcp_proto = 6;
89
	$main'tcp_proto = 6;
90
	warn "lchat.pl: using hardwired in network constantants";
90
	warn "lchat.pl: using hardwired in network constantants";
91
}
91
}
92
92
Lines 108-114 Link Here
108
}
108
}
109
109
110
110
111
## &chat::open_port("server.address",$port_number);
111
## &chat'open_port("server.address",$port_number);
112
## opens a named or numbered TCP server
112
## opens a named or numbered TCP server
113
sub open_port { ## public
113
sub open_port { ## public
114
	local($server, $port) = @_;
114
	local($server, $port) = @_;
Lines 129-135 Link Here
129
		$serveraddr = $x[4];
129
		$serveraddr = $x[4];
130
	}
130
	}
131
	$serverproc = pack($sockaddr, 2, $port, $serveraddr);
131
	$serverproc = pack($sockaddr, 2, $port, $serveraddr);
132
	unless (socket(S, $main::pf_inet, $main::sock_stream, $main::tcp_proto)) {
132
	unless (socket(S, $main'pf_inet, $main'sock_stream, $main'tcp_proto)) {
133
		($!) = ($!, close(S)); # close S while saving $!
133
		($!) = ($!, close(S)); # close S while saving $!
134
		return undef;
134
		return undef;
135
	}
135
	}
Lines 197-203 Link Here
197
##############################################################################
197
##############################################################################
198
198
199
199
200
## $return = &chat::expect($timeout_time,
200
## $return = &chat'expect($timeout_time,
201
## 	$pat1, $body1, $pat2, $body2, ... )
201
## 	$pat1, $body1, $pat2, $body2, ... )
202
## $timeout_time is the time (either relative to the current time, or
202
## $timeout_time is the time (either relative to the current time, or
203
## absolute, ala time(2)) at which a timeout event occurs.
203
## absolute, ala time(2)) at which a timeout event occurs.
Lines 293-299 Link Here
293
		 		select($rmask, undef, undef, $endtime - time);
293
		 		select($rmask, undef, undef, $endtime - time);
294
			if ($nfound) {
294
			if ($nfound) {
295
				$nread = sysread(S, $thisbuf, 1024);
295
				$nread = sysread(S, $thisbuf, 1024);
296
				if( $chat::debug ){
296
				if( $chat'debug ){
297
					print STDERR "sysread $nread ";
297
					print STDERR "sysread $nread ";
298
					print STDERR ">>$thisbuf<<\n";
298
					print STDERR ">>$thisbuf<<\n";
299
				}
299
				}
Lines 316-336 Link Here
316
	& $subname();
316
	& $subname();
317
}
317
}
318
318
319
## &chat::print(@data)
319
## &chat'print(@data)
320
sub print { ## public
320
sub print { ## public
321
	print S @_;
321
	print S @_;
322
	if( $chat::debug ){
322
	if( $chat'debug ){
323
		print STDERR "printed:";
323
		print STDERR "printed:";
324
		print STDERR @_;
324
		print STDERR @_;
325
	}
325
	}
326
}
326
}
327
327
328
## &chat::close()
328
## &chat'close()
329
sub close { ## public
329
sub close { ## public
330
	close(S);
330
	close(S);
331
}
331
}
332
332
333
# &chat::read(*buf, $ntoread )
333
# &chat'read(*buf, $ntoread )
334
# blocking read. returns no. of bytes read and puts data in $buf.
334
# blocking read. returns no. of bytes read and puts data in $buf.
335
# If called with ntoread < 0 then just do the accept and return 0.
335
# If called with ntoread < 0 then just do the accept and return 0.
336
sub read { ## public
336
sub read { ## public
(-)/lib/perl5/vendor_perl/5.38.2/lftp.pl (-68 / +68 lines)
Lines 28-44 Link Here
28
#  $ftp_port = 21;
28
#  $ftp_port = 21;
29
#  $retry_call = 1;
29
#  $retry_call = 1;
30
#  $attempts = 2;
30
#  $attempts = 2;
31
#  if( &ftp::open( $site, $ftp_port, $retry_call, $attempts ) != 1 ){
31
#  if( &ftp'open( $site, $ftp_port, $retry_call, $attempts ) != 1 ){
32
#   die "failed to open ftp connection";
32
#   die "failed to open ftp connection";
33
#  }
33
#  }
34
#  if( ! &ftp::login( $user, $pass ) ){
34
#  if( ! &ftp'login( $user, $pass ) ){
35
#   die "failed to login";
35
#   die "failed to login";
36
#  }
36
#  }
37
#  &ftp::type( $text_mode ? 'A' : 'I' );
37
#  &ftp'type( $text_mode ? 'A' : 'I' );
38
#  if( ! &ftp::get( $remote_filename, $local_filename, 0 ) ){
38
#  if( ! &ftp'get( $remote_filename, $local_filename, 0 ) ){
39
#   die "failed to get file";
39
#   die "failed to get file";
40
#  }
40
#  }
41
#  &ftp::close();
41
#  &ftp'close();
42
#
42
#
43
#
43
#
44
# $Id: ftp.pl,v 2.9 1998/05/29 19:02:00 lmjm Exp lmjm $
44
# $Id: ftp.pl,v 2.9 1998/05/29 19:02:00 lmjm Exp lmjm $
Lines 94-102 Link Here
94
94
95
# This is a "global" it contains the last response from the remote ftp server
95
# This is a "global" it contains the last response from the remote ftp server
96
# for use in error messages
96
# for use in error messages
97
$ftp::response = "";
97
$ftp'response = "";
98
98
99
# Also ftp::NS is the socket containing the data coming in from the remote ls
99
# Also ftp'NS is the socket containing the data coming in from the remote ls
100
# command.
100
# command.
101
101
102
# The size of block to be read or written when talking to the remote
102
# The size of block to be read or written when talking to the remote
Lines 115-126 Link Here
115
$real_site = "";
115
$real_site = "";
116
116
117
# "Global" Where error/log reports are sent to
117
# "Global" Where error/log reports are sent to
118
$ftp::showfd = 'STDERR';
118
$ftp'showfd = 'STDERR';
119
119
120
# Should a 421 be treated as a connection close and return 99 from
120
# Should a 421 be treated as a connection close and return 99 from
121
# ftp::expect.  This is against rfc1123 recommendations but I've found
121
# ftp'expect.  This is against rfc1123 recommendations but I've found
122
# it to be a wise default.
122
# it to be a wise default.
123
$ftp::drop_on_421 = 1;
123
$ftp'drop_on_421 = 1;
124
124
125
# Name of a function to call on a pathname to map it into a remote
125
# Name of a function to call on a pathname to map it into a remote
126
# pathname.
126
# pathname.
Lines 131-137 Link Here
131
$ftp_show = 0;
131
$ftp_show = 0;
132
132
133
# Global set on a error that aborts the connection
133
# Global set on a error that aborts the connection
134
$ftp::fatalerror = 0;
134
$ftp'fatalerror = 0;
135
135
136
# Whether to keep the continuation messages so the user can look at them
136
# Whether to keep the continuation messages so the user can look at them
137
$keep_continuations = 0;
137
$keep_continuations = 0;
Lines 140-146 Link Here
140
$read_in = undef;
140
$read_in = undef;
141
141
142
# should we use the PASV extension to the ftp protocol?
142
# should we use the PASV extension to the ftp protocol?
143
$ftp::use_pasv = 0;    # 0=no (default), 1=yes
143
$ftp'use_pasv = 0;    # 0=no (default), 1=yes
144
144
145
# Variable only used if proxying
145
# Variable only used if proxying
146
$proxy = $proxy_gateway = $proxy_ftp_port = '';
146
$proxy = $proxy_gateway = $proxy_ftp_port = '';
Lines 150-179 Link Here
150
# (Normally set elsewhere - this is just a sensible default.)
150
# (Normally set elsewhere - this is just a sensible default.)
151
# Is expected to take count and code as arguments and prompt
151
# Is expected to take count and code as arguments and prompt
152
# for the secret key  with 'password:' on stdout and then print the password.
152
# for the secret key  with 'password:' on stdout and then print the password.
153
$ftp::keygen_prog = '/usr/local/bin/key';
153
$ftp'keygen_prog = '/usr/local/bin/key';
154
154
155
# Uncomment to turn on lots of debugging.
155
# Uncomment to turn on lots of debugging.
156
# &debug( 10 );
156
# &debug( 10 );
157
157
158
# Limit how much data any one ftp::get can pull back
158
# Limit how much data any one ftp'get can pull back
159
# Negative values cause the size check to be skipped.
159
# Negative values cause the size check to be skipped.
160
$max_get_size = -1;
160
$max_get_size = -1;
161
161
162
# Where I am connected to.
162
# Where I am connected to.
163
$connect_site = '';
163
$connect_site = '';
164
164
165
# &ftp::debug( debugging_level )
165
# &ftp'debug( debugging_level )
166
# Turn on debugging ranging from 1 = some to 10 = everything
166
# Turn on debugging ranging from 1 = some to 10 = everything
167
sub ftp::debug
167
sub ftp'debug
168
{
168
{
169
	$ftp_show = $_[0];
169
	$ftp_show = $_[0];
170
	if( $ftp_show > 9 ){
170
	if( $ftp_show > 9 ){
171
		$chat::debug = 1;
171
		$chat'debug = 1;
172
	}
172
	}
173
}
173
}
174
174
175
# &ftp::set_timeout( seconds )
175
# &ftp'set_timeout( seconds )
176
sub ftp::set_timeout
176
sub ftp'set_timeout
177
{
177
{
178
	local( $to ) = @_;
178
	local( $to ) = @_;
179
	return if $to == $timeout;
179
	return if $to == $timeout;
Lines 226-232 Link Here
226
			$connect_site = $site;
226
			$connect_site = $site;
227
			$connect_port = $ftp_port;
227
			$connect_port = $ftp_port;
228
		}
228
		}
229
		if( ! &chat::open_port( $connect_site, $connect_port ) ){
229
		if( ! &chat'open_port( $connect_site, $connect_port ) ){
230
			if( $retry_call ){
230
			if( $retry_call ){
231
				print $showfd "Failed to connect\n" if $ftp_show;
231
				print $showfd "Failed to connect\n" if $ftp_show;
232
				next;
232
				next;
Lines 240-246 Link Here
240
		$ret = &expect( $timeout,
240
		$ret = &expect( $timeout,
241
			2, 1 ); # ready for login to $site
241
			2, 1 ); # ready for login to $site
242
		if( $ret != 1 ){
242
		if( $ret != 1 ){
243
			&chat::close();
243
			&chat'close();
244
			next;
244
			next;
245
		}
245
		}
246
		return 1;
246
		return 1;
Lines 264-284 Link Here
264
}
264
}
265
265
266
# Setup a signal handler for possible errors.
266
# Setup a signal handler for possible errors.
267
sub ftp::set_signals
267
sub ftp'set_signals
268
{
268
{
269
	$ftp_logger = @_;
269
	$ftp_logger = @_;
270
	$SIG{ 'PIPE' } = "ftp::ftp__sighandler";
270
	$SIG{ 'PIPE' } = "ftp'ftp__sighandler";
271
}
271
}
272
272
273
# Setup a signal handler for user interrupts.
273
# Setup a signal handler for user interrupts.
274
sub ftp::set_user_signals
274
sub ftp'set_user_signals
275
{
275
{
276
	$ftp_logger = @_;
276
	$ftp_logger = @_;
277
	$SIG{ 'INT' } = "ftp::ftp__sighandler";
277
	$SIG{ 'INT' } = "ftp'ftp__sighandler";
278
}
278
}
279
279
280
# &ftp::set_namemap( function to map outgoing name,  function to map incoming )
280
# &ftp'set_namemap( function to map outgoing name,  function to map incoming )
281
sub ftp::set_namemap
281
sub ftp'set_namemap
282
{
282
{
283
	($mapunixout, $mapunixin) = @_;
283
	($mapunixout, $mapunixin) = @_;
284
	if( $debug ) {
284
	if( $debug ) {
Lines 286-297 Link Here
286
	}
286
	}
287
}
287
}
288
288
289
# &ftp::open( hostname or address,
289
# &ftp'open( hostname or address,
290
#            port to use,
290
#            port to use,
291
#            retry on call failure,
291
#            retry on call failure,
292
#	     number of attempts to retry )
292
#	     number of attempts to retry )
293
# returns 1 if connected, 0 otherwise
293
# returns 1 if connected, 0 otherwise
294
sub ftp::open
294
sub ftp'open
295
{
295
{
296
	local( $site, $ftp_port, $retry_call, $attempts ) = @_;
296
	local( $site, $ftp_port, $retry_call, $attempts ) = @_;
297
297
Lines 318-326 Link Here
318
	return $ret;
318
	return $ret;
319
}
319
}
320
320
321
# &ftp::login( user, password, account )
321
# &ftp'login( user, password, account )
322
# the account part is optional unless the remote service requires one.
322
# the account part is optional unless the remote service requires one.
323
sub ftp::login
323
sub ftp'login
324
{
324
{
325
	local( $remote_user, $remote_password, $remote_account ) = @_;
325
	local( $remote_user, $remote_password, $remote_account ) = @_;
326
        local( $ret );
326
        local( $ret );
Lines 357-367 Link Here
357
		# check for s/key challenge - eg, [s/key 994 ph29005]
357
		# check for s/key challenge - eg, [s/key 994 ph29005]
358
		# If we are talking to skey then use remote_password as the
358
		# If we are talking to skey then use remote_password as the
359
		# secret to generate a real password
359
		# secret to generate a real password
360
		if( $ftp::response =~ m#\[s/key (\d+) (\w+)\]# ){
360
		if( $ftp'response =~ m#\[s/key (\d+) (\w+)\]# ){
361
			local( $count, $code ) = ($1, $2);
361
			local( $count, $code ) = ($1, $2);
362
362
363
			# TODO: report open failure & remove need for echo
363
			# TODO: report open failure & remove need for echo
364
			open( SKEY, "echo $remote_password | $ftp::keygen_prog $count $code |" );
364
			open( SKEY, "echo $remote_password | $ftp'keygen_prog $count $code |" );
365
			while( <SKEY> ){
365
			while( <SKEY> ){
366
				if( ! /password:/ ){
366
				if( ! /password:/ ){
367
					chop( $remote_password = $_ );
367
					chop( $remote_password = $_ );
Lines 417-437 Link Here
417
sub service_closed
417
sub service_closed
418
{
418
{
419
	$service_open = 0;
419
	$service_open = 0;
420
	&chat::close();
420
	&chat'close();
421
}
421
}
422
422
423
# Close down the current ftp connecting in an orderly way.
423
# Close down the current ftp connecting in an orderly way.
424
sub ftp::close
424
sub ftp'close
425
{
425
{
426
	&quit();
426
	&quit();
427
	$service_open = 0;
427
	$service_open = 0;
428
	&chat::close();
428
	&chat'close();
429
}
429
}
430
430
431
# &ftp::cwd( directory )
431
# &ftp'cwd( directory )
432
# Change to the given directory
432
# Change to the given directory
433
# return 1 if successful, 0 otherwise
433
# return 1 if successful, 0 otherwise
434
sub ftp::cwd
434
sub ftp'cwd
435
{
435
{
436
	local( $dir ) = @_;
436
	local( $dir ) = @_;
437
	local( $ret );
437
	local( $ret );
Lines 466-472 Link Here
466
sub pasv
466
sub pasv
467
{
467
{
468
	# At some point I need to close/free S2, no?
468
	# At some point I need to close/free S2, no?
469
	unless( socket( S2, $main::pf_inet, $main::sock_stream, $main::tcp_proto ) ){
469
	unless( socket( S2, $main'pf_inet, $main'sock_stream, $main'tcp_proto ) ){
470
		($!) = ($!, close(S2)); # close S2 while saving $!
470
		($!) = ($!, close(S2)); # close S2 while saving $!
471
		return undef;
471
		return undef;
472
	}
472
	}
Lines 503-509 Link Here
503
	}
503
	}
504
504
505
	# now need to connect() the new socket
505
	# now need to connect() the new socket
506
	if( ! &chat::open_newport( $newhost, $newport, *S2 ) ){
506
	if( ! &chat'open_newport( $newhost, $newport, *S2 ) ){
507
		if( $retry_call ){
507
		if( $retry_call ){
508
			print $showfd "Failed to connect newport\n" if $ftp_show;
508
			print $showfd "Failed to connect newport\n" if $ftp_show;
509
			next;
509
			next;
Lines 517-528 Link Here
517
}
517
}
518
518
519
519
520
# &ftp::dir( remote LIST options )
520
# &ftp'dir( remote LIST options )
521
# Start a list going with the given options.
521
# Start a list going with the given options.
522
# Presuming that the remote deamon uses the ls command to generate the
522
# Presuming that the remote deamon uses the ls command to generate the
523
# data to send back then then you can send it some extra options (eg: -lRa)
523
# data to send back then then you can send it some extra options (eg: -lRa)
524
# return 1 if sucessful, 0 otherwise
524
# return 1 if sucessful, 0 otherwise
525
sub ftp::dir_open
525
sub ftp'dir_open
526
{
526
{
527
	local( $options ) = @_;
527
	local( $options ) = @_;
528
	local( $ret );
528
	local( $ret );
Lines 579-585 Link Here
579
579
580
# Close down reading the result of a remote ls command
580
# Close down reading the result of a remote ls command
581
# return 1 if successful, 0 otherwise
581
# return 1 if successful, 0 otherwise
582
sub ftp::dir_close
582
sub ftp'dir_close
583
{
583
{
584
	local( $ret );
584
	local( $ret );
585
585
Lines 608-614 Link Here
608
608
609
# Quit from the remote ftp server
609
# Quit from the remote ftp server
610
# return 1 if successful and 0 on failure
610
# return 1 if successful and 0 on failure
611
#  Users should be calling &ftp::close();
611
#  Users should be calling &ftp'close();
612
sub quit
612
sub quit
613
{
613
{
614
	local( $ret );
614
	local( $ret );
Lines 693-712 Link Here
693
	return syswrite( NS, $ftpbuf, $ftpbufsize );
693
	return syswrite( NS, $ftpbuf, $ftpbufsize );
694
}
694
}
695
695
696
# &ftp::dostrip( true or false )
696
# &ftp'dostrip( true or false )
697
# Turn on or off stripping of incoming carriage returns.
697
# Turn on or off stripping of incoming carriage returns.
698
sub ftp::dostrip
698
sub ftp'dostrip
699
{
699
{
700
	($strip_cr ) = @_;
700
	($strip_cr ) = @_;
701
}
701
}
702
702
703
# &ftp::get( remote file, local file, try restarting where last xfer failed )
703
# &ftp'get( remote file, local file, try restarting where last xfer failed )
704
# Get a remote file back into a local file.
704
# Get a remote file back into a local file.
705
# If no loc_fname passed then uses rem_fname.
705
# If no loc_fname passed then uses rem_fname.
706
# If $restart set and the remote site supports it then restart where
706
# If $restart set and the remote site supports it then restart where
707
# last xfer left off.
707
# last xfer left off.
708
# returns 1 on success, 0 otherwise
708
# returns 1 on success, 0 otherwise
709
sub ftp::get
709
sub ftp'get
710
{
710
{
711
	local($rem_fname, $loc_fname, $restart ) = @_;
711
	local($rem_fname, $loc_fname, $restart ) = @_;
712
	local( $ret );
712
	local( $ret );
Lines 893-899 Link Here
893
	return $ret;
893
	return $ret;
894
}
894
}
895
895
896
# &ftp::delete( remote filename )
896
# &ftp'delete( remote filename )
897
# Delete a file from the remote site.
897
# Delete a file from the remote site.
898
# returns 1 if successful, 0 otherwise
898
# returns 1 if successful, 0 otherwise
899
sub delete
899
sub delete
Lines 929-937 Link Here
929
    # RMD
929
    # RMD
930
}
930
}
931
931
932
# &ftp::put( local filename, remote filename, restart where left off )
932
# &ftp'put( local filename, remote filename, restart where left off )
933
# Similar to get but sends file to the remote site.
933
# Similar to get but sends file to the remote site.
934
sub ftp::put
934
sub ftp'put
935
{
935
{
936
	local( $loc_fname, $rem_fname ) = @_;
936
	local( $loc_fname, $rem_fname ) = @_;
937
	local( $strip_cr );
937
	local( $strip_cr );
Lines 1097-1105 Link Here
1097
	return $ret;
1097
	return $ret;
1098
}
1098
}
1099
1099
1100
# &ftp::restart( byte_offset )
1100
# &ftp'restart( byte_offset )
1101
# Restart the next transfer from the given offset
1101
# Restart the next transfer from the given offset
1102
sub ftp::restart
1102
sub ftp'restart
1103
{
1103
{
1104
	local( $restart_point, $ret ) = @_;
1104
	local( $restart_point, $ret ) = @_;
1105
1105
Lines 1121-1127 Link Here
1121
	return $ret;
1121
	return $ret;
1122
}
1122
}
1123
1123
1124
# &ftp::type( 'A' or 'I' )
1124
# &ftp'type( 'A' or 'I' )
1125
# set transfer type to Ascii or Image.
1125
# set transfer type to Ascii or Image.
1126
sub type
1126
sub type
1127
{
1127
{
Lines 1149-1155 Link Here
1149
@site_command_list = ();
1149
@site_command_list = ();
1150
1150
1151
# routine to query the remote server for 'SITE' commands supported
1151
# routine to query the remote server for 'SITE' commands supported
1152
sub ftp::site_commands
1152
sub ftp'site_commands
1153
{
1153
{
1154
	local( $ret );
1154
	local( $ret );
1155
	
1155
	
Lines 1189-1195 Link Here
1189
}
1189
}
1190
1190
1191
# return the pwd, or null if we can't get the pwd
1191
# return the pwd, or null if we can't get the pwd
1192
sub ftp::pwd
1192
sub ftp'pwd
1193
{
1193
{
1194
	local( $ret, $cwd );
1194
	local( $ret, $cwd );
1195
1195
Lines 1220-1226 Link Here
1220
	return $cwd;
1220
	return $cwd;
1221
}
1221
}
1222
1222
1223
# &ftp::mkdir( directory name )
1223
# &ftp'mkdir( directory name )
1224
# Create a directory on the remote site
1224
# Create a directory on the remote site
1225
# return 1 for success, 0 otherwise
1225
# return 1 for success, 0 otherwise
1226
sub mkdir
1226
sub mkdir
Lines 1250-1256 Link Here
1250
	return $ret;
1250
	return $ret;
1251
}
1251
}
1252
1252
1253
# &ftp::chmod( pathname, new mode )
1253
# &ftp'chmod( pathname, new mode )
1254
# Change the mode of a file on the remote site.
1254
# Change the mode of a file on the remote site.
1255
# return 1 for success, 0 for failure
1255
# return 1 for success, 0 for failure
1256
sub chmod
1256
sub chmod
Lines 1280-1289 Link Here
1280
	return $ret;
1280
	return $ret;
1281
}
1281
}
1282
1282
1283
# &ftp::rename( old name, new name )
1283
# &ftp'rename( old name, new name )
1284
# Rename a file on the remote site.
1284
# Rename a file on the remote site.
1285
# returns 1 if successful, 0 otherwise
1285
# returns 1 if successful, 0 otherwise
1286
sub ftp::rename
1286
sub ftp'rename
1287
{
1287
{
1288
	local( $old_name, $new_name ) = @_;
1288
	local( $old_name, $new_name ) = @_;
1289
	local( $ret );
1289
	local( $ret );
Lines 1331-1338 Link Here
1331
}
1331
}
1332
1332
1333
1333
1334
# &ftp::quote( site command );
1334
# &ftp'quote( site command );
1335
sub ftp::quote
1335
sub ftp'quote
1336
{
1336
{
1337
	local( $cmd ) = @_;
1337
	local( $cmd ) = @_;
1338
	local( $ret );
1338
	local( $ret );
Lines 1370-1376 Link Here
1370
}
1370
}
1371
1371
1372
#
1372
#
1373
#  create the list of parameters for chat::expect
1373
#  create the list of parameters for chat'expect
1374
#
1374
#
1375
#  expect( time_out, {value, return value} );
1375
#  expect( time_out, {value, return value} );
1376
#  the last response is stored in $response
1376
#  the last response is stored in $response
Lines 1433-1439 Link Here
1433
		if( $ftp_show > 9 ){
1433
		if( $ftp_show > 9 ){
1434
			&printargs( $time_out, @expect_args );
1434
			&printargs( $time_out, @expect_args );
1435
		}
1435
		}
1436
		$ret = &chat::expect( $time_out, @expect_args );
1436
		$ret = &chat'expect( $time_out, @expect_args );
1437
	}
1437
	}
1438
1438
1439
	return $ret;
1439
	return $ret;
Lines 1455-1464 Link Here
1455
	
1455
	
1456
	$sockaddr = 'S n a4 x8';
1456
	$sockaddr = 'S n a4 x8';
1457
1457
1458
	($a,$b,$c,$d) = unpack( 'C4', $chat::thisaddr );
1458
	($a,$b,$c,$d) = unpack( 'C4', $chat'thisaddr );
1459
	$this = $chat::thisproc;
1459
	$this = $chat'thisproc;
1460
	
1460
	
1461
	if( ! socket( S, $main::pf_inet, $main::sock_stream, $main::tcp_proto ) ){
1461
	if( ! socket( S, $main'pf_inet, $main'sock_stream, $main'tcp_proto ) ){
1462
		warn "socket: $!";
1462
		warn "socket: $!";
1463
		return 0;
1463
		return 0;
1464
	}
1464
	}
Lines 1511-1517 Link Here
1511
		print $showfd "---> $sc\n";
1511
		print $showfd "---> $sc\n";
1512
	}
1512
	}
1513
	
1513
	
1514
	&chat::print( "$send_cmd\r\n" );
1514
	&chat'print( "$send_cmd\r\n" );
1515
}
1515
}
1516
1516
1517
sub accept
1517
sub accept
(-)/lib/perl5/vendor_perl/5.38.2/lsparse.pl (-67 / +67 lines)
Lines 14-20 Link Here
14
# This software is provided "as is" without express or implied warranty.
14
# This software is provided "as is" without express or implied warranty.
15
#
15
#
16
# Parse "ls -lR" type listings
16
# Parse "ls -lR" type listings
17
# use lsparse::reset( dirname ) repeately
17
# use lsparse'reset( dirname ) repeately
18
#
18
#
19
# By Lee McLoughlin <lmjm@icparc.ic.ac.uk>
19
# By Lee McLoughlin <lmjm@icparc.ic.ac.uk>
20
#
20
#
Lines 61-78 Link Here
61
local( $match );
61
local( $match );
62
62
63
# The filestore type being scanned
63
# The filestore type being scanned
64
$lsparse::fstype = 'unix';
64
$lsparse'fstype = 'unix';
65
65
66
# Keep whatever case is on the remote system.  Otherwise lowercase it.
66
# Keep whatever case is on the remote system.  Otherwise lowercase it.
67
$lsparse::vms_keep_case = '';
67
$lsparse'vms_keep_case = '';
68
68
69
# A name to report when errors occur
69
# A name to report when errors occur
70
$lsparse::name = 'unknown';
70
$lsparse'name = 'unknown';
71
71
72
# Wether to report subdirs when finding them in a directory
72
# Wether to report subdirs when finding them in a directory
73
# or when their details appear.  (If you report early then mirro might
73
# or when their details appear.  (If you report early then mirro might
74
# recreate locally remote restricted directories.)
74
# recreate locally remote restricted directories.)
75
$lsparse::report_subdir = 0;	# Report when finding details.
75
$lsparse'report_subdir = 0;	# Report when finding details.
76
76
77
77
78
# Name of routine to call to parse incoming listing lines
78
# Name of routine to call to parse incoming listing lines
Lines 81-87 Link Here
81
# Set the directory that is being scanned and
81
# Set the directory that is being scanned and
82
# check that the scan routing for this fstype exists
82
# check that the scan routing for this fstype exists
83
# returns false if the fstype is unknown.
83
# returns false if the fstype is unknown.
84
sub lsparse::reset
84
sub lsparse'reset
85
{
85
{
86
	$here = $currdir = $_[0];
86
	$here = $currdir = $_[0];
87
	$now = time;
87
	$now = time;
Lines 91-107 Link Here
91
	$vms_strip =~ s,^/+,,;
91
	$vms_strip =~ s,^/+,,;
92
	$vms_strip =~ s,/+$,,;
92
	$vms_strip =~ s,/+$,,;
93
93
94
	$ls_line = "lsparse::line_$fstype";
94
	$ls_line = "lsparse'line_$fstype";
95
	return( defined( &$ls_line ) );
95
	return( defined( &$ls_line ) );
96
}
96
}
97
97
98
# See line_unix following routine for call/return details.
98
# See line_unix following routine for call/return details.
99
# This calls the filestore specific parser.
99
# This calls the filestore specific parser.
100
sub lsparse::line
100
sub lsparse'line
101
{
101
{
102
	local( $fh ) = @_;
102
	local( $fh ) = @_;
103
103
104
	# ls_line is setup in lsparse::reset to the name of the function
104
	# ls_line is setup in lsparse'reset to the name of the function
105
	local( $path, $size, $time, $type, $mode ) =
105
	local( $path, $size, $time, $type, $mode ) =
106
		eval "&$ls_line( \$fh )";
106
		eval "&$ls_line( \$fh )";
107
107
Lines 119-125 Link Here
119
# time is a Un*x time value for the file
119
# time is a Un*x time value for the file
120
# type is "f" for a file, "d" for a directory and
120
# type is "f" for a file, "d" for a directory and
121
#         "l linkname" for a symlink
121
#         "l linkname" for a symlink
122
sub lsparse::line_unix
122
sub lsparse'line_unix
123
{
123
{
124
	local( $fh ) = @_;
124
	local( $fh ) = @_;
125
	local( $non_crud, $perm_denied );
125
	local( $non_crud, $perm_denied );
Lines 132-138 Link Here
132
132
133
	while( <$fh> ){
133
	while( <$fh> ){
134
		# Store listing
134
		# Store listing
135
		print main::STORE $_;
135
		print main'STORE $_;
136
136
137
		# Stomp on carriage returns
137
		# Stomp on carriage returns
138
		s/\015//g;
138
		s/\015//g;
Lines 168-174 Link Here
168
		if( $perm_denied ){
168
		if( $perm_denied ){
169
			$perm_denied = "";
169
			$perm_denied = "";
170
			warn "Warning: input corrupted by 'Permission denied'",
170
			warn "Warning: input corrupted by 'Permission denied'",
171
				"errors, about line $. of $lsparse::name\n";
171
				"errors, about line $. of $lsparse'name\n";
172
			next;
172
			next;
173
		}
173
		}
174
		# Not found's are like Permission denied's.  They can start part
174
		# Not found's are like Permission denied's.  They can start part
Lines 180-186 Link Here
180
		if( $not_found ){
180
		if( $not_found ){
181
			$not_found = "";
181
			$not_found = "";
182
			warn "Warning: input corrupted by 'not found' errors",
182
			warn "Warning: input corrupted by 'not found' errors",
183
				" about line $. of $lsparse::name\n";
183
				" about line $. of $lsparse'name\n";
184
			next;
184
			next;
185
		}
185
		}
186
		
186
		
Lines 196-202 Link Here
196
				next;
196
				next;
197
			}
197
			}
198
198
199
			local( $time ) = &main::lstime_to_time( $lsdate );
199
			local( $time ) = &main'lstime_to_time( $lsdate );
200
			local( $type ) = '?';
200
			local( $type ) = '?';
201
			local( $mode ) = 0;
201
			local( $mode ) = 0;
202
202
Lines 316-322 Link Here
316
# time is a Un*x time value for the file
316
# time is a Un*x time value for the file
317
# type is "f" for a file, "d" for a directory and
317
# type is "f" for a file, "d" for a directory and
318
#         "l linkname" for a symlink
318
#         "l linkname" for a symlink
319
sub lsparse::line_dls
319
sub lsparse'line_dls
320
{
320
{
321
	local( $fh ) = @_;
321
	local( $fh ) = @_;
322
	local( $non_crud, $perm_denied );
322
	local( $non_crud, $perm_denied );
Lines 327-333 Link Here
327
327
328
	while( <$fh> ){
328
	while( <$fh> ){
329
		# Store listing
329
		# Store listing
330
		print main::STORE $_;
330
		print main'STORE $_;
331
331
332
		# Stomp on carriage returns
332
		# Stomp on carriage returns
333
		s/\015//g;
333
		s/\015//g;
Lines 350-356 Link Here
350
			}
350
			}
351
			else {
351
			else {
352
				# a file
352
				# a file
353
				$time = &main::lstime_to_time( $lsdate );
353
				$time = &main'lstime_to_time( $lsdate );
354
				$type = 'f';
354
				$type = 'f';
355
				$mode = 0444;
355
				$mode = 0444;
356
			}
356
			}
Lines 400-406 Link Here
400
# time is a Un*x time value for the file
400
# time is a Un*x time value for the file
401
# type is "f" for a file, "d" for a directory and
401
# type is "f" for a file, "d" for a directory and
402
#         "l linkname" for a symlink
402
#         "l linkname" for a symlink
403
sub lsparse::line_netware
403
sub lsparse'line_netware
404
{
404
{
405
	local( $fh ) = @_;
405
	local( $fh ) = @_;
406
406
Lines 410-416 Link Here
410
410
411
	while( <$fh> ){
411
	while( <$fh> ){
412
		# Store listing
412
		# Store listing
413
		print main::STORE $_;
413
		print main'STORE $_;
414
414
415
		# Stomp on carriage returns
415
		# Stomp on carriage returns
416
		s/\015//g;
416
		s/\015//g;
Lines 435-441 Link Here
435
			if( $file eq '.' || $file eq '..' ){
435
			if( $file eq '.' || $file eq '..' ){
436
				next;
436
				next;
437
			}
437
			}
438
			local( $time ) = &main::lstime_to_time( $lsdate );
438
			local( $time ) = &main'lstime_to_time( $lsdate );
439
			local( $type ) = '?';
439
			local( $type ) = '?';
440
			local( $mode ) = 0;
440
			local( $mode ) = 0;
441
441
Lines 509-515 Link Here
509
# time is a Un*x time value for the file
509
# time is a Un*x time value for the file
510
# type is "f" for a file, "d" for a directory and
510
# type is "f" for a file, "d" for a directory and
511
#         "l linkname" for a symlink
511
#         "l linkname" for a symlink
512
sub lsparse::line_vms
512
sub lsparse'line_vms
513
{
513
{
514
	local( $fh ) = @_;
514
	local( $fh ) = @_;
515
	local( $non_crud, $perm_denied );
515
	local( $non_crud, $perm_denied );
Lines 520-526 Link Here
520
520
521
	while( <$fh> ){
521
	while( <$fh> ){
522
		# Store listing
522
		# Store listing
523
		print main::STORE $_;
523
		print main'STORE $_;
524
524
525
		# Stomp on carriage returns
525
		# Stomp on carriage returns
526
		s/\015//g;
526
		s/\015//g;
Lines 543-549 Link Here
543
		}
543
		}
544
544
545
		# Upper case is so ugly
545
		# Upper case is so ugly
546
		if( ! $lsparse::vms_keep_case ){
546
		if( ! $lsparse'vms_keep_case ){
547
			tr/A-Z/a-z/;
547
			tr/A-Z/a-z/;
548
		}
548
		}
549
549
Lines 584-590 Link Here
584
		$size = 0;
584
		$size = 0;
585
		
585
		
586
		if( $got ){
586
		if( $got ){
587
			local( $time ) = &main::lstime_to_time( $lsdate );
587
			local( $time ) = &main'lstime_to_time( $lsdate );
588
			local( $type ) = 'f';
588
			local( $type ) = 'f';
589
			local( $mode ) = 0444;
589
			local( $mode ) = 0444;
590
590
Lines 610-616 Link Here
610
				$mode = 0555;
610
				$mode = 0555;
611
			}
611
			}
612
612
613
			$lsparse::vers = $vers;
613
			$lsparse'vers = $vers;
614
614
615
#print "file=|$file| match=|$match| vms_strip=|$vms_strip|\n";
615
#print "file=|$file| match=|$match| vms_strip=|$vms_strip|\n";
616
			$file =~ s,^,/,;
616
			$file =~ s,^,/,;
Lines 653-659 Link Here
653
# time is a Un*x time value for the file
653
# time is a Un*x time value for the file
654
# type is "f" for a file, "d" for a directory and
654
# type is "f" for a file, "d" for a directory and
655
#         "l linkname" for a symlink
655
#         "l linkname" for a symlink
656
sub lsparse::line_dosftp
656
sub lsparse'line_dosftp
657
{
657
{
658
	local( $fh ) = @_;
658
	local( $fh ) = @_;
659
659
Lines 670-676 Link Here
670
			$_ = <$fh>;
670
			$_ = <$fh>;
671
671
672
			# Store listing
672
			# Store listing
673
			print main::STORE $_;
673
			print main'STORE $_;
674
674
675
			# Ignore the summary at the end and blank lines
675
			# Ignore the summary at the end and blank lines
676
			if( /^\d+ files?\./ || /^\s+$/ ){
676
			if( /^\d+ files?\./ || /^\s+$/ ){
Lines 691-697 Link Here
691
691
692
			# TODO: fix hacky 19$yr
692
			# TODO: fix hacky 19$yr
693
			local( $lsdate ) = "$day-$mon-19$yr $hrs:$min";
693
			local( $lsdate ) = "$day-$mon-19$yr $hrs:$min";
694
			local( $time ) = &main::lstime_to_time( $lsdate );
694
			local( $time ) = &main'lstime_to_time( $lsdate );
695
			local( $type ) = '?';
695
			local( $type ) = '?';
696
			local( $mode ) = 0;
696
			local( $mode ) = 0;
697
697
Lines 736-742 Link Here
736
# 03-08-94  07:17AM                 5504 article.xfiles.intro
736
# 03-08-94  07:17AM                 5504 article.xfiles.intro
737
# 02-28-94  11:44AM                 3262 article1.gillian.anderson
737
# 02-28-94  11:44AM                 3262 article1.gillian.anderson
738
738
739
sub lsparse::line_dosish
739
sub lsparse'line_dosish
740
{
740
{
741
	local( $fh ) = @_;
741
	local( $fh ) = @_;
742
742
Lines 748-754 Link Here
748
		$_ = <$fh>;
748
		$_ = <$fh>;
749
749
750
		# Store listing
750
		# Store listing
751
		print main::STORE $_;
751
		print main'STORE $_;
752
752
753
		# Ignore blank lines
753
		# Ignore blank lines
754
		if( /^\s+$/ ){
754
		if( /^\s+$/ ){
Lines 775-781 Link Here
775
775
776
			# TODO: fix hacky 19$yr
776
			# TODO: fix hacky 19$yr
777
			local( $lsdate ) = "$day-$mon-19$yr $hrs:$min";
777
			local( $lsdate ) = "$day-$mon-19$yr $hrs:$min";
778
			local( $time ) = &main::lstime_to_time( $lsdate );
778
			local( $time ) = &main'lstime_to_time( $lsdate );
779
			local( $type ) = ($dir_or_size eq '<DIR>' ? 'd' : 'f');
779
			local( $type ) = ($dir_or_size eq '<DIR>' ? 'd' : 'f');
780
			local( $mode ) = 0;
780
			local( $mode ) = 0;
781
			local( $size ) = 0;
781
			local( $size ) = 0;
Lines 842-848 Link Here
842
# WPKIT1.EXE          960338      06/21/95        17:01
842
# WPKIT1.EXE          960338      06/21/95        17:01
843
# CMT.CSV                  0      07/06/95        14:56
843
# CMT.CSV                  0      07/06/95        14:56
844
844
845
sub lsparse::line_supertcp
845
sub lsparse'line_supertcp
846
{
846
{
847
    local( $fh ) = @_;
847
    local( $fh ) = @_;
848
848
Lines 860-866 Link Here
860
	    $_ = <$fh>;
860
	    $_ = <$fh>;
861
861
862
	    # Store listing
862
	    # Store listing
863
	    print main::STORE $_;
863
	    print main'STORE $_;
864
864
865
	    # Ignore the summary at the end and blank lines
865
	    # Ignore the summary at the end and blank lines
866
	    if( /^\d+ files?\./ || /^\s+$/ ){
866
	    if( /^\d+ files?\./ || /^\s+$/ ){
Lines 885-891 Link Here
885
	    $pending = $5;
885
	    $pending = $5;
886
886
887
	    local( $lsdate ) = "$day-$mon-$yr $time";
887
	    local( $lsdate ) = "$day-$mon-$yr $time";
888
	    local( $time ) = &main::lstime_to_time( $lsdate );
888
	    local( $time ) = &main'lstime_to_time( $lsdate );
889
            local( $type ) = '?';
889
            local( $type ) = '?';
890
	    local( $mode ) = 0;
890
	    local( $mode ) = 0;
891
891
Lines 931-937 Link Here
931
#               372      A          08-09-95   10:26  Aussie_1.bag
931
#               372      A          08-09-95   10:26  Aussie_1.bag
932
#            310992                 06-28-94   09:56  INSTALL.EXE
932
#            310992                 06-28-94   09:56  INSTALL.EXE
933
933
934
sub lsparse::line_os2
934
sub lsparse'line_os2
935
{
935
{
936
	local( $fh ) = @_;
936
	local( $fh ) = @_;
937
937
Lines 943-949 Link Here
943
		$_ = <$fh>;
943
		$_ = <$fh>;
944
944
945
		# Store listing
945
		# Store listing
946
		print main::STORE $_;
946
		print main'STORE $_;
947
947
948
		# Ignore blank lines
948
		# Ignore blank lines
949
		if( /^\s+$/ ){
949
		if( /^\s+$/ ){
Lines 971-977 Link Here
971
971
972
			# TODO: fix hacky 19$yr
972
			# TODO: fix hacky 19$yr
973
			local( $lsdate ) = "$day-$mon-19$yr $hrs:$min";
973
			local( $lsdate ) = "$day-$mon-19$yr $hrs:$min";
974
			local( $time ) = &main::lstime_to_time( $lsdate );
974
			local( $time ) = &main'lstime_to_time( $lsdate );
975
			local( $type ) = ($dir eq 'DIR' ? 'd' : 'f');
975
			local( $type ) = ($dir eq 'DIR' ? 'd' : 'f');
976
			local( $mode ) = 0;
976
			local( $mode ) = 0;
977
977
Lines 999-1005 Link Here
999
# time is a Un*x time value for the file
999
# time is a Un*x time value for the file
1000
# type is "f" for a file, "d" for a directory and
1000
# type is "f" for a file, "d" for a directory and
1001
#         "l linkname" for a symlink
1001
#         "l linkname" for a symlink
1002
sub lsparse::line_chameleon
1002
sub lsparse'line_chameleon
1003
{
1003
{
1004
    local( $fh ) = @_;
1004
    local( $fh ) = @_;
1005
1005
Lines 1038-1044 Link Here
1038
	    $pending = $5;
1038
	    $pending = $5;
1039
1039
1040
	    local( $lsdate ) = "$day-$mon-$yr $time";
1040
	    local( $lsdate ) = "$day-$mon-$yr $time";
1041
	    local( $time ) = &main::lstime_to_time( $lsdate );
1041
	    local( $time ) = &main'lstime_to_time( $lsdate );
1042
            local( $type ) = '?';
1042
            local( $type ) = '?';
1043
	    local( $mode ) = 0;
1043
	    local( $mode ) = 0;
1044
1044
Lines 1076-1082 Link Here
1076
# time is a Un*x time value for the file
1076
# time is a Un*x time value for the file
1077
# type is "f" for a file, "d" for a directory and
1077
# type is "f" for a file, "d" for a directory and
1078
#         "l linkname" for a symlink
1078
#         "l linkname" for a symlink
1079
sub lsparse::line_macos
1079
sub lsparse'line_macos
1080
{
1080
{
1081
	local( $fh ) = @_;
1081
	local( $fh ) = @_;
1082
	local( $non_crud, $perm_denied );
1082
	local( $non_crud, $perm_denied );
Lines 1087-1093 Link Here
1087
1087
1088
	while( <$fh> ){
1088
	while( <$fh> ){
1089
		# Store listing
1089
		# Store listing
1090
		print main::STORE $_;
1090
		print main'STORE $_;
1091
1091
1092
		# Stomp on carriage returns
1092
		# Stomp on carriage returns
1093
		s/\015//g;
1093
		s/\015//g;
Lines 1098-1104 Link Here
1098
		if( /^([\-rwxd]{10}).*\s(\d+\s+)?(\S+)\s+\d+\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){
1098
		if( /^([\-rwxd]{10}).*\s(\d+\s+)?(\S+)\s+\d+\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){
1099
			local( $kind, $size, $lsdate, $file ) = ($1, $3, $4, $6);
1099
			local( $kind, $size, $lsdate, $file ) = ($1, $3, $4, $6);
1100
			
1100
			
1101
			local( $time ) = &main::lstime_to_time( $lsdate );
1101
			local( $time ) = &main'lstime_to_time( $lsdate );
1102
			local( $type ) = '?';
1102
			local( $type ) = '?';
1103
			local( $mode ) = 0;
1103
			local( $mode ) = 0;
1104
1104
Lines 1126-1143 Link Here
1126
1126
1127
1127
1128
# --------------------- parse lsparse log file format
1128
# --------------------- parse lsparse log file format
1129
# lsparse::line_lsparse() is for input in lsparse::s internal form,
1129
# lsparse'line_lsparse() is for input in lsparse's internal form,
1130
# as it might have been written to a log file during a previous
1130
# as it might have been written to a log file during a previous
1131
# run of a program that uses lsparse.  The format is:
1131
# run of a program that uses lsparse.  The format is:
1132
#     filename size time type mode
1132
#     filename size time type mode
1133
# where size and time are in decimal, mode is in decimal or octal,
1133
# where size and time are in decimal, mode is in decimal or octal,
1134
# and type is one or two words.
1134
# and type is one or two words.
1135
sub lsparse::line_lsparse
1135
sub lsparse'line_lsparse
1136
{
1136
{
1137
	local( $fh ) = @_;
1137
	local( $fh ) = @_;
1138
1138
1139
	if( $lsparse::readtime ){
1139
	if( $lsparse'readtime ){
1140
		alarm( $lsparse::readtime );
1140
		alarm( $lsparse'readtime );
1141
	}
1141
	}
1142
1142
1143
	if( eof( $fh ) ){
1143
	if( eof( $fh ) ){
Lines 1147-1153 Link Here
1147
1147
1148
	while( <$fh> ){
1148
	while( <$fh> ){
1149
		# Store listing
1149
		# Store listing
1150
		print main::STORE $_;
1150
		print main'STORE $_;
1151
1151
1152
		if( /^(\S+)\s+(\d+)\s+(\d+)\s+((l\s+)?\S+)\s+(\d+)\n$/ ){
1152
		if( /^(\S+)\s+(\d+)\s+(\d+)\s+((l\s+)?\S+)\s+(\d+)\n$/ ){
1153
			# looks good.
1153
			# looks good.
Lines 1174-1185 Link Here
1174
# This is the format used at sumex-aim.stanford.edu for the info-mac area.
1174
# This is the format used at sumex-aim.stanford.edu for the info-mac area.
1175
# (see info-mac/help/all-files.txt.gz).
1175
# (see info-mac/help/all-files.txt.gz).
1176
#
1176
#
1177
sub lsparse::line_infomac
1177
sub lsparse'line_infomac
1178
{
1178
{
1179
	local( $fh ) = @_;
1179
	local( $fh ) = @_;
1180
1180
1181
	if( $lsparse::readtime ){
1181
	if( $lsparse'readtime ){
1182
		alarm( $lsparse::readtime );
1182
		alarm( $lsparse'readtime );
1183
	}
1183
	}
1184
1184
1185
	if( eof( $fh ) ){
1185
	if( eof( $fh ) ){
Lines 1189-1201 Link Here
1189
1189
1190
	while( <$fh> ){
1190
	while( <$fh> ){
1191
		# Store listing
1191
		# Store listing
1192
		print main::STORE $_;
1192
		print main'STORE $_;
1193
1193
1194
		next if /^;/;
1194
		next if /^;/;
1195
		if( /^([l-].)\s*(\d+)\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){
1195
		if( /^([l-].)\s*(\d+)\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){
1196
			local( $kind, $size, $lsdate, $file ) = ($1, $2, $3, $5);
1196
			local( $kind, $size, $lsdate, $file ) = ($1, $2, $3, $5);
1197
			
1197
			
1198
			local( $time ) = &main::lstime_to_time( $lsdate );
1198
			local( $time ) = &main'lstime_to_time( $lsdate );
1199
1199
1200
			# This should be a symlink
1200
			# This should be a symlink
1201
			if( $kind =~ /^l/ && $file =~ /(.*) -> (.*)/ ){
1201
			if( $kind =~ /^l/ && $file =~ /(.*) -> (.*)/ ){
Lines 1226-1237 Link Here
1226
# +i8388621.48638,m848117771,r,s1336,     qmsmac.html
1226
# +i8388621.48638,m848117771,r,s1336,     qmsmac.html
1227
# +i8388621.88705,m850544954,/,   txt
1227
# +i8388621.88705,m850544954,/,   txt
1228
#
1228
#
1229
sub lsparse::line_eplf
1229
sub lsparse'line_eplf
1230
{
1230
{
1231
	local( $fh ) = @_;
1231
	local( $fh ) = @_;
1232
1232
1233
	if( $lsparse::readtime ){
1233
	if( $lsparse'readtime ){
1234
		alarm( $lsparse::readtime );
1234
		alarm( $lsparse'readtime );
1235
	}
1235
	}
1236
1236
1237
	if( eof( $fh ) ){
1237
	if( eof( $fh ) ){
Lines 1243-1249 Link Here
1243
		s/\015//g;
1243
		s/\015//g;
1244
1244
1245
		# Store listing
1245
		# Store listing
1246
		print main::STORE $_;
1246
		print main'STORE $_;
1247
1247
1248
# +i8388621.48638,m848117771,r,s1336,     qmsmac.html
1248
# +i8388621.48638,m848117771,r,s1336,     qmsmac.html
1249
# +i8388621.88705,m850544954,/,   txt
1249
# +i8388621.88705,m850544954,/,   txt
Lines 1272-1283 Link Here
1272
# --------------------- CTAN files list
1272
# --------------------- CTAN files list
1273
#    22670 Mon Jul 20 12:36:34 1992 pub/tex/biblio/bibtex/contrib/aaai-named.bst
1273
#    22670 Mon Jul 20 12:36:34 1992 pub/tex/biblio/bibtex/contrib/aaai-named.bst
1274
#
1274
#
1275
sub lsparse::line_ctan
1275
sub lsparse'line_ctan
1276
{
1276
{
1277
	local( $fh ) = @_;
1277
	local( $fh ) = @_;
1278
1278
1279
	if( $lsparse::readtime ){
1279
	if( $lsparse'readtime ){
1280
		alarm( $lsparse::readtime );
1280
		alarm( $lsparse'readtime );
1281
	}
1281
	}
1282
1282
1283
	if( eof( $fh ) ){
1283
	if( eof( $fh ) ){
Lines 1287-1298 Link Here
1287
1287
1288
	while( <$fh> ){
1288
	while( <$fh> ){
1289
		# Store listing
1289
		# Store listing
1290
		print main::STORE $_;
1290
		print main'STORE $_;
1291
1291
1292
		if( /^\s*(\d+)\s+(\w\w\w\s+\w\w\w\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(.*)\n/ ){
1292
		if( /^\s*(\d+)\s+(\w\w\w\s+\w\w\w\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(.*)\n/ ){
1293
			local( $size, $lsdate, $file ) = ($1, $2, $3);
1293
			local( $size, $lsdate, $file ) = ($1, $2, $3);
1294
			
1294
			
1295
			local( $time ) = &main::lstime_to_time( $lsdate );
1295
			local( $time ) = &main'lstime_to_time( $lsdate );
1296
1296
1297
			return( $file, $size, $time, 'f', 0444 );
1297
			return( $file, $size, $time, 'f', 0444 );
1298
		}
1298
		}
Lines 1317-1328 Link Here
1317
# time is a Un*x time value for the file -- this is good from the m/f
1317
# time is a Un*x time value for the file -- this is good from the m/f
1318
# type is always "f" for a file
1318
# type is always "f" for a file
1319
1319
1320
sub lsparse::line_cms
1320
sub lsparse'line_cms
1321
{
1321
{
1322
	local( $fh ) = @_;
1322
	local( $fh ) = @_;
1323
1323
1324
	if( $lsparse::readtime ){
1324
	if( $lsparse'readtime ){
1325
		alarm( $lsparse::readtime );
1325
		alarm( $lsparse'readtime );
1326
	}
1326
	}
1327
1327
1328
	if( eof( $fh ) ){
1328
	if( eof( $fh ) ){
Lines 1331-1351 Link Here
1331
	}
1331
	}
1332
	while( <$fh> ){
1332
	while( <$fh> ){
1333
		# Store listing
1333
		# Store listing
1334
		print main::STORE $_;
1334
		print main'STORE $_;
1335
1335
1336
		chop;
1336
		chop;
1337
		next unless /\d+\/\d+\/\d+\s+\d+:\d+:\d+/;
1337
		next unless /\d+\/\d+\/\d+\s+\d+:\d+:\d+/;
1338
		s/^\s+//;
1338
		s/^\s+//;
1339
1339
1340
		# Upper case is so ugly
1340
		# Upper case is so ugly
1341
		if( ! $lsparse::vms_keep_case ){
1341
		if( ! $lsparse'vms_keep_case ){
1342
			tr/A-Z/a-z/;
1342
			tr/A-Z/a-z/;
1343
		}
1343
		}
1344
1344
1345
		local( $fname, $ftype, $fdisk, $rectype, $lrecl, $recs,
1345
		local( $fname, $ftype, $fdisk, $rectype, $lrecl, $recs,
1346
		      $blocks, $ldate, $tod ) = split(/\s+/, $_);
1346
		      $blocks, $ldate, $tod ) = split(/\s+/, $_);
1347
		return( join('.', ($fname, $ftype, $fdisk)),
1347
		return( join('.', ($fname, $ftype, $fdisk)),
1348
		       $lrecl * $recs, &main::lstime_to_time( "$ldate $tod" ),
1348
		       $lrecl * $recs, &main'lstime_to_time( "$ldate $tod" ),
1349
		       'f' );
1349
		       'f' );
1350
	}
1350
	}
1351
	alarm( 0 );
1351
	alarm( 0 );

Return to bug 1214412