From aacb3559a9d5017d281232cfea3007f6b1b49b60 Mon Sep 17 00:00:00 2001 From: freesource Date: Fri, 14 Sep 2001 02:45:53 +0000 Subject: [PATCH] Added a check to show the user what packages aren't installed on the system, but let the user decide what to do next. Obviously required packages are a more important consideration. --- yard/scripts/make_debian | 54 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/yard/scripts/make_debian b/yard/scripts/make_debian index ac06d64..e4f72ab 100755 --- a/yard/scripts/make_debian +++ b/yard/scripts/make_debian @@ -67,8 +67,6 @@ open(SWIM,$swim_packages) or die "Couldn't open swim_packages: $?\n"; my @required_packages = ; chomp @required_packages; close(SWIM); -push(@required_packages,@extra_packages); - # All the files open(SWIM,$swim_list) or die "Couldn't open swim_list: $!\n"; my @required_files = ; chomp @required_files; @@ -250,6 +248,58 @@ return $stuff; ################################################################# ################################################################# +################### +## Package Check ## +################### + +# Better tell the user what required and extra packages don't exist. + +my $required_packages_check = "swim -q @required_packages|"; +open (CHECK,$required_packages_check) + or die "Couldn't find any required packages: $?\n"; +my @rpc; +while () { + if (/^package/) { + my $rpc = (split(/\s/))[1]; + push(@rpc,$rpc); + + } +} +close (CHECK); + +if (@rpc) { + print "There are the required packages which were specified:\n\n"; + $, = " "; + print @required_packages, "\n\n"; + print "This is what wasn't installed on your system:\n\n"; + print @rpc , "\n\n"; + $, = ""; +} + +my $extra_packages_check = "swim -q @extra_packages|"; +open (CHECK,$extra_packages_check) + or die "Couldn't find any required packages: $?\n"; +my @epc; +while () { + if (/^package/) { + my $epc = (split(/\s/))[1]; + push(@epc,$epc); + } +} +close (CHECK); + +if (@epc) { + print "There are the extra packages which were specified:\n\n"; + $, = " "; + print @extra_packages, "\n\n"; + print "This is what wasn't installed on your system:\n\n"; + print @epc , "\n\n"; + $, = ""; +} + +push(@required_packages,@extra_packages); + + ####################### ## Template Creation ## #######################