*** dlkern Tue Jun 20 21:38:11 2000 --- dlkern.mct Tue Jun 20 23:56:38 2000 *************** *** 54,60 **** # * RedHat package. # # For mct to do: - # * Hostname & filename expanders for -d # * Handle directory names being passed to -d (old versions used -d # for output directory, which is now -o) # --- 54,59 ---- *************** *** 106,112 **** # Numbers before 15 were not fit for public consumption. use strict; ! use vars qw(@new $i @dl_args $usage $opt_s $opt_b $opt_p %dl $opt_c $country $opt_d $downloader $opt_e $ext $opt_h $opt_o $dir $gnupg $gpg %trust @trees $tree_count $tree $dl_count $opt_w $opt_n @lines $line $desc $ver %version $first $second %url %file $date $sig $opt_u $fngrhost $ftphost $port $handle $opt_n %urlhost %urldir %urlfile $ftp); --- 105,111 ---- # Numbers before 15 were not fit for public consumption. use strict; ! use vars qw(@new $i @dl_args $usage $opt_s $opt_b $opt_p %dl $opt_c $country $opt_d $downloader $opt_e $opt_f $ext $opt_h $opt_o $dir $gnupg $gpg %trust @trees $tree_count $tree $dl_count $opt_w $opt_n @lines $line $desc $ver %version $first $second %url %file $date $sig $opt_u $fngrhost $ftphost $port $handle $opt_n %urlhost %urldir %urlfile $ftp); *************** *** 148,160 **** # Read commandline options. Colon goes after flags that take arguments. ! &Getopts('usbpwnhd:c:e:o:'); sub usage { ################################################################################ print " Usage: dlkern [-sbp] [-nw | -d ] [-o ] ! [-c ] [-e ] -- -s Download stable version of Linux kernel. -b Download beta version of Linux kernel. --- 147,163 ---- # Read commandline options. Colon goes after flags that take arguments. ! &Getopts('usbpwnhd:c:e:o:f:'); ! ! # initialize global variables ! $fngrhost = "ftp.kernel.org"; ! $port = 79; sub usage { ################################################################################ print " Usage: dlkern [-sbp] [-nw | -d ] [-o ] ! [-c ] [-e ] [-f ] -- -s Download stable version of Linux kernel. -b Download beta version of Linux kernel. *************** *** 169,174 **** --- 172,179 ---- -e Specify extension (gz is default, bz2 is more compressed). -h Show this usage information. + -f Finger a different host, instead of the default, \"$fngrhost\" + -u Only display URLs. May use -c & -e. -- Specify aruments to the downloader. Must be last. *************** *** 197,202 **** --- 202,214 ---- if ($opt_o) { $dir = $opt_o; } if ($opt_p) { $dl{"prepatch"}=1; } if ($opt_s) { $dl{"stable"}=1; } + if ($opt_f) { $fngrhost = $opt_f } + + die " + Sorry, the command line arguments have changed since v33. -d now specifies + which downloader program you'd like to use; the output directory flag has + been renamed -o.\n\n" + if ($downloader && -d $downloader); #Handle arguments (not to downloader) END ######################################### *************** *** 204,209 **** --- 216,223 ---- #################### #Load GnuPG.pm BEGIN + $SIG{__WARN__} = sub {}; + if (!eval "require 'GnuPG.pm';") { print "No GnuPG.pm (http://indev.insu.com/GnuPG), cannot verify signitures.\n"; $gnupg=0; *************** *** 219,224 **** --- 233,240 ---- 3, "ULTIMATE"); } + $SIG{__WARN__} = 0; + #Load GnuPG.pm END ################## *************** *** 258,264 **** $downloader="ncftpget"; } ! if ((defined($downloader)) && !(&chkexe($downloader))) { print "$downloader does not appear to be installed.\n"; $downloader = ""; --- 274,282 ---- $downloader="ncftpget"; } ! $downloader = "Net::FTP" if ($downloader && $downloader =~ /net::ftp/i); ! ! if ((defined($downloader)) && !(&chkexe($downloader)) && $downloader ne "Net::FTP") { print "$downloader does not appear to be installed.\n"; $downloader = ""; *************** *** 294,307 **** # Query finger data. #@lines = finger('@ftp.kernel.org', 1) or die "Failed to obtain version info by fingering \@ftp.kernel.org.\n"; - $fngrhost = "ftp.kernel.org"; - $port = 79; - unless ($handle = IO::Socket::INET->new(Proto => 'tcp', PeerAddr => $fngrhost, PeerPort => $port)) { ! print "Failed to make finger connection to $fngrhost:$port.\n"; } print $handle "\n\r"; --- 312,322 ---- # Query finger data. #@lines = finger('@ftp.kernel.org', 1) or die "Failed to obtain version info by fingering \@ftp.kernel.org.\n"; unless ($handle = IO::Socket::INET->new(Proto => 'tcp', PeerAddr => $fngrhost, PeerPort => $port)) { ! die "Failed to make finger connection to $fngrhost:$port.\n"; } print $handle "\n\r"; *************** *** 377,388 **** #print "\nDownloading $tree by calling \'$downloader \"",join('" "',@dl_args),"\" $url{$tree}\'\n"; print "\nDownloading $tree by calling \'$downloader ", join " ", (map { '"' . $_ . '"' } @dl_args), "$url{$tree}\'\n"; ! system ($downloader, @dl_args, "$url{$tree}") == 0 or print "Download failed: ",$? >> 8,"\n"; #print "Downloading $tree signiture by calling \'$downloader \"",join('" "',@dl_args),"\" $url{$tree}.sign\'\n"; print "Downloading $tree signiture by calling \'$downloader ", join " ", (map { '"' . $_ . '"' } @dl_args), "$url{$tree}.sign\'\n"; ! system ($downloader, @dl_args, "$url{$tree}.sign") == 0 or print "Download failed: ",$? >> 8,"\n"; #linux-2.2.14.tar.gz.sign #$sig = $gpg->verify( signature => "linux-$version{$tree}.tar.$ext.sign", file => "linux-$version{$tree}.tar.$ext" ); --- 392,403 ---- #print "\nDownloading $tree by calling \'$downloader \"",join('" "',@dl_args),"\" $url{$tree}\'\n"; print "\nDownloading $tree by calling \'$downloader ", join " ", (map { '"' . $_ . '"' } @dl_args), "$url{$tree}\'\n"; ! system ($downloader, @dl_args, "$url{$tree}") == 0 or die "\nDownload failed\n"; #print "Downloading $tree signiture by calling \'$downloader \"",join('" "',@dl_args),"\" $url{$tree}.sign\'\n"; print "Downloading $tree signiture by calling \'$downloader ", join " ", (map { '"' . $_ . '"' } @dl_args), "$url{$tree}.sign\'\n"; ! system ($downloader, @dl_args, "$url{$tree}.sign") == 0 or die "\nDownload failed\n"; #linux-2.2.14.tar.gz.sign #$sig = $gpg->verify( signature => "linux-$version{$tree}.tar.$ext.sign", file => "linux-$version{$tree}.tar.$ext" ); *************** *** 412,418 **** } } } else { ! print "Downloading $tree via Net::FTP. There will be no progress indicator.\n"; $ftp = Net::FTP->new($urlhost{$tree}, Debug => 0); $ftp->login; $ftp->cwd($urldir{$tree}); --- 427,433 ---- } } } else { ! print "\nDownloading $tree via Net::FTP. There will be no progress indicator.\n"; $ftp = Net::FTP->new($urlhost{$tree}, Debug => 0); $ftp->login; $ftp->cwd($urldir{$tree});