Browse Source

Adds the --enhances option.

master
freesource 23 years ago
parent
commit
b59992bff6
  1. 8
      SWIM/Ag.pm
  2. 8
      SWIM/DB.pm
  3. 9
      SWIM/DB_Init.pm
  4. 194
      SWIM/Deb.pm
  5. 90
      SWIM/Deps.pm
  6. 21
      SWIM/NDB.pm
  7. 19
      SWIM/NDB_Init.pm
  8. 4
      SWIM/Pn_print.pm

8
SWIM/Ag.pm

@ -179,7 +179,7 @@ sub q_description {
$commands->{"depends"} || $commands->{"pre_depends"} ||
$commands->{"recommends"} || $commands->{"suggests"} ||
$commands->{"conflicts"} || $commands->{"replaces"} ||
$commands->{"provides"};
$commands->{"provides"} || $commands->{"enhances"};
singular(\%commands);
character(\%commands);
shlibs(\%commands) if $commands->{"shlibs"};
@ -187,7 +187,7 @@ sub q_description {
$commands->{"depends"} || $commands->{"pre_depends"} ||
$commands->{"recommends"} || $commands->{"suggests"} ||
$commands->{"conflicts"} || $commands->{"replaces"} ||
$commands->{"provides"};
$commands->{"provides"} || $commands->{"enhances"};
}
else { print "package $argument is not installed\n"; }
}
@ -226,7 +226,7 @@ sub q_description {
$commands->{"depends"} || $commands->{"pre_depends"} ||
$commands->{"recommends"} || $commands->{"suggests"} ||
$commands->{"conflicts"} || $commands->{"replaces"} ||
$commands->{"provides"};
$commands->{"provides"} || $commands->{"enhances"};
singular(\%commands);
character(\%commands);
shlibs(\%commands) if $commands->{"shlibs"};
@ -234,7 +234,7 @@ sub q_description {
$commands->{"depends"} || $commands->{"pre_depends"} ||
$commands->{"recommends"} || $commands->{"suggests"} ||
$commands->{"conflicts"} || $commands->{"replaces"} ||
$commands->{"provides"};
$commands->{"provides"} || $commands->{"enhances"};
}
else { print "package $argument is not installed\n"; }
}

8
SWIM/DB.pm

