From 59c77e7e2354a3baff521e1d85e7031d2682474f Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 18 Oct 2001 21:25:57 +0000 Subject: [PATCH] Much more efficient code with the newest dswim. --- add-ons/yard/make-debian-X11/make_debian-X11 | 24 +++++++++++++----- yard/scripts/make_debian | 26 +++++++++++++++----- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/add-ons/yard/make-debian-X11/make_debian-X11 b/add-ons/yard/make-debian-X11/make_debian-X11 index fb2008f..ceadb2a 100755 --- a/add-ons/yard/make-debian-X11/make_debian-X11 +++ b/add-ons/yard/make-debian-X11/make_debian-X11 @@ -292,11 +292,17 @@ return $stuff; # to test for anyways, weirder things have been known to happen. my @rpc; -foreach my $p (@required_packages) { +$/ = ""; +my @required_stuff = `swim -qi @required_packages`; +$/ = "\n"; +foreach my $package_info (@required_stuff) { + $package_info =~ /^package[:]*\s+([-\+\d\w]+)/i; + my $p = $1; $p =~ s/\+/\\+/g if $p !~ /\\+/g; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/, - `swim -qi $p`) == 1 ) { - push(@rpc,$p); + $package_info ) == 1 ) { + $p =~ s/\\//g if $p =~ /\\+/g; + push( @rpc, $p ); } } @@ -310,11 +316,17 @@ if (@rpc) { } my @epc; -foreach my $p (@extra_packages) { +$/ = ""; +my @extra_stuff = `swim -qi @extra_packages`; +$/ = "\n"; +foreach my $package_info (@extra_stuff) { + $package_info =~ /^package[:]*\s+([-\+\d\w]+)/i; + my $p = $1; $p =~ s/\+/\\+/g if $p !~ /\\+/g; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/, - `swim -qi $p`) == 1 ) { - push(@epc,$p); + $package_info ) == 1 ) { + $p =~ s/\\//g if $p =~ /\\+/g; + push( @epc, $p ); } } diff --git a/yard/scripts/make_debian b/yard/scripts/make_debian index f52aa7e..27ec832 100755 --- a/yard/scripts/make_debian +++ b/yard/scripts/make_debian @@ -265,14 +265,21 @@ return $stuff; # to test for anyways, weirder things have been known to happen. my @rpc; -foreach my $p (@required_packages) { +$/ = ""; +my @required_stuff = `swim -qi @required_packages`; +$/ = "\n"; +foreach my $package_info (@required_stuff) { + $package_info =~ /^package[:]*\s+([-\+\d\w]+)/i; + my $p = $1; $p =~ s/\+/\\+/g if $p !~ /\\+/g; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/, - `swim -qi $p`) == 1 ) { - push(@rpc,$p); + $package_info ) == 1 ) { + $p =~ s/\\//g if $p =~ /\\+/g; + push( @rpc, $p ); } } + if (@rpc) { print STDERR "These are the required packages which were specified:\n\n"; $, = " "; @@ -282,12 +289,19 @@ if (@rpc) { $, = ""; } + my @epc; -foreach my $p (@extra_packages) { +$/ = ""; +my @extra_stuff = `swim -qi @extra_packages`; +$/ = "\n"; +foreach my $package_info (@extra_stuff) { + $package_info =~ /^package[:]*\s+([-\+\d\w]+)/i; + my $p = $1; $p =~ s/\+/\\+/g if $p !~ /\\+/g; if ( grep(/Status: deinstall|Status: purge|package $p is not installed/, - `swim -qi $p`) == 1 ) { - push(@epc,$p); + $package_info ) == 1 ) { + $p =~ s/\\//g if $p =~ /\\+/g; + push( @epc, $p ); } }