diff options
Diffstat (limited to 'emi')
-rwxr-xr-x | emi | 30 |
1 files changed, 7 insertions, 23 deletions
@@ -20,11 +20,6 @@ # # upload packages in queue when all the mandatory architectures are done # -# TODO -# -# - take the packages in done/ and upload them with youri in queue/ -# - check that the mandatory architectures are present -# # PREFIX : sprintf "$year%02d%02d%02d%02d%02d.$user.$host.${$}_", $mon, $mday, $hour, $min, $sec; use strict; @@ -32,8 +27,8 @@ use Iurt::Config qw(config_usage config_init); use Iurt::Process qw(check_pid); use Iurt::Queue qw(get_upload_tree_state); use Iurt::Util qw(plog_init plog); -use Iurt::Emi qw(find_prefixes_ready_to_upload upload_prefix_in_media); -use MDK::Common qw(cat_ touch); +use Iurt::Emi qw(find_prefixes_ready_to_upload record_uploaded_packages upload_prefix_in_media); +use MDK::Common qw(cat_); my %run; my $program_name = 'emi'; @@ -86,22 +81,10 @@ my %config_usage = ( desc => "Temporary directory", default => "$HOME/tmp" }, - root => { - desc => 'Architecture root dir', - default => "/mnt/BIG/dis/" - }, - upload_user => { - desc => 'User who is uploading packages', - default => 'mandrake' - }, queue => { desc => 'root directory of the various upload queues', default => "$HOME/uploads" }, - ssh_option => { - desc => "SSH options", - default => "-o ConectTimeout=20" - }, ); config_usage(\%config_usage, $config) if $run{config_usage}; @@ -109,7 +92,7 @@ config_init(\%config_usage, $config, \%run); $run{pidfile_home} = $config->{tmp}; $run{pidfile} = "upload"; -my $pidfile = check_pid(\%run); +my $pidfile = check_pid(\%run, 1); my $todo = "$config->{queue}/todo"; my $done = "$config->{queue}/done"; @@ -136,10 +119,11 @@ foreach my $target (keys %targets) { upload_prefix_in_media($config, \%pkg_tree, $prefix, $media, 1); } + # Now that the finishers are done, metadata was updated so the packages are available foreach my $prefix (@{$targets{$target}{$media}{to_upload}}) { - my $path = $pkg_tree{$prefix}{media}{$media}{path}; - touch("$done/$path/$prefix.upload") unless -f "$reject/$path/$prefix.youri"; - } + my $path = $pkg_tree{$prefix}{media}{$media}{path}; + record_uploaded_packages($config, \%pkg_tree, $prefix, $media) unless -f "$reject/$path/$prefix.youri";; + } } } |