2017-03-29 Fred Gleason <fredg@paravelsystems.com>

* Modified rddbcheck(8) so as to process a --rehash command after
	the inexpensive checks.
This commit is contained in:
Fred Gleason
2017-03-29 14:30:08 -04:00
parent aeccd2600e
commit 4342ccd01e
3 changed files with 26 additions and 15 deletions

View File

@@ -174,14 +174,6 @@ MainObject::MainObject(QObject *parent)
delete q;
}
//
// Rehash
//
if(!rehash.isEmpty()) {
Rehash(rehash);
exit(0);
}
//
// Check for Orphaned Voice Tracks
//
@@ -248,6 +240,15 @@ MainObject::MainObject(QObject *parent)
ValidateAudioLengths();
printf("done.\n\n");
//
// Rehash
//
if(!rehash.isEmpty()) {
printf("Checking hashes...\n");
Rehash(rehash);
printf("done.\n\n");
}
exit(0);
}
@@ -505,7 +506,6 @@ void MainObject::CheckPendingCarts()
"(PENDING_STATION is not null)&&"+
"(PENDING_DATETIME<\""+now.addDays(-1).
toString("yyyy-MM-dd hh:mm:ss")+"\")";
printf("SQL: %s\n",(const char *)sql);
q=new QSqlQuery(sql);
while(q->next()) {
printf(" Cart %06u has stale reservation, delete cart(y/N)?",
@@ -764,7 +764,7 @@ void MainObject::RehashCut(const QString &cutnum)
else {
if(cut->sha1Hash()!=hash) {
RDCart *cart=new RDCart(RDCut::cartNumber(cutnum));
printf(" Cut %d [%s] in cart %06u [%s] has inconsistent SHA1 hash. Correct? (y/N) ",
printf(" Cut %d [%s] in cart %06u [%s] has inconsistent SHA1 hash. Fix? (y/N) ",
cut->cutNumber(),
(const char *)cut->description(),
cart->number(),