diff options
author | Florent Villard <warly@mandriva.com> | 2006-11-07 11:40:48 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-11-07 11:40:48 +0000 |
commit | 22804f1178489d4f59af7860c7f787c59750b955 (patch) | |
tree | cc66222c5756c651e4c45343978ecd1cfb6e0eda /emi | |
parent | a166fa810a83a67ef31cdfc59687c7c04bf368b9 (diff) | |
download | iurt-22804f1178489d4f59af7860c7f787c59750b955.tar iurt-22804f1178489d4f59af7860c7f787c59750b955.tar.gz iurt-22804f1178489d4f59af7860c7f787c59750b955.tar.bz2 iurt-22804f1178489d4f59af7860c7f787c59750b955.tar.xz iurt-22804f1178489d4f59af7860c7f787c59750b955.zip |
initialize plog for submodules
Diffstat (limited to 'emi')
-rwxr-xr-x | emi | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -32,12 +32,14 @@ use Iurt::Config qw(config_usage get_date config_init dump_cache init_cache get_ use Iurt::Process qw(check_pid); use Iurt::Mail qw(sendmail); use Iurt::File qw(check_upload_tree); +use Iurt::Util qw(plog_init plog); use Data::Dumper; my %run; my $program_name = 'emi'; $run{program_name} = $program_name; open(my $LOG, ">&STDERR"); +plog_init($program_name, $LOG); $run{LOG} = $LOG; my $HOME = $ENV{HOME}; @@ -118,6 +120,17 @@ check_upload_tree(\%run, $done, }, ); +check_upload_tree(\%run, $todo, + sub { + my ($todo, $f, $m, $s, $r) = @_; + if ($r =~ /(\d{14}\.\w+\.\w+\.\d+)_(.*\.([^.]+)\.rpm)$/) { + my ($prefix, $rpm, $arch) = ($1, $2, $3); + print {$run{LOG}} "$program_name: found todo rpm $rpm ($prefix)\n"; + push @{$pkg_tree{$prefix}{todo}}, $rpm + } + }, +); + foreach my $prefix (keys %pkg_tree) { my $ok = 1; my $target = $pkg_tree{$prefix}{target}; @@ -192,7 +205,8 @@ foreach my $prefix (keys %pkg_tree) { # keep the log file for debugging # unlink "$done/$path/$prefix.youri"; # unlink the sources rpm, other arch will be able to grab it into the repository - unlink "$todo/$path/${prefix}_$_" foreach @{$pkg_tree{$prefix}{srpms}} + print "unlink $todo/$path/${prefix}_$_\n" foreach @{$pkg_tree{$prefix}{todo}}; + unlink "$todo/$path/${prefix}_$_" foreach @{$pkg_tree{$prefix}{todo}} } else { print {$run{LOG}} "WARNING $program_name: mandatory arch (", join(' ', keys %missing),") are missing for $prefix, waiting\n" } |