aboutsummaryrefslogtreecommitdiffstats
path: root/emi
diff options
context:
space:
mode:
authorOlivier Blin <dev@blino.org>2015-11-17 01:36:55 +0100
committerOlivier Blin <dev@blino.org>2015-11-17 21:26:00 +0100
commit3080449bbea5bd0f939f10ce7074c85cdc352e41 (patch)
tree4074cdea5fa4ec8817240f7c9d0b89fab2e26ede /emi
parentdfd2c3cf46e77d85ff3a1b186dd5b15ad16ecb27 (diff)
downloadiurt-3080449bbea5bd0f939f10ce7074c85cdc352e41.tar
iurt-3080449bbea5bd0f939f10ce7074c85cdc352e41.tar.gz
iurt-3080449bbea5bd0f939f10ce7074c85cdc352e41.tar.bz2
iurt-3080449bbea5bd0f939f10ce7074c85cdc352e41.tar.xz
iurt-3080449bbea5bd0f939f10ce7074c85cdc352e41.zip
emi: Do not overwrite .youri file on subsequent uploads, use a timestamp suffix
Diffstat (limited to 'emi')
-rwxr-xr-xemi10
1 files changed, 7 insertions, 3 deletions
diff --git a/emi b/emi
index fa1d66e..84791a0 100755
--- a/emi
+++ b/emi
@@ -267,6 +267,10 @@ sub upload_prefix_in_section {
my (@packages, @duplicate_packages);
my ($user) = $prefix =~ /\d{14}\.(\w+)\.\w+\.\d+$/;
my $target = $pkg_tree{$prefix}{target};
+ my $youri_file = "$prefix.youri";
+ if ($uploaded{$prefix}{$section}) {
+ $youri_file .= "." . time();
+ }
my $path = $pkg_tree{$prefix}{section}{$section}{path};
@@ -289,7 +293,7 @@ sub upload_prefix_in_section {
$user ||= $config->{upload_user};
# FIXME we want to skip all post, we should not hardcode them here
my $skip = $o_finish ? "" : "--skip-post genhdlist2 --skip-post mirror --skip-post clean_rpmsrate";
- my $command = "/usr/bin/perl -I/usr/share/mga-youri-submit/lib /usr/share/mga-youri-submit/bin/youri-submit --verbose --config /etc/youri/submit-upload.conf --define user=$user --define prefix=$prefix --define section=$section $skip $target @packages &> $done/$path/$prefix.youri";
+ my $command = "/usr/bin/perl -I/usr/share/mga-youri-submit/lib /usr/share/mga-youri-submit/bin/youri-submit --verbose --config /etc/youri/submit-upload.conf --define user=$user --define prefix=$prefix --define section=$section $skip $target @packages &> $done/$path/$youri_file";
plog('DEBUG', "running $command");
if (!system($command)) {
@@ -301,7 +305,7 @@ sub upload_prefix_in_section {
foreach my $rpm (@{$pkg_tree{$prefix}{section}{$section}{rpms}}) {
link("$done/$path/${prefix}_$rpm", "$reject/$path/${prefix}_$rpm") or plog('ERROR', "ERROR: link of $rpm failed ($!)");
}
- link("$done/$path/$prefix.youri", "$reject/$path/$prefix.youri");
+ link("$done/$path/$youri_file", "$reject/$path/$youri_file");
my ($user) = $prefix =~ /\d{14}\.(\w+)\.\w+\.\d+/;
if ($user) {
@@ -309,7 +313,7 @@ sub upload_prefix_in_section {
my $text = join("\n", qq(The upload of the following packages failed:\n), map { "- $_" } @pkgs) . "\n";
my $rpms = join(' ', @pkgs, undef);
my $to = get_author_email($user) || "Unknown <$config->{admin}>";
- $text .= "\nUpload log available in $config->{http_queue}/rejected/$path/$prefix.youri\n";
+ $text .= "\nUpload log available in $config->{http_queue}/rejected/$path/$youri_file\n";
sendmail($to, undef, "Upload failed for $rpms", $text, "Emi the upload bot <$config->{admin}>", 0, $config);
}