diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2002-12-03 12:10:07 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2002-12-03 12:10:07 +0000 |
commit | 098761b262cb0a18641dde8e8823e2c42c441729 (patch) | |
tree | 15198a3442e0da8edcb3a919db2b0a6eed97e70d | |
parent | 5b45d3c5a8c61f076370b6ca3d14abeeceed5009 (diff) | |
download | drakx-backup-do-not-use-098761b262cb0a18641dde8e8823e2c42c441729.tar drakx-backup-do-not-use-098761b262cb0a18641dde8e8823e2c42c441729.tar.gz drakx-backup-do-not-use-098761b262cb0a18641dde8e8823e2c42c441729.tar.bz2 drakx-backup-do-not-use-098761b262cb0a18641dde8e8823e2c42c441729.tar.xz drakx-backup-do-not-use-098761b262cb0a18641dde8e8823e2c42c441729.zip |
make it $::testing aware
-rw-r--r-- | perl-install/network/tools.pm | 1 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 19 |
2 files changed, 14 insertions, 6 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 48809e8ef..4d84c4baa 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -222,6 +222,7 @@ sub disconnected {} sub write_initscript { + $::testing and return; output_with_perm("$prefix/etc/rc.d/init.d/internet", 0755, sprintf(<<'EOF', $connect_file, $connect_file, $disconnect_file, $disconnect_file)); #!/bin/bash diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 42c45d5ae..4d793fda5 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -974,9 +974,16 @@ sub install($$$;$$) { $SIG{SEGV} = sub { log::l("segmentation fault on transactions"); c::_exit(0) }; my @prev_pids = grep { /^\d+$/ } all("/proc"); my $db; - eval { - close INPUT; - select((select(OUTPUT), $| = 1)[0]); + close INPUT; + select((select(OUTPUT), $| = 1)[0]); + if ($::testing) { + my $size_typical = $nb ? int($total/$nb) : 0; + foreach (@transToInstall) { + log::l("i would install ", $_->name, " now"); + my $id = $_->id; + print OUTPUT "inst:$id:start:0:$size_typical\ninst:$id:progress:0:$size_typical\nclose:$id\n"; + } + } else { eval { my $db = URPM::DB::open($prefix, 1) or die "error opening RPM database: ", c::rpmErrorString(); my $trans = $db->create_transaction($prefix); if ($retry_pkg) { @@ -1019,7 +1026,7 @@ sub install($$$;$$) { install_any::getFile('XXX'); #- close still opened fd. @probs and die "installation of rpms failed:\n ", join("\n ", @probs); - }; $@ and print OUTPUT "die:$@\n"; + }; $@ and print OUTPUT "die:$@\n"; } close OUTPUT; #- now search for child process which may be locking the cdrom, making it unable to be ejected. @@ -1036,7 +1043,7 @@ sub install($$$;$$) { if (@killpid) { foreach (@killpid) { my $s = "$_: " . join(' ', split("\0", cat_("/proc/$_/cmdline"))); - log::l("ERROR: DrakX should not have to clean the packages shit. Killing $s"); + log::l("ERROR: DrakX should not have to clean the packages shit. Killing $s."); } kill 15, @killpid; sleep 2; @@ -1230,7 +1237,7 @@ sub hashtree2list { while (@todo) { my $e = shift @todo; push @l, $e; - push @todo, @{$h->{$e}}; + push @todo, @{$h->{$e} || []}; } @l; } |