summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-07-24 03:40:58 +0000
committerOlivier Blin <oblin@mandriva.org>2005-07-24 03:40:58 +0000
commit249bb37fec19511101643f85cf03123e072d47b0 (patch)
tree822a90f3a88a38a95f0af39b2fd2e9736356baf0
parent44fcdf8d00e7adf8c7bc37925b9c0a9cff92cfbf (diff)
downloaddrakx-249bb37fec19511101643f85cf03123e072d47b0.tar
drakx-249bb37fec19511101643f85cf03123e072d47b0.tar.gz
drakx-249bb37fec19511101643f85cf03123e072d47b0.tar.bz2
drakx-249bb37fec19511101643f85cf03123e072d47b0.tar.xz
drakx-249bb37fec19511101643f85cf03123e072d47b0.zip
write hosts in correct order in /etc/hosts
-rw-r--r--perl-install/network/network.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 1f6be999e..1701c192e 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -215,7 +215,7 @@ sub add2hosts {
push @{$l{$ip}}, difference2([ split /\s+/, $aliases ], [ $hostname, $sub_hostname ]);
} cat_($file);
- push @{$l{$_}}, $hostname, if_($sub_hostname, $sub_hostname) foreach grep { $_ } @ips;
+ unshift @{$l{$_}}, $hostname, if_($sub_hostname, $sub_hostname) foreach grep { $_ } @ips;
log::explanations("writing host information to $file");
output($file, map { "$_\t\t" . join(" ", @{$l{$_}}) . "\n" } keys %l);
@@ -571,8 +571,8 @@ sub configure_network {
}
write_interface_conf($net, $_) foreach keys %{$net->{ifcfg}};
network::ethernet::install_dhcp_client($in, $_->{DHCP_CLIENT}) foreach grep { $_->{BOOTPROTO} eq "dhcp" } values %{$net->{ifcfg}};
- add2hosts($net->{network}{HOSTNAME}, "127.0.0.1") if $net->{network}{HOSTNAME};
add2hosts("localhost", "127.0.0.1");
+ add2hosts($net->{network}{HOSTNAME}, "127.0.0.1") if $net->{network}{HOSTNAME};
write_zeroconf($net, $in);
any { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %{$net->{ifcfg}} and $in->do_pkgs->install('pump');