This adds the no_rebuilddb Configuration option, because changes in the

status are now first diffed, then if a change is found --db --check is ran,
and then --rebuilddb (100% stable).  This is nice for programs like make-debian-x11.
This commit is contained in:
freesource
2001-10-13 05:28:42 +00:00
parent 01c6d30354
commit a3fea33120
3 changed files with 43 additions and 1 deletions
+25
View File
@@ -784,6 +784,31 @@ sub command {
initndb(\%commands);
}
# Automatic rebuilding - assuming the first time
if (!-f "$main::home$parent$library/status") {
system "cp -fa $parent$library/status $main::home$parent$library";
}
else {
if ( $no_rebuilddb == 0 ) {
my $diff = `diff $parent$library/status $main::home$parent$library/status`;
if ( $diff ) {
$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 $parent$library/status $main::home$parent$library";
}
}
}
# *deb packages -p querys can be handled separately because they a particular to
# *debs.