summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-03-08 15:56:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-03-08 15:56:43 +0000
commit18bbdbf7e9ec5917915250619ec982848f88af25 (patch)
treeb23a9adb1b13b4f9db652303d08907937d275350 /perl-install
parent9c1aabb3b9e422a95cc500c7cf0357b21ef67daf (diff)
downloaddrakx-18bbdbf7e9ec5917915250619ec982848f88af25.tar
drakx-18bbdbf7e9ec5917915250619ec982848f88af25.tar.gz
drakx-18bbdbf7e9ec5917915250619ec982848f88af25.tar.bz2
drakx-18bbdbf7e9ec5917915250619ec982848f88af25.tar.xz
drakx-18bbdbf7e9ec5917915250619ec982848f88af25.zip
in generate_automatic_stage1_params():
- handle FTP via HTTP proxy (bugzilla #8699) - cleanup using a different data-structure
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_any.pm30
1 files changed, 18 insertions, 12 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 70675e4b7..be0c9e84c 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -887,28 +887,34 @@ sub loadO {
sub generate_automatic_stage1_params {
my ($o) = @_;
- my @ks = "method:$o->{method}";
+ my $method = $o->{method};
+ my @ks;
if ($o->{method} eq 'http') {
- $ENV{URLPREFIX} =~ m|http://([^/:]+)(/.*)| or die;
- push @ks, "server:$1", "directory:$2";
+ $ENV{URLPREFIX} =~ m!(http|ftp)://([^/:]+)(/.*)! or die;
+ $method = $1; #- in stage1, FTP via HTTP proxy is available through FTP config, not HTTP
+ @ks = (server => $2, directory => $3);
} elsif ($o->{method} eq 'ftp') {
- push @ks, "server:$ENV{HOST}", "directory:$ENV{PREFIX}", "user:$ENV{LOGIN}", "pass:$ENV{PASSWORD}";
+ @ks = (server => $ENV{HOST}, directory => $ENV{PREFIX}, user => $ENV{LOGIN}, pass => $ENV{PASSWORD});
} elsif ($o->{method} eq 'nfs') {
cat_("/proc/mounts") =~ m|(\S+):(\S+)\s+/tmp/image nfs| or die;
- push @ks, "server:$1", "directory:$2";
+ @ks = (server => $1, directory => $2);
}
+ @ks = (method => $method, @ks);
if (member($o->{method}, qw(http ftp nfs))) {
- my ($intf) = values %{$o->{intf}};
- push @ks, "interface:$intf->{DEVICE}";
+ if ($ENV{PROXY}) {
+ push @ks, proxy_host => $ENV{PROXY}, proxy_port => $ENV{PROXYPORT};
+ }
+ push @ks, interface => first(values %{$o->{intf}})->{DEVICE};
if ($intf->{BOOTPROTO} eq 'dhcp') {
- push @ks, "network:dhcp";
+ push @ks, network => 'dhcp';
} else {
+ push @ks, network => 'static', ip => $intf->{IPADDR}, netmask => $intf->{NETMASK}, gateway => $o->{netc}{GATEWAY};
require network::network;
- push @ks, "network:static", "ip:$intf->{IPADDR}", "netmask:$intf->{NETMASK}", "gateway:$o->{netc}{GATEWAY}";
- my @dnss = network::network::dnsServers($o->{netc});
- push @ks, "dns:$dnss[0]" if @dnss;
+ if (my @dnss = network::network::dnsServers($o->{netc})) {
+ push @ks, dns => $dnss[0];
+ }
}
}
@@ -917,7 +923,7 @@ sub generate_automatic_stage1_params {
adsluser => 'adslu', adslpass => 'adslp', hostname => 'hos', domain => 'dom', server => 'ser',
directory => 'dir', user => 'use', pass => 'pas', disk => 'dis', partition => 'par');
- 'automatic='.join(',', map { /^([^:]+)(:.*)/ && $aliases{$1} ? $aliases{$1}.$2 : $_ } @ks);
+ 'automatic=' . join(',', map { ($aliases{$_->[0]} || $_->[0]) . ':' . $_->[1] } group_by2(@ks));
}
sub guess_mount_point {