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);