1
0
mirror of https://github.com/fspc/dswim.git synced 2025-02-22 08:33:24 -05:00

-p options have unecessary warnings supressed.

This commit is contained in:
freesource 2001-10-14 19:15:41 +00:00
parent 110589ac75
commit 3762885480
3 changed files with 197 additions and 191 deletions

View File

@ -13,11 +13,11 @@ install:
cp -f swimrc /etc/swim cp -f swimrc /etc/swim
remove: remove:
rm /usr/lib/perl5/SWIM/* rm /usr/share/perl5/SWIM/*
rmdir /usr/lib/perl5/SWIM rmdir /usr/share/perl5/SWIM
rm /usr/bin/swim rm /usr/bin/swim
rm /usr/lib/SWIM/* rm /usr/lib/SWIM/*swim
rmdir /usr/lib/SWIM rm -rf /usr/lib/SWIM

View File

@ -26,6 +26,7 @@ use SWIM::DB_Library qw(:Deb);
use SWIM::Compare; use SWIM::Compare;
use vars qw(@ISA @EXPORT); use vars qw(@ISA @EXPORT);
use Exporter; use Exporter;
no warnings;
@ISA = qw(Exporter); @ISA = qw(Exporter);
@EXPORT = qw(deb_package md5sumo); @EXPORT = qw(deb_package md5sumo);
@ -58,7 +59,8 @@ sub deb_package {
# SITUATION 0 # # SITUATION 0 #
############### ###############
if (m,\.\./|^\.\.$,) { if (m,\.\./|^\.\.$,) {
if ($_ !~ m,/[\w-+]+/[\.\$\^\+\?\*\[\]\w-]*$,) { #if ($_ !~ m,/[\w-+]+/[\.\$\^\+\?\*\[\]\w-]*$,) {
if ($_ !~ m,/(\w-+)+/[\.\$\^\+\?\*\[\]\w-]*$,) {
my $dd; tr/\/// ? ($dd = tr/\///) : ($dd = 1); my $dd; tr/\/// ? ($dd = tr/\///) : ($dd = 1);
my @pwd = split(m,/,,$pwd); my @pwd = split(m,/,,$pwd);
s,\.\./,,g; s,\.\./,,g;
@ -75,10 +77,10 @@ sub deb_package {
# we will first check to see if $argument really is a Debian # we will first check to see if $argument really is a Debian
# package # package
my $real; my $real;
if (defined $dpkg_deb) { if ($dpkg_deb) {
$real = system("$dpkg_deb -f $argument Package 2&>/dev/null"); $real = system("$dpkg_deb -f $argument Package 2&>/dev/null");
} }
elsif (defined $ar) { elsif ($ar) {
$real = system "$ar -p $argument debian-binary 2&>/dev/null"; $real = system "$ar -p $argument debian-binary 2&>/dev/null";
} }
# construct the fields to the standard of swim # construct the fields to the standard of swim
@ -91,11 +93,11 @@ sub deb_package {
if ($commands->{"i"}) { if ($commands->{"i"}) {
shbang(\%commands); shbang(\%commands);
package_processor(\%commands); package_processor(\%commands);
if (defined $dpkg_deb) { if ($dpkg_deb) {
print "Description: "; print "Description: ";
system "$dpkg_deb -f $argument Description"; system "$dpkg_deb -f $argument Description";
} }
elsif (defined $ar) { elsif ($ar) {
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\""; $grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
} }
@ -112,14 +114,14 @@ sub deb_package {
deps(\%commands); deps(\%commands);
# nothing fancy here, no md5sums, no indenting. # nothing fancy here, no md5sums, no indenting.
if ($commands->{"c"}) { if ($commands->{"c"}) {
if (defined $dpkg_deb) { if ($dpkg_deb) {
$real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
system "$dpkg_deb --info $argument conffiles"; system "$dpkg_deb --info $argument conffiles";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz conffiles >/dev/null 2>&1"; $tar tOz conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -164,10 +166,10 @@ sub deb_package {
# we will first check to see if $argument really is a Debian # we will first check to see if $argument really is a Debian
# package # package
my $real; my $real;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system("$dpkg_deb -f $argument Package 2&>/dev/null"); $real = system("$dpkg_deb -f $argument Package 2&>/dev/null");
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument debian-binary 2&>/dev/null"; $real = system "$ar -p $argument debian-binary 2&>/dev/null";
} }
# construct the fields to the standard of swim # construct the fields to the standard of swim
@ -180,11 +182,11 @@ sub deb_package {
if ($commands->{"i"}) { if ($commands->{"i"}) {
shbang(\%commands); shbang(\%commands);
package_processor(\%commands); package_processor(\%commands);
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Description: "; print "Description: ";
system "$dpkg_deb -f $argument Description"; system "$dpkg_deb -f $argument Description";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\""; $grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
} }
@ -201,14 +203,14 @@ sub deb_package {
deps(\%commands); deps(\%commands);
# nothing fancy here, no md5sums, no indenting. # nothing fancy here, no md5sums, no indenting.
if ($commands->{"c"}) { if ($commands->{"c"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
system "$dpkg_deb --info $argument conffiles"; system "$dpkg_deb --info $argument conffiles";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz conffiles >/dev/null 2>&1"; $tar tOz conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -243,10 +245,10 @@ sub deb_package {
# we will first check to see if $argument really is a Debian # we will first check to see if $argument really is a Debian
# package # package
my $real; my $real;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system("$dpkg_deb -f $argument Package 2&>/dev/null"); $real = system("$dpkg_deb -f $argument Package 2&>/dev/null");
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument debian-binary 2&>/dev/null"; $real = system "$ar -p $argument debian-binary 2&>/dev/null";
} }
# construct the fields to the standard of swim # construct the fields to the standard of swim
@ -259,11 +261,11 @@ sub deb_package {
if ($commands->{"i"}) { if ($commands->{"i"}) {
shbang(\%commands); shbang(\%commands);
package_processor(\%commands); package_processor(\%commands);
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Description: "; print "Description: ";
system "$dpkg_deb -f $argument Description"; system "$dpkg_deb -f $argument Description";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\""; $grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
} }
@ -280,14 +282,14 @@ sub deb_package {
deps(\%commands); deps(\%commands);
# nothing fancy here, no md5sums, no indenting. # nothing fancy here, no md5sums, no indenting.
if ($commands->{"c"}) { if ($commands->{"c"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
system "$dpkg_deb --info $argument conffiles"; system "$dpkg_deb --info $argument conffiles";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz conffiles >/dev/null 2>&1"; $tar tOz conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -326,10 +328,10 @@ sub deb_package {
# we will first check to see if $argument really is a Debian # we will first check to see if $argument really is a Debian
# package # package
my $real; my $real;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system("$dpkg_deb -f $argument Package 2&>/dev/null"); $real = system("$dpkg_deb -f $argument Package 2&>/dev/null");
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument debian-binary 2&>/dev/null"; $real = system "$ar -p $argument debian-binary 2&>/dev/null";
} }
# construct the fields to the standard of swim # construct the fields to the standard of swim
@ -342,11 +344,11 @@ sub deb_package {
if ($commands->{"i"}) { if ($commands->{"i"}) {
shbang(\%commands); shbang(\%commands);
package_processor(\%commands); package_processor(\%commands);
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Description: "; print "Description: ";
system "$dpkg_deb -f $argument Description"; system "$dpkg_deb -f $argument Description";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\""; $grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
} }
@ -363,14 +365,14 @@ sub deb_package {
deps(\%commands); deps(\%commands);
# nothing fancy here, no md5sums, no indenting. # nothing fancy here, no md5sums, no indenting.
if ($commands->{"c"}) { if ($commands->{"c"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
system "$dpkg_deb --info $argument conffiles"; system "$dpkg_deb --info $argument conffiles";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz conffiles >/dev/null 2>&1"; $tar tOz conffiles >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -424,16 +426,16 @@ sub extract {
# extract files into the current directory # extract files into the current directory
if (defined $same) { if ( $same) {
# this is one of these instances where not being precise is o.k. # this is one of these instances where not being precise is o.k.
print "swim: specify PWD before ! :*}\n" if $same ne "PWD"; print "swim: specify PWD before ! :*}\n" if $same ne "PWD";
print "swim: PWD is used for extracting files into the current directory\n" print "swim: PWD is used for extracting files into the current directory\n"
if $file =~ m,.*/$,; exit if $file =~ m,.*/$,; if $file =~ m,.*/$,; exit if $file =~ m,.*/$,;
chdir($tmp); chdir($tmp);
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar x $file 2> fields.deb"; system "$dpkg_deb --fsys-tarfile $argument | $tar x $file 2> fields.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar xz $file 2> fields.deb"; system "$ar -p $argument data.tar.gz | $tar xz $file 2> fields.deb";
} }
@ -446,7 +448,7 @@ sub extract {
rename("$tmp/$file","$pwd/$1") rename("$tmp/$file","$pwd/$1")
or system "$mv","$tmp/$file", "$pwd/$1"; or system "$mv","$tmp/$file", "$pwd/$1";
my @ddirs = split(m,/,,$file); my @ddirs = split(m,/,,$file);
if (defined @ddirs) { if ( @ddirs) {
chdir("$tmp/$ddirs[0]"); chdir("$tmp/$ddirs[0]");
system "rm -rf *"; system "rm -rf *";
chdir($tmp); chdir($tmp);
@ -462,10 +464,10 @@ sub extract {
elsif ($file ne "ALL") { elsif ($file ne "ALL") {
chdir($pwd); chdir($pwd);
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar x $file 2> $tmp/fields.deb"; system "$dpkg_deb --fsys-tarfile $argument | $tar x $file 2> $tmp/fields.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar xz $file 2> $tmp/fields.deb"; system "$ar -p $argument data.tar.gz | $tar xz $file 2> $tmp/fields.deb";
} }
@ -483,10 +485,10 @@ sub extract {
else { else {
chdir($pwd); chdir($pwd);
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar x 2> $tmp/fields.deb"; system "$dpkg_deb --fsys-tarfile $argument | $tar x 2> $tmp/fields.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar xz 2> $tmp/fields.deb"; system "$ar -p $argument data.tar.gz | $tar xz 2> $tmp/fields.deb";
} }
$argument =~ m,.*/(.*)$,; $argument =~ m,.*/(.*)$,;
@ -574,10 +576,10 @@ sub printme {
$commands->{"conflicts"} || $commands->{"requires"} || $commands->{"conflicts"} || $commands->{"requires"} ||
$commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} || $commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} ||
$commands->{"copyright"})) { $commands->{"copyright"})) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package > $tmp/temp.deb"; system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Package: > $tmp/temp.deb"; $grep Package: > $tmp/temp.deb";
system "perl -pi -e \"s/Package: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Package: //\" $tmp/temp.deb";
@ -588,10 +590,10 @@ sub printme {
print; print;
} }
print "_"; print "_";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb", "-f", "$argument", "Version"; system "$dpkg_deb", "-f", "$argument", "Version";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Version: > $tmp/temp.deb"; $grep Version: > $tmp/temp.deb";
system "perl -pi -e \"s/Version: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Version: //\" $tmp/temp.deb";
@ -610,10 +612,10 @@ sub printme {
$commands->{"conflicts"} || $commands->{"requires"} || $commands->{"conflicts"} || $commands->{"requires"} ||
$commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} || $commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} ||
$commands->{"copyright"})) { $commands->{"copyright"})) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package > $tmp/temp.deb"; system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Package: > $tmp/temp.deb"; $grep Package: > $tmp/temp.deb";
system "perl -pi -e \"s/Package: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Package: //\" $tmp/temp.deb";
@ -624,10 +626,10 @@ sub printme {
print; print;
} }
print "_"; print "_";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb", "-f", "$argument", "Version"; system "$dpkg_deb", "-f", "$argument", "Version";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Version: > $tmp/temp.deb"; $grep Version: > $tmp/temp.deb";
system "perl -pi -e \"s/Version: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Version: //\" $tmp/temp.deb";
@ -650,10 +652,10 @@ that there was a reason for doing it this way.
$commands->{"conflicts"} || $commands->{"requires"} || $commands->{"conflicts"} || $commands->{"requires"} ||
$commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} || $commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} ||
$commands->{"copyright"})) { $commands->{"copyright"})) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package > $tmp/temp.deb"; system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Package: > $tmp/temp.deb"; $grep Package: > $tmp/temp.deb";
system "perl -pi -e \"s/Package: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Package: //\" $tmp/temp.deb";
@ -665,10 +667,10 @@ that there was a reason for doing it this way.
print; print;
} }
print "_"; print "_";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb", "-f", "$argument", "Version"; system "$dpkg_deb", "-f", "$argument", "Version";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Version: > $tmp/temp.deb"; $grep Version: > $tmp/temp.deb";
system "perl -pi -e \"s/Version: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Version: //\" $tmp/temp.deb";
@ -685,10 +687,10 @@ that there was a reason for doing it this way.
$commands->{"conflicts"} || $commands->{"requires"} || $commands->{"conflicts"} || $commands->{"requires"} ||
$commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} || $commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} ||
$commands->{"copyright"})) { $commands->{"copyright"})) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package > $tmp/temp.deb"; system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Package: > $tmp/temp.deb"; $grep Package: > $tmp/temp.deb";
system "perl -pi -e \"s/Package: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Package: //\" $tmp/temp.deb";
@ -700,10 +702,10 @@ that there was a reason for doing it this way.
print; print;
} }
print "_"; print "_";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb", "-f", "$argument", "Version"; system "$dpkg_deb", "-f", "$argument", "Version";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Version: > $tmp/temp.deb"; $grep Version: > $tmp/temp.deb";
system "perl -pi -e \"s/Version: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Version: //\" $tmp/temp.deb";
@ -720,10 +722,10 @@ that there was a reason for doing it this way.
$commands->{"conflicts"} || $commands->{"requires"} || $commands->{"conflicts"} || $commands->{"requires"} ||
$commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} || $commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} ||
$commands->{"copyright"})) { $commands->{"copyright"})) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package > $tmp/temp.deb"; system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Package: > $tmp/temp.deb"; $grep Package: > $tmp/temp.deb";
system "perl -pi -e \"s/Package: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Package: //\" $tmp/temp.deb";
@ -735,10 +737,10 @@ that there was a reason for doing it this way.
print; print;
} }
print "_"; print "_";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb", "-f", "$argument", "Version"; system "$dpkg_deb", "-f", "$argument", "Version";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\ system "$ar -p $argument control.tar.gz | $tar Oxz |\
$grep Version: > $tmp/temp.deb"; $grep Version: > $tmp/temp.deb";
system "perl -pi -e \"s/Version: //\" $tmp/temp.deb"; system "perl -pi -e \"s/Version: //\" $tmp/temp.deb";
@ -759,7 +761,7 @@ sub copyrighto {
if ($commands->{"copyright"}) { if ($commands->{"copyright"}) {
# find everything with change # find everything with change
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar t |\ system "$dpkg_deb --fsys-tarfile $argument | $tar t |\
$grep -E \"usr/doc\|usr/share/doc\" |\ $grep -E \"usr/doc\|usr/share/doc\" |\
$grep -Ei \"copy|license\" > $tmp/fields.deb"; $grep -Ei \"copy|license\" > $tmp/fields.deb";
@ -771,7 +773,7 @@ sub copyrighto {
$grep -E \"usr/doc\|usr/share/doc\" |\ $grep -E \"usr/doc\|usr/share/doc\" |\
$grep -Ei \"copy|license\" > $tmp/linkto.deb"; $grep -Ei \"copy|license\" > $tmp/linkto.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar tz |\ system "$ar -p $argument data.tar.gz | $tar tz |\
$grep -E \"usr/doc\|usr/share/doc\" |\ $grep -E \"usr/doc\|usr/share/doc\" |\
$grep -Ei \"copy|license\" > $tmp/fields.deb"; $grep -Ei \"copy|license\" > $tmp/fields.deb";
@ -791,7 +793,7 @@ sub copyrighto {
$whattodo = "yes"; $whattodo = "yes";
} }
} }
if (defined $whattodo) { if ( $whattodo) {
open(FIELDS, ">$tmp/fields.deb"); open(FIELDS, ">$tmp/fields.deb");
foreach (@links) { foreach (@links) {
print FIELDS; print FIELDS;
@ -812,12 +814,12 @@ sub copyrighto {
my $change = $1; my $change = $1;
if ($_ =~ m,\.gz$,) { if ($_ =~ m,\.gz$,) {
print "#####$change for $name#####\n\n"; print "#####$change for $name#####\n\n";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument |\ system "$dpkg_deb --fsys-tarfile $argument |\
$tar xO $_ | gzip -d"; $tar xO $_ | gzip -d";
print "\n"; print "\n";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar xOz $_ | gzip -d"; $tar xOz $_ | gzip -d";
print "\n"; print "\n";
@ -825,11 +827,11 @@ sub copyrighto {
} }
elsif ($_ !~ m,html$|htm$|ps$|dvi$|sgml$|gs$,) { elsif ($_ !~ m,html$|htm$|ps$|dvi$|sgml$|gs$,) {
print "#####$change for $name#####\n\n"; print "#####$change for $name#####\n\n";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_"; system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_";
print "\n"; print "\n";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar xOz $_"; system "$ar -p $argument data.tar.gz | $tar xOz $_";
print "\n"; print "\n";
} }
@ -851,12 +853,12 @@ sub changelogo {
if ($commands->{"changelog"}) { if ($commands->{"changelog"}) {
# find everything with change # find everything with change
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar t |\ system "$dpkg_deb --fsys-tarfile $argument | $tar t |\
$grep -E \"usr/doc\|usr/share/doc\" |\ $grep -E \"usr/doc\|usr/share/doc\" |\
$grep -i change > $tmp/fields.deb"; $grep -i change > $tmp/fields.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar tz |\ system "$ar -p $argument data.tar.gz | $tar tz |\
$grep -E \"usr/doc\|usr/share/doc\" |\ $grep -E \"usr/doc\|usr/share/doc\" |\
$grep -i change > $tmp/fields.deb"; $grep -i change > $tmp/fields.deb";
@ -865,11 +867,11 @@ sub changelogo {
# Maybe just do this once, faster. # Maybe just do this once, faster.
# occasionally a changelog is linked to another file..so that file has # occasionally a changelog is linked to another file..so that file has
# to be used instead, this routine checks for this situation. # to be used instead, this routine checks for this situation.
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar tv | $grep usr/doc |\ system "$dpkg_deb --fsys-tarfile $argument | $tar tv | $grep usr/doc |\
$grep -i change > $tmp/linkto.deb"; $grep -i change > $tmp/linkto.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar tvz | $grep usr/doc |\ system "$ar -p $argument data.tar.gz | $tar tvz | $grep usr/doc |\
$grep -i change > $tmp/linkto.deb"; $grep -i change > $tmp/linkto.deb";
} }
@ -884,7 +886,7 @@ sub changelogo {
$whattodo = "yes"; $whattodo = "yes";
} }
} }
if (defined $whattodo) { if ( $whattodo) {
open(FIELDS, ">$tmp/fields.deb"); open(FIELDS, ">$tmp/fields.deb");
foreach (@links) { foreach (@links) {
print FIELDS; print FIELDS;
@ -905,12 +907,12 @@ sub changelogo {
my $change = $1; my $change = $1;
if ($_ =~ m,\.gz$,) { if ($_ =~ m,\.gz$,) {
print "#####$change for $name#####\n\n"; print "#####$change for $name#####\n\n";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_ |\ system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_ |\
gzip -d"; gzip -d";
print "\n"; print "\n";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar xOz $_ |\ system "$ar -p $argument data.tar.gz | $tar xOz $_ |\
gzip -d"; gzip -d";
print "\n"; print "\n";
@ -918,11 +920,11 @@ sub changelogo {
} }
elsif ($_ !~ m,html$|htm$|ps$|dvi$|sgml$|gs$,) { elsif ($_ !~ m,html$|htm$|ps$|dvi$|sgml$|gs$,) {
print "#####$change for $name#####\n\n"; print "#####$change for $name#####\n\n";
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_"; system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_";
print "\n"; print "\n";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz | $tar xOz $_"; system "$ar -p $argument data.tar.gz | $tar xOz $_";
print "\n"; print "\n";
} }
@ -940,7 +942,7 @@ sub menuo {
if ($commands->{"menu"} || $commands->{"m"}) { if ($commands->{"menu"} || $commands->{"m"}) {
# find everything with change # find everything with change
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar t |\ system "$dpkg_deb --fsys-tarfile $argument | $tar t |\
$grep -E usr/lib/menu/[0-9A-Za-z\+\.-] > $tmp/fields.deb"; $grep -E usr/lib/menu/[0-9A-Za-z\+\.-] > $tmp/fields.deb";
@ -950,7 +952,8 @@ sub menuo {
my $name = $2; my $name = $2;
while (<MENU>) { while (<MENU>) {
#print "$_\n"; #print "$_\n";
if (m,^usr\/lib\/menu\/(.*[\w-\+\.]$),) { #if (m,^usr\/lib\/menu\/(.*[\w-\+\.]$),) {
if (m,^usr\/lib\/menu\/(.*(\w-\+\.)$),) {
print "#####menu for $name($1)#####\n"; print "#####menu for $name($1)#####\n";
system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_"; system "$dpkg_deb --fsys-tarfile $argument | $tar xO $_";
print "\n"; print "\n";
@ -958,7 +961,7 @@ sub menuo {
} }
close(MENU); close(MENU);
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar tOz usr/lib/menu/[0-9A-Za-z\+\.-]* 2> $tmp/fields.deb"; $tar tOz usr/lib/menu/[0-9A-Za-z\+\.-]* 2> $tmp/fields.deb";
@ -967,8 +970,8 @@ sub menuo {
open(MENU,"$tmp/fields.deb"); open(MENU,"$tmp/fields.deb");
my $name = $2; my $name = $2;
while (<MENU>) { while (<MENU>) {
#print "$_\n"; #if (m,^usr\/lib\/menu\/(.*[\w-\+\.]$),) {
if (m,^usr\/lib\/menu\/(.*[\w-\+\.]$),) { if (m,^usr\/lib\/menu\/(.*(\w-\+\.)$),) {
print "#####menu for $name($1)#####\n"; print "#####menu for $name($1)#####\n";
system "$ar -p $argument data.tar.gz | $tar xOz $_"; system "$ar -p $argument data.tar.gz | $tar xOz $_";
print "\n"; print "\n";
@ -993,7 +996,7 @@ sub scripto {
$commands->{"postinst"} || $commands->{"prerem"} || $commands->{"postinst"} || $commands->{"prerem"} ||
$commands->{"postrm"} || $commands->{"config"} || $commands->{"templates"})) { $commands->{"postrm"} || $commands->{"config"} || $commands->{"templates"})) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument preinst >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument preinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
print "#####$1.preinst#####\n"; print "#####$1.preinst#####\n";
@ -1001,7 +1004,7 @@ sub scripto {
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz preinst >/dev/null 2>&1"; $tar tOz preinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1012,7 +1015,7 @@ sub scripto {
} }
} }
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument postinst >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument postinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
print "#####$1.postinst#####\n"; print "#####$1.postinst#####\n";
@ -1020,7 +1023,7 @@ sub scripto {
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz postinst >/dev/null 2>&1"; $tar tOz postinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1031,7 +1034,7 @@ sub scripto {
} }
} }
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument prerm >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument prerm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
print "#####$1.prerm#####\n"; print "#####$1.prerm#####\n";
@ -1039,7 +1042,7 @@ sub scripto {
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz prerm >/dev/null 2>&1"; $tar tOz prerm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1050,7 +1053,7 @@ sub scripto {
} }
} }
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument postrm >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument postrm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
print "#####$1.postrm#####\n"; print "#####$1.postrm#####\n";
@ -1058,7 +1061,7 @@ sub scripto {
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz postrm >/dev/null 2>&1"; $tar tOz postrm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1068,7 +1071,7 @@ sub scripto {
} }
} }
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument config >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument config >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
print "#####$1.config#####\n"; print "#####$1.config#####\n";
@ -1076,7 +1079,7 @@ sub scripto {
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz config >/dev/null 2>&1"; $tar tOz config >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1087,7 +1090,7 @@ sub scripto {
} }
} }
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument templates >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument templates >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
print "#####$1.templates#####\n"; print "#####$1.templates#####\n";
@ -1095,7 +1098,7 @@ sub scripto {
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz templates >/dev/null 2>&1"; $tar tOz templates >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1110,14 +1113,14 @@ sub scripto {
# no titles here # no titles here
if ($commands->{"preinst"}) { if ($commands->{"preinst"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument preinst >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument preinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
$real = system "$dpkg_deb -I $argument preinst"; $real = system "$dpkg_deb -I $argument preinst";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz preinst >/dev/null 2>&1"; $tar tOz preinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1129,14 +1132,14 @@ sub scripto {
} }
if ($commands->{"postinst"}) { if ($commands->{"postinst"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument postinst >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument postinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
system "$dpkg_deb -I $argument postinst"; system "$dpkg_deb -I $argument postinst";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz postinst >/dev/null 2>&1"; $tar tOz postinst >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1148,14 +1151,14 @@ sub scripto {
} }
if ($commands->{"prerm"}) { if ($commands->{"prerm"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument prerm >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument prerm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
$real = system "$dpkg_deb -I $argument prerm"; $real = system "$dpkg_deb -I $argument prerm";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz prerm >/dev/null 2>&1"; $tar tOz prerm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1167,14 +1170,14 @@ sub scripto {
} }
if ($commands->{"postrm"}) { if ($commands->{"postrm"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument postrm >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument postrm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
$real = system "$dpkg_deb -I $argument postrm"; $real = system "$dpkg_deb -I $argument postrm";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz postrm >/dev/null 2>&1"; $tar tOz postrm >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1186,14 +1189,14 @@ sub scripto {
} }
if ($commands->{"config"}) { if ($commands->{"config"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument config >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument config >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
$real = system "$dpkg_deb -I $argument config"; $real = system "$dpkg_deb -I $argument config";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz config >/dev/null 2>&1"; $tar tOz config >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1205,14 +1208,14 @@ sub scripto {
} }
if ($commands->{"templates"}) { if ($commands->{"templates"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
$real = system "$dpkg_deb -I $argument templates >/dev/null 2>&1"; $real = system "$dpkg_deb -I $argument templates >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
$real = system "$dpkg_deb -I $argument templates"; $real = system "$dpkg_deb -I $argument templates";
undef $real; undef $real;
} }
} }
elsif (defined $ar) { elsif ( $ar) {
$real = system "$ar -p $argument control.tar.gz |\ $real = system "$ar -p $argument control.tar.gz |\
$tar tOz templates >/dev/null 2>&1"; $tar tOz templates >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1233,7 +1236,7 @@ sub shlibso {
my ($commands) = @_; my %commands = %$commands; my ($commands) = @_; my %commands = %$commands;
if ($commands->{"shlibs"}) { if ($commands->{"shlibs"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
my $real = system "$dpkg_deb -I $argument shlibs >/dev/null 2>&1"; my $real = system "$dpkg_deb -I $argument shlibs >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
print "Shlibs:\n"; print "Shlibs:\n";
@ -1241,7 +1244,7 @@ sub shlibso {
print "\n"; print "\n";
} }
} }
elsif (defined $ar) { elsif ( $ar) {
my $real = system "$ar -p $argument control.tar.gz |\ my $real = system "$ar -p $argument control.tar.gz |\
$tar tOz shlibs >/dev/null 2>&1"; $tar tOz shlibs >/dev/null 2>&1";
if ($real == 0) { if ($real == 0) {
@ -1268,20 +1271,20 @@ sub listing {
# These next to print out the verbose ls -la listing when -v is used # These next to print out the verbose ls -la listing when -v is used
if (($commands->{"l"} && $commands->{"v"}) && !$commands->{"d"}) { if (($commands->{"l"} && $commands->{"v"}) && !$commands->{"d"}) {
if ($commands->{"df"}) { if ($commands->{"df"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --contents $argument"; system "$dpkg_deb --contents $argument";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar tOzv 2> $tmp/fields.deb; \ $tar tOzv 2> $tmp/fields.deb; \
$cat $tmp/fields.deb"; $cat $tmp/fields.deb";
} }
} }
elsif (!$commands->{"df"}) { elsif (!$commands->{"df"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --contents $argument > $tmp/fields.deb"; system "$dpkg_deb --contents $argument > $tmp/fields.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar tOzv 2> $tmp/fields.deb"; $tar tOzv 2> $tmp/fields.deb";
} }
@ -1295,10 +1298,10 @@ sub listing {
} }
if (($commands->{"l"} && $commands->{"v"} && $commands->{"d"}) || if (($commands->{"l"} && $commands->{"v"} && $commands->{"d"}) ||
$commands->{"d"} && $commands->{"v"}) { $commands->{"d"} && $commands->{"v"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --contents $argument > $tmp/fields.deb"; system "$dpkg_deb --contents $argument > $tmp/fields.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar tOzv 2> $tmp/fields.deb"; $tar tOzv 2> $tmp/fields.deb";
} }
@ -1313,23 +1316,23 @@ sub listing {
# These next two print out a short listing # These next two print out a short listing
if (($commands->{"l"} && !$commands->{"v"}) && !$commands->{"d"}) { if (($commands->{"l"} && !$commands->{"v"}) && !$commands->{"d"}) {
if ($commands->{"df"}) { if ($commands->{"df"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument | $tar t"; system "$dpkg_deb --fsys-tarfile $argument | $tar t";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar tOz 2> $tmp/fields.deb; \ $tar tOz 2> $tmp/fields.deb; \
$cat $tmp/fields.deb"; $cat $tmp/fields.deb";
} }
} }
elsif (!$commands->{"df"}) { elsif (!$commands->{"df"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument |\ system "$dpkg_deb --fsys-tarfile $argument |\
$tar t > $tmp/fields.deb"; $tar t > $tmp/fields.deb";
system "$dpkg_deb --fsys-tarfile $argument |\ system "$dpkg_deb --fsys-tarfile $argument |\
$tar tv > $tmp/temp.deb"; $tar tv > $tmp/temp.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar tOz 2> $tmp/fields.deb"; $tar tOz 2> $tmp/fields.deb";
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
@ -1350,13 +1353,13 @@ sub listing {
} }
if (($commands->{"l"} && !$commands->{"v"} && $commands->{"d"}) || if (($commands->{"l"} && !$commands->{"v"} && $commands->{"d"}) ||
$commands->{"d"} && !$commands->{"v"}) { $commands->{"d"} && !$commands->{"v"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb --fsys-tarfile $argument |\ system "$dpkg_deb --fsys-tarfile $argument |\
$tar t > $tmp/fields.deb"; $tar t > $tmp/fields.deb";
system "$dpkg_deb --fsys-tarfile $argument |\ system "$dpkg_deb --fsys-tarfile $argument |\
$tar tv > $tmp/temp.deb"; $tar tv > $tmp/temp.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
$tar tOz 2> $tmp/fields.deb"; $tar tOz 2> $tmp/fields.deb";
system "$ar -p $argument data.tar.gz |\ system "$ar -p $argument data.tar.gz |\
@ -1398,11 +1401,11 @@ sub deps {
print "$1\n"; print "$1\n";
} }
$title{$1}++; $title{$1}++;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Pre-Depends: "; print "Pre-Depends: ";
system "$dpkg_deb -f $argument Pre-Depends"; system "$dpkg_deb -f $argument Pre-Depends";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\ system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Pre-Depends: \w*\""; $tar xOz control | $grep \"Pre-Depends: \w*\"";
} }
@ -1413,11 +1416,11 @@ sub deps {
print "$1\n"; print "$1\n";
} }
$title{$1}++; $title{$1}++;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Depends: "; print "Depends: ";
system "$dpkg_deb -f $argument Depends"; system "$dpkg_deb -f $argument Depends";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\ system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Depends: \w*\""; $tar xOz control | $grep \"Depends: \w*\"";
} }
@ -1428,11 +1431,11 @@ sub deps {
print "$1\n"; print "$1\n";
} }
$title{$1}++; $title{$1}++;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Recommends: "; print "Recommends: ";
system "$dpkg_deb -f $argument Recommends"; system "$dpkg_deb -f $argument Recommends";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\ system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Recommends: \w*\""; $tar xOz control | $grep \"Recommends: \w*\"";
} }
@ -1443,11 +1446,11 @@ sub deps {
print "$1\n"; print "$1\n";
} }
$title{$1}++; $title{$1}++;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Suggests: "; print "Suggests: ";
system "$dpkg_deb -f $argument Suggests"; system "$dpkg_deb -f $argument Suggests";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\ system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Suggests: \w*\""; $tar xOz control | $grep \"Suggests: \w*\"";
} }
@ -1458,11 +1461,11 @@ sub deps {
print "$1\n"; print "$1\n";
} }
$title{$1}++; $title{$1}++;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Provides: "; print "Provides: ";
system "$dpkg_deb -f $argument Provides"; system "$dpkg_deb -f $argument Provides";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\ system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Provides: \w*\""; $tar xOz control | $grep \"Provides: \w*\"";
} }
@ -1473,11 +1476,11 @@ sub deps {
print "$1\n"; print "$1\n";
} }
$title{$1}++; $title{$1}++;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Replaces: "; print "Replaces: ";
system "$dpkg_deb -f $argument Replaces"; system "$dpkg_deb -f $argument Replaces";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\ system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Replaces: \w*\""; $tar xOz control | $grep \"Replaces: \w*\"";
} }
@ -1488,11 +1491,11 @@ sub deps {
print "$1\n"; print "$1\n";
} }
$title{$1}++; $title{$1}++;
if (defined $dpkg_deb) { if ( $dpkg_deb) {
print "Conflicts: "; print "Conflicts: ";
system "$dpkg_deb -f $argument Conflicts"; system "$dpkg_deb -f $argument Conflicts";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\ system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Conflicts: \w*\""; $tar xOz control | $grep \"Conflicts: \w*\"";
} }
@ -1500,7 +1503,7 @@ sub deps {
} }
} }
elsif ($commands->{"T"}) { elsif ($commands->{"T"}) {
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Pre-Depends 2&> $tmp/fields.deb"; system "$dpkg_deb -f $argument Pre-Depends 2&> $tmp/fields.deb";
system "$dpkg_deb -f $argument Depends 2&> $tmp/temp.deb; \ system "$dpkg_deb -f $argument Depends 2&> $tmp/temp.deb; \
$cat $tmp/temp.deb >> $tmp/fields.deb;"; $cat $tmp/temp.deb >> $tmp/fields.deb;";
@ -1515,7 +1518,7 @@ sub deps {
system "$dpkg_deb -f $argument Conflicts 2&> $tmp/temp.deb; \ system "$dpkg_deb -f $argument Conflicts 2&> $tmp/temp.deb; \
$cat $tmp/temp.deb >> $tmp/fields.deb;"; $cat $tmp/temp.deb >> $tmp/fields.deb;";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep \"Pre-Depends: \w*\" > $tmp/fields.deb"; $grep \"Pre-Depends: \w*\" > $tmp/fields.deb";
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
@ -1558,7 +1561,7 @@ sub deps {
sub shbang { sub shbang {
# just one call needed here # just one call needed here
if (defined $dpkg_deb) { if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package 2&> $tmp/fields.deb"; system "$dpkg_deb -f $argument Package 2&> $tmp/fields.deb";
system "$dpkg_deb -f $argument Essential 2&> $tmp/temp.deb; \ system "$dpkg_deb -f $argument Essential 2&> $tmp/temp.deb; \
$cat $tmp/temp.deb >> $tmp/fields.deb;"; $cat $tmp/temp.deb >> $tmp/fields.deb;";
@ -1575,7 +1578,7 @@ sub shbang {
system "$dpkg_deb -f $argument Version 2&> $tmp/temp.deb; \ system "$dpkg_deb -f $argument Version 2&> $tmp/temp.deb; \
$cat $tmp/temp.deb >> $tmp/fields.deb"; $cat $tmp/temp.deb >> $tmp/fields.deb";
} }
elsif (defined $ar) { elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep \"Package: \w*\" > $tmp/fields.deb"; $grep \"Package: \w*\" > $tmp/fields.deb";
system "$ar -p $argument control.tar.gz | $tar xOz control |\ system "$ar -p $argument control.tar.gz | $tar xOz control |\
@ -1651,7 +1654,7 @@ sub package_processor {
my ($same, $different); my ($same, $different);
my ($vname, $gname, $priorname, $statusname); my ($vname, $gname, $priorname, $statusname);
chomp $version; chomp $version;
if (defined $section) { if ( $section) {
chomp $section; chomp $section;
} }
$col1 = "Package: $package[1]"; $col1 = "Package: $package[1]";
@ -1666,7 +1669,7 @@ sub package_processor {
# if statusindex is around we will check here, and in # if statusindex is around we will check here, and in
# nstatus* if the version is different, or the information # nstatus* if the version is different, or the information
# is unavailable. # is unavailable.
if (defined $pname) { if ( $pname) {
if (defined $sb{$pname}) { if (defined $sb{$pname}) {
($vname,$gname,$priorname,$statusname) = ($vname,$gname,$priorname,$statusname) =
split(/\s/,"$sb{$pname}",4); split(/\s/,"$sb{$pname}",4);
@ -1711,11 +1714,11 @@ sub package_processor {
} }
write STDOUT; write STDOUT;
# We will try to fill things in for Section: and Priority: # We will try to fill things in for Section: and Priority:
if (defined $section) { if ( $section) {
$col1 = $section; $col1 = $section;
} }
else { else {
if (defined $same) { if ( $same) {
if ($gname eq "unavailable") { if ($gname eq "unavailable") {
nsb(\%commands); nsb(\%commands);
if (defined $nsb{$pname}) { if (defined $nsb{$pname}) {
@ -1728,7 +1731,7 @@ sub package_processor {
$col1 = "Section: $gname"; $col1 = "Section: $gname";
} }
} }
elsif (defined $different) { elsif ( $different) {
# look first in available, and next in a specified Packages # look first in available, and next in a specified Packages
# file, we will also compare this to the existing Section, # file, we will also compare this to the existing Section,
# because this is known to change. # because this is known to change.
@ -1745,7 +1748,7 @@ sub package_processor {
else { else {
# This may be in available or Packages # This may be in available or Packages
nsb(\%commands); nsb(\%commands);
if (defined $pname) { if ( $pname) {
if (defined $nsb{$pname}) { if (defined $nsb{$pname}) {
my ($nvname,$ngname,$npriorname) = my ($nvname,$ngname,$npriorname) =
split(/\s/,"$nsb{$pname}",3); split(/\s/,"$nsb{$pname}",3);
@ -1757,11 +1760,11 @@ sub package_processor {
} }
} }
} }
if (defined $priority) { if ( $priority) {
$col2 = $priority; $col2 = $priority;
} }
else { else {
if (defined $same ) { if ( $same ) {
if ($gname eq "unavailable") { if ($gname eq "unavailable") {
nsb(\%commands); nsb(\%commands);
if (defined $nsb{$pname}) { if (defined $nsb{$pname}) {
@ -1774,7 +1777,7 @@ sub package_processor {
$col2 = "Priority: $priorname\n"; $col2 = "Priority: $priorname\n";
} }
} }
elsif (defined $different) { elsif ( $different) {
# look first in available, and next in a specified Packages # look first in available, and next in a specified Packages
# file # file
nsb(\%commands); nsb(\%commands);
@ -1790,7 +1793,7 @@ sub package_processor {
else { else {
# This is not in available or Packages # This is not in available or Packages
nsb(\%commands); nsb(\%commands);
if (defined $pname) { if ( $pname) {
if (defined $nsb{$pname}) { if (defined $nsb{$pname}) {
my ($nvname,$ngname,$npriorname) = my ($nvname,$ngname,$npriorname) =
split(/\s/,"$nsb{$pname}",3); split(/\s/,"$nsb{$pname}",3);
@ -1806,7 +1809,7 @@ sub package_processor {
write STDOUT; write STDOUT;
#my $cool = $installed_size . $maintainer; #my $cool = $installed_size . $maintainer;
$col1 = $installed_size; $col1 = $installed_size;
if (defined $source) { if ( $source) {
$col2 = $source; $col2 = $source;
} }
else { else {
@ -1824,6 +1827,5 @@ sub package_processor {
} # end sub package_processor } # end sub package_processor
1; 1;

62
swim
View File

@ -784,13 +784,29 @@ sub command {
initndb(\%commands); initndb(\%commands);
} }
# Automatic rebuilding - assuming the first time # Automatic rebuilding - assuming the first time
if (!-f "$main::home$parent$library/status") { # Could test the db, too.
system "cp -fa $parent$library/status $main::home$parent$library";
my $dpkg_status = "$parent$library/status";
my $my_status = "$main::home$parent$library/status";
if (!-f $my_status) {
$commands{"check"} = 1;
require SWIM::DB;
SWIM::DB->import(qw(db));
db(\%commands);
require SWIM::DB_Init;
$commands{"rebuilddb"} = 1;
SWIM::DB_Init->import(qw(database));
database(\%commands);
system "cp -fa $dpkg_status $my_status";
} }
else { else {
if ( $no_rebuilddb == 0 ) { if ( $no_rebuilddb == 0 ) {
my $diff = `diff $parent$library/status $main::home$parent$library/status`; if ( (stat($dpkg_status))[9] != (stat($my_status))[9] ) {
my $diff = `diff $dpkg_status $my_status`;
if ( $diff ) { if ( $diff ) {
$commands{"check"} = 1; $commands{"check"} = 1;
require SWIM::DB; require SWIM::DB;
@ -802,11 +818,10 @@ sub command {
SWIM::DB_Init->import(qw(database)); SWIM::DB_Init->import(qw(database));
database(\%commands); database(\%commands);
system "cp -fa $parent$library/status $main::home$parent$library"; system "cp -fa $dpkg_status $my_status";
}
} }
} }
} }
@ -1699,15 +1714,13 @@ Usage: swim [--nopager -n]
swim {--search ? (--research || --refinesearch) <pattern(s)>} swim {--search ? (--research || --refinesearch) <pattern(s)>}
[-g] [-n] [--dbpath <dir>] [--root <dir>] [--no] [-g] [-n] [--dbpath <dir>] [--root <dir>] [--no]
[--arch <architecture>] [--dists <distribution>] [--arch <architecture>] [--dists <distribution>]
[--ftp ? --source | --source_only ? <[--diff]>] [-xyrz --remove ? <[--nz]>] [--stdin]
[-xyrz --remove ? <[--nz]>] [--stdin] [--apt2df] [--purge] [<\\d{1,}>]
[--df2apt] [--purge] [<\\d{1,}>]
swim {--powersearch --ps ? (--research || --refinesearch) <pattern(s)>} swim {--powersearch --ps ? (--research || --refinesearch) <pattern(s)>}
[-n] [--dir] [--dbpath <dir>] [--root <dir>] [--no] [-n] [--dir] [--dbpath <dir>] [--root <dir>] [--no]
[--arch <architecture>] [--dists <distribution>] [--arch <architecture>] [--dists <distribution>]
[--ftp ? --source | --source_only ? <[--diff]>] [-xyrz --remove ? <[--nz]>] [--stdin]
[-xyrz --remove ? <[--nz]>] [--stdin] [--apt2df] [--purge] [<\\d{1,}>]
[--df2apt] [--purge] [<\\d{1,}>]
swim {--query -q} [-afpgn --dir] [--total -t] [-i] [-l ? <[--df]>] swim {--query -q} [-afpgn --dir] [--total -t] [-i] [-l ? <[--df]>]
[-d] [-c] [--scripts] [--preinst] [--postinst] [-d] [-c] [--scripts] [--preinst] [--postinst]
[--prerm] [--postrm] [--config] [--templates] [--prerm] [--postrm] [--config] [--templates]
@ -1718,8 +1731,8 @@ Usage: swim [--nopager -n]
[--copyright] [--changelog] [--allgroups] [--copyright] [--changelog] [--allgroups]
[--arch <architecture>] [--dists <distribution>] [--arch <architecture>] [--dists <distribution>]
[--stdin] [--extract <ALL|archive|PWD!archive>] [--stdin] [--extract <ALL|archive|PWD!archive>]
[-xyrz --remove ? <[--nz]>] [--purge] [--apt2df] [-xyrz --remove ? <[--nz]>] [--purge]
[--df2apt] [targets | -S ? <\\d{1,}>] [targets | -S ? <\\d{1,}>]
swim {--audit --status -C} swim {--audit --status -C}
swim {--apt} [--update] [--clean] [--autoclean] [--check] swim {--apt} [--update] [--clean] [--autoclean] [--check]
swim {--apt} [-xyz] [--upgrade] [--dist_upgrade] swim {--apt} [-xyz] [--upgrade] [--dist_upgrade]
@ -1773,15 +1786,13 @@ Usage: swim [--nopager -n]
swim {--search ? (--research || --refinesearch) <pattern(s)>} swim {--search ? (--research || --refinesearch) <pattern(s)>}
[-g] [-n] [--dbpath <dir>] [--root <dir>] [--no] [-g] [-n] [--dbpath <dir>] [--root <dir>] [--no]
[--arch <architecture>] [--dists <distribution>] [--arch <architecture>] [--dists <distribution>]
[--ftp ? --source | --source_only ? <[--diff]>] [-xyrz --remove ? <[--nz]>] [--stdin]
[-xyrz --remove ? <[--nz]>] [--stdin] [--apt2df] [--purge] [<\\d{1,}>]
[--df2apt] [--purge] [<\\d{1,}>]
swim {--powersearch --ps ? (--research || --refinesearch) <pattern(s)>} swim {--powersearch --ps ? (--research || --refinesearch) <pattern(s)>}
[-n] [--dir] [--dbpath <dir>] [--root <dir>] [--no] [-n] [--dir] [--dbpath <dir>] [--root <dir>] [--no]
[--arch <architecture>] [--dists <distribution>] [--arch <architecture>] [--dists <distribution>]
[--ftp ? --source | --source_only <[--diff]>] [-xyrz --remove ? <[--nz]>] [--stdin]
[-xyrz --remove ? <[--nz]>] [--stdin] [--apt2df] [--purge] [<\\d{1,}>]
[--df2apt] [--purge] [<\\d{1,}>]
swim {--query -q} [-afpgn --dir] [--total -t] [-i] [-l ? <[--df]>] swim {--query -q} [-afpgn --dir] [--total -t] [-i] [-l ? <[--df]>]
[-d] [-c] [--scripts] [--preinst] [--postinst] [-d] [-c] [--scripts] [--preinst] [--postinst]
[--prerm] [--postrm] [--config] [--templates] [--prerm] [--postrm] [--config] [--templates]
@ -1792,8 +1803,8 @@ Usage: swim [--nopager -n]
[--copyright] [--changelog] [--allgroups] [--copyright] [--changelog] [--allgroups]
[--arch <architecture>] [--dists <distribution>] [--arch <architecture>] [--dists <distribution>]
[--stdin] [--extract <ALL|archive|PWD!archive>] [--stdin] [--extract <ALL|archive|PWD!archive>]
[-xyrz --remove ? <[--nz]>] [--purge] [--apt2df] [-xyrz --remove ? <[--nz]>] [--purge]
[--df2apt] [targets | -S ? <\\d{1,}>] [targets | -S ? <\\d{1,}>]
swim {--audit --status -C} swim {--audit --status -C}
swim {--apt} [--update] [--clean] [--autoclean] [--check] swim {--apt} [--update] [--clean] [--autoclean] [--check]
swim {--apt} [-xyz] [--upgrade] [--dist_upgrade] swim {--apt} [-xyz] [--upgrade] [--dist_upgrade]
@ -1902,8 +1913,6 @@ usage:
--remove --remove
-r - remove the installed package, but not the -r - remove the installed package, but not the
package's configuration files package's configuration files
--apt2df - not implemented
--df2apt - not implemented
Editing Option Editing Option
--stdin - allows readline editing capabilities when --stdin - allows readline editing capabilities when
used with virtual options used with virtual options
@ -1944,8 +1953,6 @@ usage:
--remove --remove
-r - remove the installed package, but not the -r - remove the installed package, but not the
package's configuration files package's configuration files
--apt2df - not implemented
--df2apt - not implemented
Editing Option Editing Option
--stdin - allows readline editing capabilities when --stdin - allows readline editing capabilities when
used with virtual options used with virtual options
@ -2023,7 +2030,6 @@ sub pager {
close PAGER; close PAGER;
} # end sub pager } # end sub pager
# Pulled this from *_pkg from the gbootroot project. # Pulled this from *_pkg from the gbootroot project.
sub home_builder { sub home_builder {
@ -2046,8 +2052,6 @@ sub home_builder {
} # end home_builder } # end home_builder
=pod =pod
# Will be returned someday when apt cache control is added. # Will be returned someday when apt cache control is added.