]> git.donarmstrong.com Git - debbugs.git/commitdiff
add creation times for debinfo addition
authorDon Armstrong <don@donarmstrong.com>
Sun, 28 Feb 2016 23:38:00 +0000 (15:38 -0800)
committerDon Armstrong <don@donarmstrong.com>
Wed, 10 Aug 2016 20:45:41 +0000 (13:45 -0700)
bin/debbugs-loadsql

index f25e53c1296fb8d2325eb66041076b9672447acc..870f712ae01509e19aeab72fd627bae84afa66ed 100755 (executable)
@@ -323,8 +323,19 @@ sub add_debinfo {
                 ($binarch) = $file =~ /_([^\.]+)\.debinfo/;
             }
             my $sp = $s->resultset('SrcPkg')->find_or_create({pkg => $srcname});
+            # update the creation date if the data we have is earlier
+            my $ct_date = DateTime->from_epoch($f_stat->ctime);
+            if ($ct_date < $sp->creation) {
+                $sp->creation($ct_date);
+                $sp->last_modified(DateTime->now);
+                $sp->update;
+            }
             my $sv = $s->resultset('SrcVer')->find_or_create({src_pkg =>$sp->id(),
                                                               ver => $srcver});
+            if ($ct_date < $sv->upload_date()) {
+                $sv->upload_date($ct_date);
+                $sv->update;
+            }
             my $arch;
             if (defined $arch{$binarch}) {
                 $arch = $arch{$binarch};