Browse Source

Fixed most bugs, one related to purging still needs correction.

master
freesource 20 years ago
parent
commit
2956005281
  1. 41
      SWIM/DB.pm
  2. 12
      pkg/dpkg/changelog

41
SWIM/DB.pm

@ -107,19 +107,23 @@ sub db {
elsif (/^Status:/) {
chomp;
$status = substr($_,8);
# a test
#if ($status eq "purge ok not-installed") {
# if (defined $db{$package[1]}) {
# print "$db{$package[1]}\n";
# }
#}
# a test and now a solution
if ($status eq "purge ok not-installed") {
##########
# PURGED #
##########
if (defined $db{$package[1]}) {
#push(@gone,"$db{$package[1]}");
print "$db{$package[1]}\n";
}
}
}
# hold ok not-installed - may want to change this just to
# non-installed.
###########
# VERSION #
###########
elsif (/^Version:/ && $status !~ /not-installed/) {
elsif ( /^Version:/ && $status !~ /not-installed/ ) {
my $version = $_; chomp $version;
my $ver = m,Version:\s(.*),; my $statusname;
if (defined $sb{$package[1]}) {
@ -131,7 +135,7 @@ sub db {
########
if (defined $db{$package[1]}) {
push(@gone,"$package[1]_$1");
if ("$package[1]_$1" ne $db{$package[1]}) {
if ( "$package[1]_$1" ne $db{$package[1]} ) {
$compare{$package[1]} = "$package[1]_$1";
}
# Version remained the same, but status changed
@ -221,6 +225,7 @@ sub db {
untie %ib;
undef %ib;
# Going to be adding some stuff to nsearchindex.deb and ndirindex.deb
# so better remove any compressed versions if they exist
if (@GONE || @NEW) {
@ -329,8 +334,8 @@ sub db {
# files for *.list are in ./info/backup/*.list.bk. We will also have to
# deal with those rare cases that forget /. (smail 2.0v). We should remove
# this file as well as the packagename-conf.md5sums file below.
my $file = "$parent$base/info/backup/$_.list.bk";
my $md5sum_file = "$parent$base/info/$_-conf.md5sums";
my $file = "$main::home$parent$base/info/backup/$_.list.bk";
my $md5sum_file = "$main::home$parent$base/info/$_-conf.md5sums";
open(LIST,"$file");
while (<LIST>) {
chomp;
@ -355,7 +360,7 @@ sub db {
#######################
my $yit = (split(/\s/,$sb{$orig_argument}))[3];
if ($yit eq "deinstall:ok:config-files" ||
$yit eq "purge:ok:config-files") {
$yit eq "purge:ok:config-files" ) {
if (defined $ib{"/."}) {
my $status = ($ib{"/."} =~ s,$packname_version ,,);
if ($status eq "") {
@ -797,21 +802,23 @@ sub db {
# made, might as well use this. There is a possibility this can be
# used instead of fastswim for initial fileindex.deb.
my $package_name;
if (!-d "$parent$base/info/backup") {
mkdir("$parent$base/info/backup",0666);
if (!-d "$main::home$parent$base/info/backup") {
mkdir("$main::home$parent$base/info/backup",0666);
}
print STDERR "\n" if $#NEW != -1; $x = 1;
foreach $package_name (@NEW) {
open(FILENAME,"$parent$base/info/$package_name.list");
open(CP,">$parent$base/info/backup/$package_name.list.bk");
open(FILENAME,"$main::home$parent$base/info/$package_name.list");
open(CP,">$main::home$parent$base/info/backup/$package_name.list.bk");
if ( -e "$main::home$parent$base/info/$package_name.list" ) {
while (<FILENAME>) {
print CP $_;
}
}
close(FILENAME);
close(CP);
my $file = "$parent$base/info/backup/$package_name.list.bk";
my $file = "$main::home$parent$base/info/backup/$package_name.list.bk";
print STDERR "#$x"; print STDERR " N|C $package_name.list \r";
$x++;
open(LIST,"$file");
@ -865,7 +872,7 @@ sub db {
my $zit; my ($nit,$yit) = (split(/\s/,$sb{$package_name}))[0,3];
if ($yit eq "deinstall:ok:config-files" ||
$yit eq "purge:ok:config-files") {
$yit eq "purge:ok:config-files" ) {
($zit = $nit) =~ s,\+,\\\+,;
if ($ib{"/."} !~ m,$zit,) {
$ib{"/."} = $ib{"/."} . " $zit";

12
pkg/dpkg/changelog

@ -1,9 +1,19 @@
dswim (0.4.3-1) unstable; urgency=low
* Stricter checking in Perl 5.8 caused the db not to be built if
fastswim noticed non-existent files because this is considered a
fatal error. Removed the die function and now check for non-
existent files in fastswim, imswim also produced some related error
output that was fixed.
-- Jonathan Rosenbaum <freesource@freesoftwarepc.com> Wed, 5 Jan 2005 22:48:34 -0500
dswim (0.4.2-1) unstable; urgency=low
* Fixes error output caused by repetitive opts found by the recent
Getopt::Long. Rebuild db if you've updated to the newest DB_File.
-- Jonathan Rosenbaum <root@funhouse.domain.com> Wed, 6 Nov 2002 08:16:49 -0500
-- Jonathan Rosenbaum <freesource@users.sourceforge.net> Wed, 6 Nov 2002 08:16:49 -0500
dswim (0.4.1-1) unstable; urgency=low

Loading…
Cancel
Save