},
'configuration' => {function => \&add_configuration,
},
+ 'suites' => {function => \&add_suites,
+ },
'logs' => {function => \&add_logs,
},
'help' => {function => sub {pod2usage({verbose => 2});}}
($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(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};
sub add_configuration {
my ($options,$opts,$p,$config,$argv) = @_;
+
+ my $s = db_connect($options);
+
+ # tags
+ # add all tags
+ # mark obsolete tags
+
+ # severities
+ my %sev_names;
+ my $order = 0;
+ for my $sev_name (@{$config{severities}}) {
+ # add all severitites
+ my $sev = $s->resultset('Severity')->find_or_create({severity => $sev_name});
+ # mark strong severities
+ if (grep {$_ eq $sev_name} @{$config{strong_severities}}) {
+ $sev->strong(1);
+ }
+ $sev->order($order);
+ $sev->update();
+ $order++;
+ $sev_names{$sev_name} = 1;
+ }
+ # mark obsolete severities
+ for my $sev ($s->resultset('Severity')->find()) {
+ next if exists $sev_names{$sev->severity()};
+ $sev->obsolete(1);
+ $sev->update();
+ }
+}
+
+sub add_suite {
+ my ($options,$opts,$p,$config,$argv) = @_;
+ # suites
+ die "add_suite is currently not implemented; modify suites manually using SQL."
}
sub add_logs {
die "failure while trying to load bug log $bug\n$@";
}
});
+}
+
+sub add_packages {
}