diff options
author | Olivier Blin <oblin@mandriva.com> | 2006-12-01 20:52:07 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2006-12-01 20:52:07 +0000 |
commit | b6b898a159b934805e846975244143a1b8854e73 (patch) | |
tree | 0d20d5a5ffc4e60aecfa36e9cf0c9e1f822d87e0 /iurt2 | |
parent | e97d4f976e252c2ee65ac76dc8b4b65962c964f3 (diff) | |
download | iurt-b6b898a159b934805e846975244143a1b8854e73.tar iurt-b6b898a159b934805e846975244143a1b8854e73.tar.gz iurt-b6b898a159b934805e846975244143a1b8854e73.tar.bz2 iurt-b6b898a159b934805e846975244143a1b8854e73.tar.xz iurt-b6b898a159b934805e846975244143a1b8854e73.zip |
curl is required for rpmmon to retrieve maintainership
Diffstat (limited to 'iurt2')
-rwxr-xr-x | iurt2 | 32 |
1 files changed, 26 insertions, 6 deletions
@@ -256,11 +256,20 @@ $run{todo} = []; open(my $LOG, ">&STDERR"); $run{LOG} = sub { print $LOG @_ }; -print "$program_name version $VERSION\n"; #plog_init($program_name, $LOG, $run{verbose}, 1); plog_init($program_name, $LOG, 7, 1); # CM: hardcoded for now, will fix ASAP + +# Display version information +# +(my $iurt_rev = '$Rev$') =~ s/.*: (\d+).*/$1/; +(my $iurt_aut = '$Author$') =~ s/.*: (..).*/$1/; +(my $iurt_dat = '$Date$') + =~ s/.*: ([\d-]* [\d:]*) .*/$1/; +plog("MSG", "This is iurt2 revision $iurt_rev-$iurt_aut ($iurt_dat)"); + + my $todo = parseCommandLine($program_name, \@ARGV, \@params); @ARGV and usage($program_name, \@params, "@ARGV, too many arguments"); foreach my $t (@$todo) { @@ -321,7 +330,8 @@ my %config_usage = ( 'rpm-build', 'rpm-mandriva-setup-build', 'sudo', - 'urpmi' + 'urpmi', + 'curl', ] }, cache_home => { @@ -466,6 +476,9 @@ if ($config->{local_spool}) { $local_spool = "$config->{local_upload}/iurt/$run{distro_tag}/$run{my_arch}/$run{media}/"; } +# Squash double slashes +$local_spool =~ y!/!!s; + plog('INFO', "local spool: $local_spool"); if (!-d "$local_spool/log") { plog('DEBUG', "creating local spool $local_spool"); @@ -677,7 +690,7 @@ do { my ($dir, $srpm, $status) = @{$run{todo}[$i]}; # CM: Set argv[0] (in the C sense) to something we can easily spot and - # understand when running ps + # understand in process list $0 = "Iurt: $run{distro_tag} $run{my_arch} $run{media} $srpm"; $status or next; @@ -736,8 +749,11 @@ retry: dump_status($local_spool, \%run); next; } + + (my $log_dirname = $srpm) =~ s/.*:(.*)\.src.rpm/$1/; + # only create the log dir for the new srpm - mkdir "$local_spool/log/$srpm"; + mkdir "$local_spool/log/$log_dirname"; plog("installing build dependencies"); my $path_srpm = "$chroot_tmp/home/$luser/rpm/SRPMS/"; @@ -761,12 +777,14 @@ retry: # No such file or directory # system("sudo chroot $chroot_tmp rm -rf /var/lib/rpm/__db* &> /dev/null"); system("$sudo chroot $chroot_tmp rpm --rebuilddb &> /dev/null"); + perform_command("$sudo chroot $chroot_tmp rpm -qa", \%run, $config, $cache, + logname => "rpm_qa", hash => "rpm_qa_$srpm", timeout => 60, debug_mail => $run{debug}, - log => "$local_spool/log/$srpm/"); # or next; As this failed quite often, do not stop + log => "$local_spool/log/$log_dirname/"); # or next; As this failed quite often, do not stop plog('NOTIFY', "Building $srpm"); my $command = "rpm --rebuild /home/$luser/rpm/SRPMS/$srpm"; if ($run{stop}) { @@ -774,16 +792,18 @@ retry: add_sudoers(\%run, $chroot_tmp, $luser); $command = "rpm -b$run{stop} /home/$luser/rpm/SPECS/$spec"; } + if (!perform_command(qq(TMP=/home/$luser/tmp/ $sudo chroot $chroot_tmp /bin/su $luser -c "$command"), \%run, $config, $cache, mail => $maintainer, error => "[REBUILD] $srpm from $run{distro_tag} does not build correctly on $run{my_arch}", + logname => "build", hash => "build_$srpm", timeout => 18000, srpm => $srpm, debug_mail => $run{debug}, cc => $cc, - log => "$local_spool/log/$srpm/", + log => "$local_spool/log/$log_dirname/", error_regexp => 'rror.*ailed|Bad exit status|RPM build error', callback => sub { my ($opt, $output) = @_; |