]> git.donarmstrong.com Git - debbugs.git/blobdiff - bin/debbugs-loadsql
handle quick bug loading by checking the database for the last modified time
[debbugs.git] / bin / debbugs-loadsql
index 8335c7d2f5e243a28aeb2cc01336b8c7a5434f72..2edcd1ec32f4c9fd4f74c948e7145f3ce0958b87 100755 (executable)
@@ -122,8 +122,8 @@ my %options =
 Getopt::Long::Configure('pass_through');
 GetOptions(\%options,
            'quick|q',
-           'service|s',
-           'sysconfdir|c',
+           'service|s=s',
+           'sysconfdir|c=s',
            'progress!',
            'spool_dir|spool-dir=s',
            'verbose|v+',
@@ -252,7 +252,10 @@ sub add_bugs {
                 print STDERR "Unable to stat $bug $!\n";
                 next;
             }
-            next if $stat->mtime < $time;
+            if ($options{quick}) {
+                my $rs = $s->resultset('Bug')->search({bug=>$bug})->single();
+                next if defined $rs and $stat->mtime < $rs->last_modified()->epoch();
+            }
             my $data = read_bug(bug => $bug,
                                 location => $initialdir);
             eval {