[patch] remove .upload files on re-build of a package
Hi,
this patch removes any old .upload files if a new .changes is created.
Any review comments are appreciated.
As this had been annoying me for long enough, I tend to commit the
patch unless there is a reason why not (or are better proposals).
Andi
diff --git a/lib/Buildd/Daemon.pm b/lib/Buildd/Daemon.pm
index 825eaad..f0139f1 100644
--- a/lib/Buildd/Daemon.pm
+++ b/lib/Buildd/Daemon.pm
@@ -692,13 +692,16 @@ sub move_to_upload {
$pkg_noepoch =~ s/_\d*:/_/;
my $changes_name = $pkg_noepoch . '_' . $arch . '.changes';
+ my $upload_name = $pkg_noepoch . '_' . $arch . '.upload';
$self->log("$pv is autosigned, moving to '$upload_dir'\n");
+ system sprintf('rm -f -- %s', $upload_name);
system sprintf('dcmd mv %s/build/%s %s/%s/',
$self->get_conf('HOME'),
$changes_name,
$self->get_conf('HOME'),
$dist_config->get('DUPLOAD_LOCAL_QUEUE_DIR'));
+ system sprintf('rm -f -- %s', $upload_name);
$self->log("$pv moved to '$upload_dir'\n");
}
diff --git a/lib/Buildd/Mail.pm b/lib/Buildd/Mail.pm
index cff1880..9741955 100644
--- a/lib/Buildd/Mail.pm
+++ b/lib/Buildd/Mail.pm
@@ -576,6 +576,7 @@ sub prepare_for_upload ($$) {
my $pkg_noep = $pkg;
$pkg_noep =~ s/_\d*:/_/;
my $changes_name = $pkg_noep . "_" . $changes_filename_arch . ".changes";
+ my $upload_name = $pkg_noep . "_" . $changes_filename_arch . ".upload";
for my $upload_dir (@upload_dirs) {
if (! -d $upload_dir &&!mkdir( $upload_dir, 0750 )) {
@@ -597,6 +598,7 @@ sub prepare_for_upload ($$) {
}
}
+ system("rm -f -- $upload_dir/$upload_name");
open( F, ">$upload_dir/$changes_name" );
print F $changes;
close( F );
Reply to: