From 45e72c069afa78e2939d43f0a3cefe8012a93ba8 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 19 Oct 2016 15:26:00 +0100 Subject: Skip all posts when uploading a non finisher This will make uploads much faster by only running createrepo once per changed media, like genhdlist2. --- NEWS | 2 ++ lib/Iurt/Emi.pm | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index f41fd62..8869cea 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- emi: skip all posts for non finishers instead of hardcoding a list + 0.6.27 - emi: fix a bug where genhdlist2 was skipped when doing a secondary upload containing a noarch at the same time as some other uploads diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm index 9e326e1..9e98125 100644 --- a/lib/Iurt/Emi.pm +++ b/lib/Iurt/Emi.pm @@ -136,10 +136,14 @@ sub upload_prefix_in_media { return unless @packages; $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=$media $skip $target @packages &> $done$path/$youri_file"; + my $base_command = "/usr/bin/perl -I/usr/share/mga-youri-submit/lib /usr/share/mga-youri-submit/bin/youri-submit --config /etc/youri/submit-upload.conf"; + my $all_posts = `$base_command --list posts $target`; + $all_posts =~ s/\n/ /g; + $all_posts =~ s/(^| +)/ --skip-post /g; + $all_posts =~ s/--skip-post *$//; + my $skip = $o_finish ? "" : $all_posts; + my $command = "$base_command --verbose --define user=$user --define prefix=$prefix --define section=$media $skip $target @packages &> $done$path/$youri_file"; plog('DEBUG', "running $command"); if (!system($command)) { plog('INFO', "upload succeeded"); -- cgit v1.2.1