diff options
Diffstat (limited to 'dselect/methods')
-rw-r--r-- | dselect/methods/Dselect/Ftp.pm | 38 | ||||
-rwxr-xr-x | dselect/methods/disk/setup | 2 | ||||
-rwxr-xr-x | dselect/methods/ftp/install | 20 | ||||
-rwxr-xr-x | dselect/methods/ftp/setup | 26 | ||||
-rwxr-xr-x | dselect/methods/ftp/update | 18 | ||||
-rwxr-xr-x | dselect/methods/multicd/setup | 2 |
6 files changed, 54 insertions, 52 deletions
diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm index 7f599a7b9..5c995d512 100644 --- a/dselect/methods/Dselect/Ftp.pm +++ b/dselect/methods/Dselect/Ftp.pm @@ -66,7 +66,7 @@ sub store_config { my $vars = shift; # Check that config is completed - return if not $config{'done'}; + return if not $config{done}; open(my $vars_fh, '>', $vars) || die "Couldn't open $vars in write mode : $!\n"; @@ -92,7 +92,7 @@ sub edit_config { while(1) { $i = 1; print "\n\nList of selected ftp sites :\n"; - foreach (@{$config{'site'}}) { + foreach (@{$config{site}}) { print "$i. ftp://$_->[0]$_->[1] @{$_->[2]}\n"; $i++; } @@ -102,41 +102,43 @@ sub edit_config { /q/i && last; /a/i && add_site(); /d\s*(\d+)/i && - do { splice(@{$config{'site'}}, $1-1, 1) if ($1 <= @{$config{'site'}}); + do { + splice(@{$config{site}}, $1 - 1, 1) if ($1 <= @{$config{site}}); next;}; /e\s*(\d+)/i && - do { edit_site($config{'site'}[$1-1]) if ($1 <= @{$config{'site'}}); + do { + edit_site($config{site}[$1 - 1]) if ($1 <= @{$config{site}}); next; }; m#m#i && view_mirrors(); } print "\n"; - $config{'use_auth_proxy'} = yesno($config{'use_auth_proxy'} ? "y" : "n", + $config{use_auth_proxy} = yesno($config{use_auth_proxy} ? "y" : "n", "Go through an authenticated proxy"); - if ($config{'use_auth_proxy'}) { - print "\nEnter proxy hostname [$config{'proxyhost'}] : "; + if ($config{use_auth_proxy}) { + print "\nEnter proxy hostname [$config{proxyhost}] : "; chomp($_ = <STDIN>); - $config{'proxyhost'} = $_ || $config{'proxyhost'}; + $config{proxyhost} = $_ || $config{proxyhost}; - print "\nEnter proxy log name [$config{'proxylogname'}] : "; + print "\nEnter proxy log name [$config{proxylogname}] : "; chomp($_ = <STDIN>); - $config{'proxylogname'} = $_ || $config{'proxylogname'}; + $config{proxylogname} = $_ || $config{proxylogname}; - print "\nEnter proxy password [$config{'proxypassword'}] : "; + print "\nEnter proxy password [$config{proxypassword}] : "; chomp ($_ = <STDIN>); - $config{'proxypassword'} = $_ || $config{'proxypassword'}; + $config{proxypassword} = $_ || $config{proxypassword}; } print "\nEnter directory to download binary package files to\n"; print "(relative to $methdir)\n"; while(1) { - print "[$config{'dldir'}] : "; + print "[$config{dldir}] : "; chomp($_ = <STDIN>); s{/$}{}; - $config{'dldir'} = $_ if ($_); - last if -d "$methdir/$config{'dldir'}"; - print "$methdir/$config{'dldir'} is not a directory !\n"; + $config{dldir} = $_ if ($_); + last if -d "$methdir/$config{dldir}"; + print "$methdir/$config{dldir} is not a directory !\n"; } } @@ -149,11 +151,11 @@ sub add_site { chomp $email; my $dir = "/debian"; - push (@{$config{'site'}}, [ "", $dir, [ "dists/stable/main", + push (@{$config{site}}, [ "", $dir, [ "dists/stable/main", "dists/stable/contrib", "dists/stable/non-free" ], $pas, $user, $email ]); - edit_site($config{'site'}[@{$config{'site'}} - 1]); + edit_site($config{site}[@{$config{site}} - 1]); } sub edit_site { diff --git a/dselect/methods/disk/setup b/dselect/methods/disk/setup index 4d1f2ddaa..9eac8f7d7 100755 --- a/dselect/methods/disk/setup +++ b/dselect/methods/disk/setup @@ -96,7 +96,7 @@ getblockdev () { set -e proposeddevice="$tryblockdevice" perl -ne ' next unless /^ *Device +Boot +Start +End +Blocks +Id +System *$/i .. !/\S/; -next unless s:^/\S+:: && $& eq $ENV{"proposeddevice"}; +next unless s:^/\S+:: && $& eq $ENV{proposeddevice}; next unless s/^ +(\* +)?\d+ +\d+ +\d+\+? +//; next unless m/^([0-9a-f]{1,2}) /i; %types= ( "1","msdos", "4","msdos", "6","msdos", "7","hpfs", "80","minix", diff --git a/dselect/methods/ftp/install b/dselect/methods/ftp/install index 11c1dbc25..615fa8f75 100755 --- a/dselect/methods/ftp/install +++ b/dselect/methods/ftp/install @@ -54,7 +54,7 @@ my $methdir = "$vardir/methods/ftp"; read_config("$methdir/vars"); chdir "$methdir"; -mkpath(["$methdir/$config{'dldir'}"], 0, 0755); +mkpath(["$methdir/$config{dldir}"], 0, 0755); #Read md5sums already calculated @@ -185,7 +185,7 @@ sub procpkgfile { print "\nProcessing Package files...\n"; my ($dist,$site,$fn,$i,$j); $i = 0; -foreach $site (@{$config{'site'}}) { +foreach $site (@{$config{site}}) { $j = 0; foreach $dist (@{$site->[2]}) { $fn = $dist; @@ -202,7 +202,7 @@ foreach $site (@{$config{'site'}}) { $i++; } -my $dldir = $config{'dldir'}; +my $dldir = $config{dldir}; # md5sum sub md5sum($) { my $fn = shift; @@ -260,7 +260,7 @@ foreach $pkg (keys(%pkgs)) { my $ffn = $fn; $ffn =~ s/binary-[^\/]+/.../; print "want: " . - $config{'site'}[$pkgfiles{$fn}[2]][0] . " $ffn (${csize}k)\n"; + $config{site}[$pkgfiles{$fn}[2]][0] . " $ffn (${csize}k)\n"; $downloads{$fn} = 0; $totsize += $csize; } @@ -316,7 +316,7 @@ sub download() { my $i = 0; my ($site, $ftp); - foreach $site (@{$config{'site'}}) { + foreach $site (@{$config{site}}) { my @getfiles = grep { $pkgfiles{$_}[2] == $i } keys %downloads; my @pre_dist = (); # Directory to add before $fn @@ -341,13 +341,13 @@ sub download() { $site->[5], #$::password, $site->[1], #$::ftpdir, $site->[3], #$::passive, - $config{'use_auth_proxy'}, - $config{'proxyhost'}, - $config{'proxylogname'}, - $config{'proxypassword'}); + $config{use_auth_proxy}, + $config{proxyhost}, + $config{proxylogname}, + $config{proxypassword}); $::ftp = $ftp; - local $SIG{'INT'} = sub { die "Interrupted !\n"; }; + local $SIG{INT} = sub { die "Interrupted !\n"; }; my ($fn,$rsize,$res,$pre); foreach $fn (@getfiles) { diff --git a/dselect/methods/ftp/setup b/dselect/methods/ftp/setup index f3ca8f11b..a5cc9af62 100755 --- a/dselect/methods/ftp/setup +++ b/dselect/methods/ftp/setup @@ -48,11 +48,11 @@ chomp $logname; my $host = `cat /etc/mailname || dnsdomainname`; chomp $host; -$config{'dldir'} = "debian"; -$config{'use_auth_proxy'} = 0; -$config{'proxyhost'} = ""; -$config{'proxylogname'} = $logname; -$config{'proxypassword'} = ""; +$config{dldir} = "debian"; +$config{use_auth_proxy} = 0; +$config{proxyhost} = ""; +$config{proxylogname} = $logname; +$config{proxypassword} = ""; my $methdir = "$vardir/methods/ftp"; my $exit = 0; @@ -97,11 +97,11 @@ FTP site: Eg: use auth proxy: y proxy: proxy.isp.com - proxy account: $config{'proxylogname'} + proxy account: $config{proxylogname} proxy password: ? EOM -if (! $config{'done'}) { +if (! $config{done}) { view_mirrors() if (yesno("y", "Would you like to see a list of ftp mirrors")); add_site(); } @@ -109,17 +109,17 @@ edit_config($methdir); my $ftp; sub download() { - foreach (@{$config{'site'}}) { + foreach (@{$config{site}}) { $ftp = do_connect ($_->[0], # Ftp server $_->[4], # username $_->[5], # password $_->[1], # ftp dir $_->[3], # passive - $config{'use_auth_proxy'}, - $config{'proxyhost'}, - $config{'proxylogname'}, - $config{'proxypassword'}); + $config{use_auth_proxy}, + $config{proxyhost}, + $config{proxylogname}, + $config{proxypassword}); my @dists = @{$_->[2]}; @@ -167,7 +167,7 @@ if($@) { }; # output new vars file -$config{'done'} = 1; +$config{done} = 1; store_config("$methdir/vars"); chmod 0600, "$methdir/vars"; diff --git a/dselect/methods/ftp/update b/dselect/methods/ftp/update index 853c4034a..92b82782c 100755 --- a/dselect/methods/ftp/update +++ b/dselect/methods/ftp/update @@ -69,7 +69,7 @@ my $ftp; my $packages_modified = 0; sub download { -foreach (@{$config{'site'}}) { +foreach (@{$config{site}}) { my $site = $_; @@ -78,10 +78,10 @@ foreach (@{$config{'site'}}) { $_->[5], # password $_->[1], # ftp dir $_->[3], # passive - $config{'use_auth_proxy'}, - $config{'proxyhost'}, - $config{'proxylogname'}, - $config{'proxypassword'}); + $config{use_auth_proxy}, + $config{proxyhost}, + $config{proxylogname}, + $config{proxypassword}); my @dists = @{$_->[2]}; my $dist; @@ -169,10 +169,10 @@ foreach (@{$config{'site'}}) { $site->[5], # password $site->[1], # ftp dir $site->[3], # passive - $config{'use_auth_proxy'}, - $config{'proxyhost'}, - $config{'proxylogname'}, - $config{'proxypassword'}); + $config{use_auth_proxy}, + $config{proxyhost}, + $config{proxylogname}, + $config{proxypassword}); if ($newest_pack_date != do_mdtm ($ftp, "$dir/Packages.gz")) { print ("Packages file has changed !\n"); diff --git a/dselect/methods/multicd/setup b/dselect/methods/multicd/setup index 81564cc55..66f6fa2f3 100755 --- a/dselect/methods/multicd/setup +++ b/dselect/methods/multicd/setup @@ -122,7 +122,7 @@ getblockdev () { set -e proposeddevice="$tryblockdevice" perl -ne ' next unless /^ *Device +Boot +Begin +Start +End +Blocks +Id +System *$/i .. !/\S/; -next unless s:^/\S+:: && $& eq $ENV{"proposeddevice"}; +next unless s:^/\S+:: && $& eq $ENV{proposeddevice}; next unless s/^ +(\* +)?\d+ +\d+ +\d+ +\d+\+? +//; next unless m/^([0-9a-f]{1,2}) /i; %types= ( "1","msdos", "4","msdos", "6","msdos", "7","hpfs", "80","minix", |