@ -83,7 +83,7 @@ sub db {
# to save time over using status
my @status;
my ($replaces, $provides, $depends, $pre_depends, $recommends, $suggests,
$conflicts);
$conflicts, $enhances);
my (@conffiles,$line_before,@conf,@complete,@form,@formly);
my $format_deb = "$tmp/format.deb";
@ -644,6 +644,12 @@ sub db {
$ping->put("$package[1]SUG",$suggests);
}
}
elsif (/^Enhances:/) {
$enhances = $_;
if (defined($enhances)) {
$ping->put("$package[1]ENH",$enhances);
}
}
elsif (/^Conflicts:/) {
$conflicts = $_;
if (defined($conflicts)) {

9
SWIM/DB_Init.pm

@ -71,7 +71,7 @@ sub database {
my @status;
my ($replaces, @REPLACE, $provides, $depends, $pre_depends,
$recommends, $suggests, $conflicts);
$recommends, $suggests, $enhances, $conflicts);
my @conffiles;
my $line_before;
@ -400,6 +400,13 @@ sub database {
push(@REPLACE, $suggests);
}
}
elsif (/^Enhances:/) {
$enhances = $_;
if (defined($enhances)) {
push(@REPLACE, "$package[1]ENH");
push(@REPLACE, $enhances);
}
}
elsif (/^Conflicts:/) {
$conflicts = $_;
if (defined($conflicts)) {

194
SWIM/Deb.pm

@ -101,11 +101,21 @@ sub deb_package {
system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
}
if (!($commands->{"T"} || $commands->{"pre_depends"} ||
$commands->{"depends"} || $commands->{"recommends"} ||
$commands->{"suggests"} || $commands->{"provides"} ||
$commands->{"replaces"} || $commands->{"conflicts"} ||
$commands->{"c"} || $commands->{"l"})) {
if (
!($commands->{"T"} ||
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
$commands->{"c"} ||
$commands->{"l"})
) {
print "\n";
}
}
@ -190,12 +200,22 @@ sub deb_package {
system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
}
if (!($commands->{"T"} || $commands->{"pre_depends"} ||
$commands->{"depends"} || $commands->{"recommends"} ||
$commands->{"suggests"} || $commands->{"provides"} ||
$commands->{"replaces"} || $commands->{"conflicts"} ||
$commands->{"c"} || $commands->{"l"})) {
print "\n";
if (
!($commands->{"T"} ||
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
$commands->{"c"} ||
$commands->{"l"})
) {
print "\n";
}
}
shlibso(\%commands);
@ -269,12 +289,22 @@ sub deb_package {
system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
}
if (!($commands->{"T"} || $commands->{"pre_depends"} ||
$commands->{"depends"} || $commands->{"recommends"} ||
$commands->{"suggests"} || $commands->{"provides"} ||
$commands->{"replaces"} || $commands->{"conflicts"} ||
$commands->{"c"} || $commands->{"l"})) {
print "\n";
if (
!($commands->{"T"} ||
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
$commands->{"c"} ||
$commands->{"l"})
) {
print "\n";
}
}
shlibso(\%commands);
@ -352,12 +382,23 @@ sub deb_package {
system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep -E \"Description: \w*|[.]\$|^ [\w-]*\"";
}
if (!($commands->{"T"} || $commands->{"pre_depends"} ||
$commands->{"depends"} || $commands->{"recommends"} ||
$commands->{"suggests"} || $commands->{"provides"} ||
$commands->{"replaces"} || $commands->{"conflicts"} ||
$commands->{"c"} || $commands->{"l"})) {
print "\n";
if (
!($commands->{"T"} ||
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
$commands->{"c"} ||
$commands->{"l"})
) {
print "\n";
}
}
shlibso(\%commands);
@ -566,16 +607,38 @@ sub printme {
my ($commands) = @_; my %commands = %$commands;
if ($commands->{"p"} && !($commands->{"i"} || $commands->{"l"} ||
$commands->{"df"} || $commands->{"d"} || $commands->{"c"} ||
$commands->{"scripts"} || $commands->{"preinst"} || $commands->{"postinst"} ||
$commands->{"prerm"} || $commands->{"postrm"} || $commands->{"config"} || $commands->{"templates"} || $commands->{"T"} ||
$commands->{"pre_depends"} || $commands->{"depends"} ||
$commands->{"recommends"} || $commands->{"suggests"} ||
$commands->{"provides"} || $commands->{"replaces"} ||
$commands->{"conflicts"} || $commands->{"requires"} ||
$commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} ||
$commands->{"copyright"})) {
if (
$commands->{"p"} &&
!($commands->{"i"} ||
$commands->{"l"} ||
$commands->{"df"} ||
$commands->{"d"} ||
$commands->{"c"} ||
$commands->{"scripts"} ||
$commands->{"preinst"} ||
$commands->{"postinst"} ||
$commands->{"prerm"} ||
$commands->{"postrm"} ||
$commands->{"config"} ||
$commands->{"templates"} ||
$commands->{"T"} ||
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
$commands->{"requires"} ||
$commands->{"changelog"} ||
$commands->{"m"} ||
$commands->{"menu"} ||
$commands->{"copyright"})
) {
if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
}
@ -601,19 +664,41 @@ sub printme {
}
print "\n";
}
elsif ($commands->{"p"} && ($commands->{"l"} || $commands{"d"} ||
$commands{"c"})
&& !($commands->{"i"} || $commands->{"df"} ||
$commands->{"scripts"} || $commands->{"preinst"} || $commands->{"postinst"} ||
$commands->{"prerm"} || $commands->{"postrm"} || $commands->{"config"} || $commands->{"templates"} || $commands->{"T"} ||
$commands->{"pre_depends"} || $commands->{"depends"} ||
$commands->{"recommends"} || $commands->{"suggests"} ||
$commands->{"provides"} || $commands->{"replaces"} ||
$commands->{"conflicts"} || $commands->{"requires"} ||
$commands->{"changelog"} || $commands->{"m"} || $commands->{"menu"} ||
$commands->{"copyright"})) {
elsif (
$commands->{"p"} &&
($commands->{"l"} ||
$commands{"d"} ||
$commands{"c"}) &&
!($commands->{"i"} ||
$commands->{"df"} ||
$commands->{"scripts"} ||
$commands->{"preinst"} ||
$commands->{"postinst"} ||
$commands->{"prerm"} ||
$commands->{"postrm"} ||
$commands->{"config"} ||
$commands->{"templates"} ||
$commands->{"T"} ||
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
$commands->{"requires"} ||
$commands->{"changelog"} ||
$commands->{"m"} ||
$commands->{"menu"} ||
$commands->{"copyright"})
) {
if ( $dpkg_deb) {
system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
system "$dpkg_deb -f $argument Package > $tmp/temp.deb";
}
elsif ( $ar) {
system "$ar -p $argument control.tar.gz | $tar Oxz |\
@ -1456,6 +1541,21 @@ sub deps {
}
print "\n";
}
if ($commands->{"enhances"}) {
if (!defined $title{$1}) {
print "$1\n";
}
$title{$1}++;
if ( $dpkg_deb) {
print "Enhances: ";
system "$dpkg_deb -f $argument Enhances";
}
elsif ( $ar) {
system "$ar -p $argument control.tar.gz |\
$tar xOz control | $grep \"Enhances: \w*\"";
}
print "\n";
}
if ($commands->{"provides"}) {
if (!defined $title{$1}) {
print "$1\n";
@ -1511,6 +1611,8 @@ sub deps {
$cat $tmp/temp.deb >> $tmp/fields.deb;";
system "$dpkg_deb -f $argument Suggests 2&> $tmp/temp.deb; \
$cat $tmp/temp.deb >> $tmp/fields.deb;";
system "$dpkg_deb -f $argument Enhances 2&> $tmp/temp.deb; \
$cat $tmp/temp.deb >> $tmp/fields.deb;";
system "$dpkg_deb -f $argument Provides 2&> $tmp/temp.deb; \
$cat $tmp/temp.deb >> $tmp/fields.deb;";
system "$dpkg_deb -f $argument Replaces 2&> $tmp/temp.deb; \
@ -1527,6 +1629,8 @@ sub deps {
$grep \"Recommends: \w*\" >> $tmp/fields.deb";
system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep \"Suggests: \w*\" >> $tmp/fields.deb";
system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep \"Enhances: \w*\" >> $tmp/fields.deb";
system "$ar -p $argument control.tar.gz | $tar xOz control |\
$grep \"Provides: \w*\" >> $tmp/fields.deb";
system "$ar -p $argument control.tar.gz | $tar xOz control |\

90
SWIM/Deps.pm

@ -116,6 +116,21 @@ sub suggests {
untie %db;
} # end sub suggests
sub enhances {
my ($commands) = @_;
my %commands = %$commands;
!$commands->{"n"} ? dbi(\%commands) : ndb(\%commands);
if (defined $argument) {
my $conf = $argument . "ENH";
if (defined $db{$conf}) {
return $db{$conf};
}
else { return ""; }
}
untie %db;
} # end sub enhances
# process the database for replaces
sub conflicts {
my ($commands) = @_;
@ -223,6 +238,20 @@ sub s_suggests {
untie %db;
} # end sub s_suggests
sub s_enhances {
my ($commands) = @_;
my %commands = %$commands;
!$commands->{"n"} ? dbi(\%commands) : ndb(\%commands);
if (defined $argument) {
my $conf = $argument . "ENH";
if (defined $db{$conf}) {
return "$argument\n$db{$conf}";
}
else { return ""; }
}
untie %db;
} # end sub s_enhances
# process the database for replaces
sub s_conflicts {
my ($commands) = @_;
@ -247,12 +276,25 @@ sub character {
my %commands = %$commands;
# for singular cases
if ($commands->{"g"} && ($commands->{"T"} || $commands->{"pre_depends"} ||
$commands->{"depends"} || $commands->{"recommends"} ||
$commands->{"suggests"} || $commands->{"provides"} ||
$commands->{"replaces"} || $commands->{"conflicts"}) &&
!($commands->{"c"} || $commands->{"d"} || $commands->{"l"} ||
$commands->{"i"})) {
if (
$commands->{"g"} &&
($commands->{"T"} ||
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"}) &&
!($commands->{"c"} ||
$commands->{"d"} ||
$commands->{"l"} ||
$commands->{"i"})
) {
print "$argument\n";
}
@ -262,6 +304,7 @@ sub character {
print depends(\%commands);
print recommends(\%commands);
print suggests(\%commands);
print enhances(\%commands);
print provides(\%commands);
print replaces(\%commands);
print conflicts(\%commands);
@ -288,6 +331,11 @@ sub character {
delete $commands{"suggests"} if !($commands->{"S"} || $commands->{"g"});
}
if (defined $commands->{"enhances"}) {
print enhances(\%commands);
delete $commands{"enhances"} if !($commands->{"S"} || $commands->{"g"});
}
if (defined $commands->{"replaces"}) {
print replaces(\%commands);
delete $commands{"replaces"} if !($commands->{"S"} || $commands->{"g"});
@ -342,6 +390,14 @@ sub s_character {
if (s_suggests(\%commands) ne "") {
character(\%commands);
}
# else { s_character(\%commands) }
}
elsif ($commands->{"enhances"}) {
print s_enhances(\%commands);
delete $commands{"enhances"};
if (s_enhances(\%commands) ne "") {
character(\%commands);
}
# else { s_character(\%commands) }
}
elsif ($commands->{"replaces"}) {
@ -375,6 +431,7 @@ sub s_character {
print s_depends(\%commands);
print s_recommends(\%commands);
print s_suggests(\%commands);
print s_enhances(\%commands);
print s_provides(\%commands);
print s_replaces(\%commands);
print s_conflicts(\%commands);
@ -387,10 +444,16 @@ sub s_character {
# helps to determine if character(\%commands) should be used
sub which_character {
my ($commands) = @_;
if ($commands->{"pre_depends"} || $commands->{"depends"} ||
$commands->{"recommends"} || $commands->{"suggests"} ||
$commands->{"replaces"} || $commands->{"provides"} ||
$commands->{"conflicts"}) {
if (
$commands->{"pre_depends"} ||
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"replaces"} ||
$commands->{"provides"} ||
$commands->{"conflicts"}
) {
return 1;
}
} # end sub which_character
@ -430,6 +493,13 @@ sub the_character {
else { return "ok"; }
}
if (defined $commands->{"enhances"}) {
if (enhances(\%commands) eq "") {
print "";
}
else { return "ok"; }
}
if (defined $commands->{"replaces"}) {
if (replaces(\%commands) eq "") {
print "";

21
SWIM/NDB.pm

@ -668,7 +668,7 @@ alternative directory and --dbpath and/or --root used.
my (%exacts,@package,$essential,$version,$maintainer,$things,
$priority,%group,$group,$section);
my ($pre_depends,$depends,$replaces,$provides,$recommends,
$suggests, $conflicts, @REPLACE);
$suggests, $enhances, $conflicts, @REPLACE);
my (@ldescription,@description,$installed_size,$source,$size,$status);
my $scount = 0; my $count = 0;
undef %equalizer;
@ -771,6 +771,15 @@ alternative directory and --dbpath and/or --root used.
push(@REPLACE, $suggests);
}
}
elsif (/^Enhances:/) {
$enhances = $_;
if (defined($enhances)) {
my $vion = substr($version,9);
my $nv = "$package[1]" . "_" . "$vion" . "ENH";
push(@REPLACE, "$nv");
push(@REPLACE, $enhances);
}
}
elsif (/^Conflicts:/) {
$conflicts = $_;
if (defined($conflicts)) {
@ -866,6 +875,11 @@ alternative directory and --dbpath and/or --root used.
#pop(@REPLACE); pop(@REPLACE);
undef $suggests;
}
if (defined $enhances) {
undef @REPLACE;
#pop(@REPLACE); pop(@REPLACE);
undef $enhances;
}
if (defined $conflicts) {
undef @REPLACE;
#pop(@REPLACE); pop(@REPLACE);
@ -1052,6 +1066,11 @@ alternative directory and --dbpath and/or --root used.
#pop(@REPLACE); pop(@REPLACE);
undef $suggests;
}
if (defined $enhances) {
undef @REPLACE;
#pop(@REPLACE); pop(@REPLACE);
undef $enhances;
}
if (defined $conflicts) {
undef @REPLACE;
#pop(@REPLACE); pop(@REPLACE);

19
SWIM/NDB_Init.pm

@ -1034,7 +1034,7 @@ sub not_installed {
my $scount = 0;
my ($pre_depends, $depends, $replaces, $provides, $recommends,
$suggests, $conflicts, @REPLACE);
$suggests, $enhances, $conflicts, @REPLACE);
my @conffiles;
my @conf;
@ -1479,6 +1479,15 @@ sub not_installed {
push(@REPLACE, $suggests);
}
}
elsif (/^Enhances:/) {
$enhances = $_;
if (defined($enhances)) {
my $vion = substr($version,9);
my $nv = "$package[1]" . "_" . "$vion" . "ENH";
push(@REPLACE, "$nv");
push(@REPLACE, $enhances);
}
}
elsif (/^Conflicts:/) {
$conflicts = $_;
if (defined($conflicts)) {
@ -1570,6 +1579,10 @@ sub not_installed {
pop(@REPLACE); pop(@REPLACE);
undef $suggests;
}
if (defined $enhances) {
pop(@REPLACE); pop(@REPLACE);
undef $enhances;
}
if (defined $conflicts) {
pop(@REPLACE); pop(@REPLACE);
undef $conflicts;
@ -1760,6 +1773,10 @@ sub not_installed {
pop(@REPLACE); pop(@REPLACE);
undef $suggests;
}
if (defined $enhances) {
pop(@REPLACE); pop(@REPLACE);
undef $enhances;
}
if (defined $conflicts) {
pop(@REPLACE); pop(@REPLACE);
undef $conflicts;

4
SWIM/Pn_print.pm

@ -57,6 +57,7 @@ sub singular {
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
@ -95,6 +96,7 @@ sub singular {
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
@ -133,6 +135,7 @@ sub singular {
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||
@ -171,6 +174,7 @@ sub singular {
$commands->{"depends"} ||
$commands->{"recommends"} ||
$commands->{"suggests"} ||
$commands->{"enhances"} ||
$commands->{"provides"} ||
$commands->{"replaces"} ||
$commands->{"conflicts"} ||

Loading…
Cancel
Save