summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_any.pm7
-rw-r--r--perl-install/network/adsl.pm13
-rw-r--r--perl-install/network/network.pm6
-rw-r--r--perl-install/standalone.pm5
4 files changed, 21 insertions, 10 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index bfb568b2f..607659ef8 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -1123,7 +1123,12 @@ sub install_steps::do_pkgs {
sub install {
my ($do, @l) = @_;
- $do->{o}->pkg_install(@l);
+ if ($::testing) {
+ log::l("i would install packages " . join(' ', @l));
+ return 1;
+ } else {
+ $do->{o}->pkg_install(@l);
+ }
}
sub ensure_is_installed {
diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm
index 191e81ea9..02520011e 100644
--- a/perl-install/network/adsl.pm
+++ b/perl-install/network/adsl.pm
@@ -33,26 +33,27 @@ If you don't know, choose 'use pppoe'"),
) or return;
$type = find { $l{$_} eq $type } keys %l;
if ($type eq 'pppoe') {
- $in->do_pkgs->install("rp-$type") if !$::testing;
+ $in->do_pkgs->install("rp-$type");
$netcnx->{type} = "adsl_$type";
adsl_conf($netcnx->{"adsl_$type"}, $netc, $intf, $type) or goto conf_adsl_step1;
} elsif ($type eq 'dhcp') {
- $in->do_pkgs->install(qw(dhcpcd)) if !$::testing;
+ $in->do_pkgs->ensure_is_installed('dhcpcd', '/sbin/dhcpcd', 'auto');
go_ethernet($netc, $intf, 'dhcp', '', '', $first_time) or goto conf_adsl_step1;
} elsif ($type eq 'pptp') {
- $in->do_pkgs->install(qw(pptp-adsl)) if !$::testing;
+ $in->do_pkgs->ensure_is_installed('pptp-adsl', '/usr/bin/pptp', 'auto');
$netcnx->{type} = "adsl_$type";
$netcnx->{"adsl_$type"} = {};
adsl_conf($netcnx->{"adsl_$type"}, $netc, $intf, $type) or goto conf_adsl_step1;
} elsif ($type =~ /sagem/) {
$type = 'sagem' . ($type =~ /dhcp/ ? "_dhcp" : "");
- $in->do_pkgs->install(qw(adiusbadsl), if_($type =~ /dhcp/, qw(dhcpcd))) if !$::testing;
+ $in->do_pkgs->ensure_is_installed('adiusbadsl', '/usr/sbin/adictrl', 'auto');
+ $in->do_pkgs->ensure_is_installed('dhcpcd', '/sbin/dhcpcd', 'auto') if $type =~ /dhcp/;
$netcnx->{type} = "adsl_$type";
$netcnx->{"adsl_$type"} = {};
adsl_conf($netcnx->{"adsl_$type"}, $netc, $intf, $type) or goto conf_adsl_step1;
} elsif ($type =~ /speedtouch/) {
$type = 'speedtouch';
- $in->do_pkgs->install(qw(speedtouch)) if !$::testing;
+ $in->do_pkgs->ensure_is_installed('speedtouch', '/usr/sbin/pppoa3', 'auto');
$netcnx->{type} = "adsl_$type";
$netcnx->{"adsl_$type"} = {};
$netcnx->{"adsl_$type"}{vpivci} = '';
@@ -204,7 +205,7 @@ user "$adsl->{login}"
['ppp-compress-24', 'ppp_deflate'],
['ppp-compress-26', 'ppp_deflate'];
$::isStandalone and modules::write_conf($prefix);
- $in->do_pkgs->what_provides("speedtouch_mgmt") and $in->do_pkgs->install('speedtouch_mgmt');
+ $in->do_pkgs->what_provides("speedtouch_mgmt") and $in->do_pkgs->ensure_is_installed('speedtouch_mgmt', '/usr/share/speedtouch/mgmt.o', 'auto');
-e "$prefix/usr/share/speedtouch/mgmt.o" and goto end_firmware;
firmware:
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 4f9dcfbe9..15109a9f1 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -549,7 +549,7 @@ sub configureNetwork2 {
my ($in, $prefix, $netc, $intf) = @_;
my $etc = "$prefix/etc";
if (!$::testing) {
- $netc->{wireless_eth} and $in->do_pkgs->install(qw(wireless-tools));
+ $netc->{wireless_eth} and $in->do_pkgs->ensure_is_installed('wireless-tools', '/sbin/iwconfig', 'auto');
write_conf("$etc/sysconfig/network", $netc);
write_resolv_conf("$etc/resolv.conf", $netc) if ! $netc->{DHCP};
write_interface_conf("$etc/sysconfig/network-scripts/ifcfg-$_->{DEVICE}", $_, $netc, $prefix) foreach grep { $_->{DEVICE} ne 'ppp0' } values %$intf;
@@ -557,8 +557,8 @@ sub configureNetwork2 {
add2hosts("$etc/hosts", "localhost", "127.0.0.1");
any { $_->{BOOTPROTO} eq "dhcp" } values %$intf and $in->do_pkgs->install($netc->{dhcp_client} || 'dhcp-client');
- $in->do_pkgs->install(qw(tmdns)) if !$in->do_pkgs->is_installed('bind');
- $in->do_pkgs->install(qw(zcip));
+ $in->do_pkgs->ensure_is_installed('tmdns', '/sbin/tmdns', 'auto') if !$in->do_pkgs->is_installed('bind');
+ $in->do_pkgs->ensure_is_installed('zcip', '/sbin/zcip', 'auto');
$netc->{ZEROCONF_HOSTNAME} and write_zeroconf("$etc/tmdns.conf", $netc->{ZEROCONF_HOSTNAME});
any { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %$intf and $in->do_pkgs->install('pump');
}
diff --git a/perl-install/standalone.pm b/perl-install/standalone.pm
index 84e9d1b2e..b05301b5f 100644
--- a/perl-install/standalone.pm
+++ b/perl-install/standalone.pm
@@ -164,6 +164,11 @@ sub install {
return 1 if is_installed($o, @l);
+ if ($::testing) {
+ log::l("i would install packages " . join(' ', @l));
+ return 1;
+ }
+
my $wait;
if ($o->{in}->isa('interactive::newt')) {
$o->{in}->suspend;