mirror of
https://github.com/fspc/dswim.git
synced 2026-09-16 08:31:39 -04:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user