1
0
mirror of https://github.com/fspc/gbootroot.git synced 2025-02-26 10:03:23 -05:00

Changed the package check to query -i, and check to see whether the status

has deinstall|purge, as well as to check whether the package actually exists.
This commit is contained in:
freesource 2001-10-18 05:15:22 +00:00
parent 1c3fe99928
commit 1a84688f59
2 changed files with 24 additions and 38 deletions

View File

@ -291,18 +291,14 @@ return $stuff;
# the information is taken directly from the system. But it is fun # the information is taken directly from the system. But it is fun
# to test for anyways, weirder things have been known to happen. # to test for anyways, weirder things have been known to happen.
my $required_packages_check = "swim -q @required_packages|";
open (CHECK,$required_packages_check)
or die "Couldn't find any required packages: $?\n";
my @rpc; my @rpc;
while (<CHECK>) { foreach my $p (@required_packages) {
if (/^package/) { $p =~ s/\+/\\+/g if $p !~ /\\+/g;
my $rpc = (split(/\s/))[1]; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/,
push(@rpc,$rpc); `swim -qi $p`) == 1 ) {
push(@rpc,$p);
} }
} }
close (CHECK);
if (@rpc) { if (@rpc) {
print STDERR "These are the required packages which were specified:\n\n"; print STDERR "These are the required packages which were specified:\n\n";
@ -313,17 +309,14 @@ if (@rpc) {
$, = ""; $, = "";
} }
my $extra_packages_check = "swim -q @extra_packages|";
open (CHECK,$extra_packages_check)
or die "Couldn't find any required packages: $?\n";
my @epc; my @epc;
while (<CHECK>) { foreach my $p (@extra_packages) {
if (/^package/) { $p =~ s/\+/\\+/g if $p !~ /\\+/g;
my $epc = (split(/\s/))[1]; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/,
push(@epc,$epc); `swim -qi $p`) == 1 ) {
} push(@epc,$p);
}
} }
close (CHECK);
if (@epc) { if (@epc) {
print STDERR "These are the extra packages which were specified:\n\n"; print STDERR "These are the extra packages which were specified:\n\n";

View File

@ -264,18 +264,14 @@ return $stuff;
# the information is taken directly from the system. But it is fun # the information is taken directly from the system. But it is fun
# to test for anyways, weirder things have been known to happen. # to test for anyways, weirder things have been known to happen.
my $required_packages_check = "swim -q @required_packages|";
open (CHECK,$required_packages_check)
or die "Couldn't find any required packages: $?\n";
my @rpc; my @rpc;
while (<CHECK>) { foreach my $p (@required_packages) {
if (/^package/) { $p =~ s/\+/\\+/g if $p !~ /\\+/g;
my $rpc = (split(/\s/))[1]; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/,
push(@rpc,$rpc); `swim -qi $p`) == 1 ) {
push(@rpc,$p);
} }
} }
close (CHECK);
if (@rpc) { if (@rpc) {
print STDERR "These are the required packages which were specified:\n\n"; print STDERR "These are the required packages which were specified:\n\n";
@ -286,17 +282,14 @@ if (@rpc) {
$, = ""; $, = "";
} }
my $extra_packages_check = "swim -q @extra_packages|";
open (CHECK,$extra_packages_check)
or die "Couldn't find any required packages: $?\n";
my @epc; my @epc;
while (<CHECK>) { foreach my $p (@extra_packages) {
if (/^package/) { $p =~ s/\+/\\+/g if $p !~ /\\+/g;
my $epc = (split(/\s/))[1]; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/,
push(@epc,$epc); `swim -qi $p`) == 1 ) {
} push(@epc,$p);
}
} }
close (CHECK);
if (@epc) { if (@epc) {
print STDERR "These are the extra packages which were specified:\n\n"; print STDERR "These are the extra packages which were specified:\n\n";