From 014a1102307fdf7a894aff048dd8858e74260296 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 21 Jun 2001 17:47:09 +0000 Subject: generate_automatic_stage1_params: listize --- perl-install/install_any.pm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'perl-install') diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 6650c82f3..6902f64a8 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -728,35 +728,34 @@ sub loadO { sub generate_automatic_stage1_params { my ($o) = @_; + my @ks = (); - my $ks = "automatic="; - if ($o->{method} =~ /hd/) { - $ks .= "method:disk,"; + push @ks, "method:disk"; } else { - $ks .= "method:" . $o->{method} . ","; + push @ks, "method:" . $o->{method}; } if ($o->{method} =~ /http/) { "$ENV{URLPREFIX}" =~ m|http://(.*)/(.*)| or die; - $ks .= "server:$1,directory:$2,"; + push @ks, "server:$1", "directory:$2"; } elsif ($o->{method} =~ /ftp/) { - $ks .= "server:$ENV{HOST},directory:$ENV{PREFIX},user:$ENV{LOGIN},pass:$ENV{PASSWORD},"; + push @ks, "server:$ENV{HOST}", "directory:$ENV{PREFIX}", "user:$ENV{LOGIN}", "pass:$ENV{PASSWORD}"; } elsif ($o->{method} =~ /nfs/) { cat_("/proc/mounts") =~ m|(\S+):(\S+)\s+/tmp/image nfs| or die; - $ks .= "server:$1,directory:$2,"; + push @ks, "server:$1", "directory:$2"; } my ($intf) = values %{$o->{intf}}; if ($intf->{BOOTPROTO} =~ /dhcp/) { - $ks .= "network:dhcp,"; + push @ks, "network:dhcp"; } else { require network; - $ks .= "network:static,ip:$intf->{IPADDR},netmask:$intf->{NETMASK},gateway:$o->{netc}{GATEWAY},"; + push @ks, "network:static", "ip:$intf->{IPADDR}", "netmask:$intf->{NETMASK}", "gateway:$o->{netc}{GATEWAY}"; my @dnss = network::dnsServers($o->{netc}); - $ks .= "dns:$dnss[0]," if @dnss; + push @ks, "dns:$dnss[0]" if @dnss; } - $ks; + "automatic=".join(',', @ks); } sub guess_mount_point { -- cgit v1.2.1