From d11580a25fd06ebde37b60193b16f951b0ebff53 Mon Sep 17 00:00:00 2001 From: codehelp Date: Tue, 24 Mar 2009 14:09:55 +0000 Subject: [PATCH] relocate the installed check for the system, not the multistrap git-svn-id: http://emdebian.org/svn/current@5729 563faec7-e20c-0410-992a-a66f704d0ccd --- em_multistrap | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/em_multistrap b/em_multistrap index 6794afc..c240b44 100755 --- a/em_multistrap +++ b/em_multistrap @@ -173,15 +173,21 @@ END close SOURCES; } } - -foreach $keyring (values %keyrings) +my $k; +foreach my $pkg (values %keyrings) +{ + next if (not defined $pkg); + my $status = `dpkg -s $pkg`; + next if $status =~ /Status: install ok installed/; + $k .= "$pkg "; +} +if (defined $k) { - next if not defined ($keyring); my $e=`printenv`; my $str = ($e =~ /\nUSER=root\n/) ? "" : "sudo "; $str = (-f "/usr/bin/sudo") ? "$str" : ""; - print "I: Installing $keyring\n"; - system ("$str apt-get install $keyring"); + print "I: Installing $k\n"; + system ("$str apt-get install $k"); } $config_str = ''; @@ -200,16 +206,7 @@ $config_str .= " -o Dir::Cache=${dir}${cachedir}"; system ("apt-get $config_str update"); $str = join (' ', values %packages) . " "; chomp($str); -my $k; -foreach my $pkg (values %keyrings) -{ - next if (not defined $pkg); - my $status = `dpkg -s $pkg`; - next if $status =~ /Status: install ok installed/; - $k .= "$pkg "; -} -$k = "" if (not defined $k); -$str .= "$k "; +$str .= join (' ', values %keyrings) . " "; chomp($str); my $required = &get_required_debs; $str .= join (' ', @$required);