Browse Source

Dswim updates when no db exist or status or a combination thereof.

master
freesource 23 years ago
parent
commit
f2c8510e31
  1. 7
      SWIM/DB.pm
  2. 13
      swim

7
SWIM/DB.pm

@ -180,7 +180,7 @@ sub db {
}
}
else {
print "swim: missing important database\n"; exit;
print "swim: missing important database\n"; return "missing";
}
foreach (@GONE) {
@ -199,10 +199,13 @@ sub db {
my $new=$#NEW + 1; my $cr=$#changed_packages + 1;
my $ch=($#CHANGED + 1) - $cr; my $gon= $#GONE + 1;
if ($commands->{"check"}) {
print "\n TOTAL\n -----\n";
print "NEW $new\n"; print "GONE $gon\n";
print "CHANGED $ch\n"; print "CHANGED STATUS $cr\n"; exit;
print "CHANGED $ch\n"; print "CHANGED STATUS $cr\n";
return 1;
}
print "\n TOTAL\n -----\n";
print "NEW $new\n"; print "GONE $gon\n";

13
swim

@ -796,10 +796,17 @@ sub command {
SWIM::DB->import(qw(db));
db(\%commands);
require SWIM::DB_Init;
$commands{"rebuilddb"} = 1;
$commands{"initdb"} = 1;
SWIM::DB_Init->import(qw(database));
database(\%commands);
my $success_check = database(\%commands);
if ($success_check eq "rebuilddb") {
undef $commands{"initdb"};
$commands{"rebuilddb"} = 1;
SWIM::DB_Init->import(qw(database));
my $success_check = database(\%commands);
}
system "cp -fa $dpkg_status $my_status";
}

Loading…
Cancel
Save