From b6b898a159b934805e846975244143a1b8854e73 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 1 Dec 2006 20:52:07 +0000 Subject: curl is required for rpmmon to retrieve maintainership --- iurt2 | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/iurt2 b/iurt2 index cb6ef0b..630d567 100755 --- a/iurt2 +++ b/iurt2 @@ -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) = @_; -- cgit v1.2.1