mirror of
https://github.com/fspc/dswim.git
synced 2025-02-22 00:23:28 -05:00
Dswim updates when no db exist or status or a combination thereof.
This commit is contained in:
parent
3762885480
commit
f2c8510e31
@ -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
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…
x
Reference in New Issue
Block a user