diff options
author | Florent Villard <warly@mandriva.com> | 2006-08-13 14:54:46 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-08-13 14:54:46 +0000 |
commit | 790d2219715e7a8026b4a18addbd08afb34ff51f (patch) | |
tree | 82ba900ff751e108d68a038b4d2fe39439847746 /emi | |
parent | 3fa256816a679d588d74621b16a9ded1ae7d9c8f (diff) | |
download | iurt-790d2219715e7a8026b4a18addbd08afb34ff51f.tar iurt-790d2219715e7a8026b4a18addbd08afb34ff51f.tar.gz iurt-790d2219715e7a8026b4a18addbd08afb34ff51f.tar.bz2 iurt-790d2219715e7a8026b4a18addbd08afb34ff51f.tar.xz iurt-790d2219715e7a8026b4a18addbd08afb34ff51f.zip |
call youri with the section defined; remove files when uploaded
Diffstat (limited to 'emi')
-rwxr-xr-x | emi | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -93,6 +93,7 @@ check_upload_tree(\%run, $done, $pkg_tree{$prefix}{path} = "/$f/$m/$s"; $pkg_tree{$prefix}{arch}{$arch} = 1; $pkg_tree{$prefix}{target} = $f; + $pkg_tree{$prefix}{section} = "$m/$s"; push @{$pkg_tree{$prefix}{srpms}}, $rpm if ($arch eq 'src'); push @{$pkg_tree{$prefix}{rpms}} , $rpm; } elsif ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*)\.done$/) { @@ -106,6 +107,7 @@ foreach my $prefix (keys %pkg_tree) { my $ok = 1; my $target = $pkg_tree{$prefix}{target}; my $path = $pkg_tree{$prefix}{path}; + my $section = $pkg_tree{$prefix}{section}; print {$run{LOG}} "$program_name: processing $prefix in $path\n"; my %missing; foreach my $mandatory_arch (@{$config->{mandatory_arch}}, 'src') { @@ -124,9 +126,10 @@ foreach my $prefix (keys %pkg_tree) { foreach my $rpm (@{$pkg_tree{$prefix}{rpms}}) { push @packages, "$done/$path/${prefix}_$rpm" } - my $command = "/usr/bin/sudo -H -u $config->{upload_user} /usr/bin/perl -I/usr/local/lib/perl/ /usr/local/bin/youri-upload --verbose --test --config /etc/youri/upload-queue.conf --define user=$user,prefix=$prefix $target @packages &> $done/$path/$prefix.youri"; + my $command = "/usr/bin/sudo -H -u $config->{upload_user} /usr/bin/perl -I/usr/local/lib/perl/ /usr/local/bin/youri-upload --verbose --config /etc/youri/upload-queue.conf --define user=$user --define prefix=$prefix --define section=$section $target @packages &> $done/$path/$prefix.youri"; print {$run{LOG}} "$program_name: running $command\n"; if (!system($command)) { + # now check if we need to keep the current srpm in todo my $all_uploaded = 1; foreach my $arch (@{$config->{arch}}) { if (!$cache->{arch}{$prefix}{$arch}) { @@ -134,11 +137,11 @@ foreach my $prefix (keys %pkg_tree) { } } if ($all_uploaded) { - print {$run{LOG}} "Cleaning upload tree for $prefix\n" + print {$run{LOG}} "Cleaning upload tree for $prefix\n"; } } else { # should send a mail or something - print {$run{LOG}} "$program_name: upload failed, rejecting files in $reject/$path/\n"; + print {$run{LOG}} "$program_name: upload failed ($!), rejecting files in $reject/$path/\n"; foreach my $rpm (@{$pkg_tree{$prefix}{rpms}}) { my $err = link "$done/$path/${prefix}_$rpm", "$reject/$path/${prefix}_$rpm"; print {$run{LOG}} "ERROR $program_name: link of $rpm failed ($!)\n" @@ -146,6 +149,9 @@ foreach my $prefix (keys %pkg_tree) { link "$done/$path/$prefix.youri", "$reject/$path/$prefix.youri" # should delete the files } + # delete the files which should have heen either put in queue or rejected + unlink $_ foreach @packages; + unlink $done/$path/$prefix.youri } else { print {$run{LOG}} "WARNING $program_name: mandatory arch (", join(' ', keys %missing),") are missing for $prefix, waiting\n" } |