diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
commit | 1be510f9529cb082f802408b472a77d074b394c0 (patch) | |
tree | b175f9d5fcb107576dabc768e7bd04d4a3e491a0 /zarb-ml/mageia-dev/2012-December/020708.html | |
parent | fa5098cf210b23ab4f419913e28af7b1b07dafb2 (diff) | |
download | archives-master.tar archives-master.tar.gz archives-master.tar.bz2 archives-master.tar.xz archives-master.zip |
Diffstat (limited to 'zarb-ml/mageia-dev/2012-December/020708.html')
-rw-r--r-- | zarb-ml/mageia-dev/2012-December/020708.html | 308 |
1 files changed, 308 insertions, 0 deletions
diff --git a/zarb-ml/mageia-dev/2012-December/020708.html b/zarb-ml/mageia-dev/2012-December/020708.html new file mode 100644 index 000000000..ebcc14514 --- /dev/null +++ b/zarb-ml/mageia-dev/2012-December/020708.html @@ -0,0 +1,308 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Mageia-dev] [soft-commits] [6663] para + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20%5Bsoft-commits%5D%20%5B6663%5D%20para&In-Reply-To=%3CCA%2BCX%2BbiTEPxCoHXk59NdeUZcTxfAxeUHoN17vdA9o3nWcHfD3A%40mail.gmail.com%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="020707.html"> + <LINK REL="Next" HREF="020717.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Mageia-dev] [soft-commits] [6663] para</H1> + <B>Pascal Terjan</B> + <A HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20%5Bsoft-commits%5D%20%5B6663%5D%20para&In-Reply-To=%3CCA%2BCX%2BbiTEPxCoHXk59NdeUZcTxfAxeUHoN17vdA9o3nWcHfD3A%40mail.gmail.com%3E" + TITLE="[Mageia-dev] [soft-commits] [6663] para">pterjan at gmail.com + </A><BR> + <I>Mon Dec 10 10:40:37 CET 2012</I> + <P><UL> + <LI>Previous message: <A HREF="020707.html">[Mageia-dev] [soft-commits] [6666] foo +</A></li> + <LI>Next message: <A HREF="020717.html">[Mageia-dev] problems with latest update +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#20708">[ date ]</a> + <a href="thread.html#20708">[ thread ]</a> + <a href="subject.html#20708">[ subject ]</a> + <a href="author.html#20708">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>On Mon, Dec 10, 2012 at 9:38 AM, <<A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">root at mageia.org</A>> wrote: +><i> Revision 6663 Author pterjan Date 2012-12-10 10:38:12 +0100 (Mon, 10 Dec +</I>><i> 2012) +</I>><i> +</I>><i> Log Message +</I>><i> +</I>><i> para +</I> +And this one did not get the one I changed in git, I will edit svn log :( + +><i> Modified Paths +</I>><i> +</I>><i> build_system/iurt/trunk/iurt +</I>><i> +</I>><i> Modified: build_system/iurt/trunk/iurt +</I>><i> =================================================================== +</I>><i> --- build_system/iurt/trunk/iurt 2012-12-10 03:38:14 UTC (rev 6662) +</I>><i> +++ build_system/iurt/trunk/iurt 2012-12-10 09:38:12 UTC (rev 6663) +</I>><i> @@ -173,6 +173,9 @@ +</I>><i> [ "", "concurrent-run", 0, "", +</I>><i> "Allow several iurt to run on different machines (slower)", +</I>><i> sub { $run{concurrent_run} = 1 }, "Activating concurrent run checks" ], +</I>><i> + [ "", "parallel", 1, "<n>", +</I>><i> + "Build up to <n> packages in parallel", +</I>><i> + sub {($run{parallel}) = @_; 1}, "Enabling parallel build" ], +</I>><i> [ "d", "dir", -1, "", +</I>><i> "Directory where to find packages to rebuild", +</I>><i> sub { $run{extra_dir} = \@_; 1 }, "Adding extra source packages +</I>><i> directories" ], +</I>><i> @@ -813,33 +816,16 @@ +</I>><i> #$SIG{INT} = $s; +</I>><i> $run{main} = 1; +</I>><i> +</I>><i> -my $rebuild; +</I>><i> -$run{group} = 0 if @{$run{todo}} == 1; +</I>><i> -if ($run{group}) { +</I>><i> - $rebuild = 1; +</I>><i> - $urpmi->set_local_media($local_spool); +</I>><i> - $urpmi->order_packages(\%provides, $luser) +</I>><i> - or die "FATAL $program_name: could not order packages"; +</I>><i> -} +</I>><i> -# +</I>><i> -# The build loop +</I>><i> -# +</I>><i> -my $prev_done = $done; +</I>><i> -do { +</I>><i> - $rebuild = 0; +</I>><i> - $done = $prev_done; +</I>><i> - my $i; +</I>><i> - for ($i; $i < @{$run{todo}}; $i++) { +</I>><i> - my ($dir, $srpm, $status) = @{$run{todo}[$i]}; +</I>><i> - +</I>><i> +sub rebuild_one { +</I>><i> + my ($dir, $srpm, $status) = @_; +</I>><i> # CM: Set argv[0] (in the C sense) to something we can easily spot and +</I>><i> # understand in process list +</I>><i> $0 = "Iurt: $run{distro_tag} $run{my_arch} $run{media} $srpm"; +</I>><i> +</I>><i> - $status or next; +</I>><i> - $done{$srpm} and next; +</I>><i> + $status or return; +</I>><i> + $done{$srpm} and return; +</I>><i> $done{$srpm} = 1; +</I>><i> - check_version(\%run, $srpm, \%srpm_version) or next; +</I>><i> + check_version(\%run, $srpm, \%srpm_version) or return; +</I>><i> if ($run{debug}) { $run{debug}++ == 2 and exit() } +</I>><i> $done++; +</I>><i> plog('NOTIFY', "Build package $srpm [$done/$to_compile]"); +</I>><i> @@ -849,7 +835,7 @@ +</I>><i> $run{status}{$srpm} = 'missing'; +</I>><i> dump_cache_par(\%run); +</I>><i> dump_status($local_spool, \%run); +</I>><i> - next; +</I>><i> + return; +</I>><i> } +</I>><i> # FIXME unfortunately urpmi stalls quite often +</I>><i> my $retry = 0; +</I>><i> @@ -864,14 +850,14 @@ +</I>><i> +</I>><i> if (!$run{use_old_chroot}) { +</I>><i> $chroot_tmp = create_temp_chroot(\%run, $config, +</I>><i> - $chroot_tmp, $chroot_ref) or next; +</I>><i> + $chroot_tmp, $chroot_ref) or return; +</I>><i> } +</I>><i> +</I>><i> if (!$urpmi->urpmi_command($chroot_tmp)) { +</I>><i> plog('DEBUG', "Creating chroot failed.\nCommand was: $chroot_tmp"); +</I>><i> - next; +</I>><i> + return; +</I>><i> } +</I>><i> - $srpm =~ /(.*)-[^-]+-[^-]+\.src\.rpm$/ or next; +</I>><i> + $srpm =~ /(.*)-[^-]+-[^-]+\.src\.rpm$/ or return; +</I>><i> my ($maintainer, $cc); +</I>><i> if (!$run{warn}) { +</I>><i> ($maintainer) = get_maint(\%run, $srpm); +</I>><i> @@ -885,7 +871,7 @@ +</I>><i> #($maintainer, $cc) = ($config->{admin},''); +</I>><i> +</I>><i> plog('DEBUG', "creating user $luser in chroot"); +</I>><i> - add_local_user($chroot_tmp, \%run, $config, $luser, $run{uid}) or next; +</I>><i> + add_local_user($chroot_tmp, \%run, $config, $luser, $run{uid}) or return; +</I>><i> +</I>><i> my $old_srpm = $srpm; +</I>><i> my ($ret, $spec); +</I>><i> @@ -908,7 +894,7 @@ +</I>><i> $run{status}{$srpm} = 'recreate_srpm_failure'; +</I>><i> dump_cache_par(\%run); +</I>><i> dump_status($local_spool, \%run); +</I>><i> - next; +</I>><i> + return; +</I>><i> } +</I>><i> +</I>><i> (my $log_dirname = $srpm) =~ s/.*:(.*)\.src.rpm/$1/; +</I>><i> @@ -928,7 +914,7 @@ +</I>><i> my $ok = $urpmi->install_packages($srpm, $chroot_tmp, $local_spool, +</I>><i> \%pack_provide, 'install_deps', "[REBUILD] install of build dependencies of +</I>><i> $srpm failed on $run{my_arch}", { maintainer => $maintainer }, +</I>><i> "$path_srpm/$srpm"); +</I>><i> if (!$ok) { +</I>><i> $run{status}{$srpm} ||= 'install_deps_failure'; +</I>><i> - next; +</I>><i> + return; +</I>><i> } +</I>><i> +</I>><i> # try to workarround the rpm -qa db4 error(2) from dbcursor->c_get: +</I>><i> @@ -1009,7 +995,7 @@ +</I>><i> # 20060615 +</I>><i> dump_cache_par(\%run); +</I>><i> dump_status($local_spool, \%run); +</I>><i> - next; +</I>><i> + return; +</I>><i> } +</I>><i> +</I>><i> # do some cleaning if the compilation is successful +</I>><i> @@ -1019,7 +1005,7 @@ +</I>><i> opendir my $binfh, "$chroot_tmp/home/$luser/rpmbuild/RPMS/"; +</I>><i> my @packages; +</I>><i> foreach my $bindir (readdir $binfh) { +</I>><i> - -d "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir" or next; +</I>><i> + -d "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir" or return; +</I>><i> opendir my $rpmfh, "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir"; +</I>><i> push @packages, map { +</I>><i> "$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir/$_" } grep { !/src\.rpm$/ && +</I>><i> /\.rpm$/ } readdir $rpmfh; +</I>><i> } +</I>><i> @@ -1028,7 +1014,7 @@ +</I>><i> # segfaulting when trying to install packages +</I>><i> +</I>><i> if ($config->{check_binary_file}) { +</I>><i> - $urpmi->install_packages($srpm, $chroot_tmp, $local_spool, +</I>><i> \%pack_provide, 'binary_test', "[REBUILD] binaries packages generated from +</I>><i> $srpm do not install correctly", { maintainer => $maintainer } <A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">, at packages</A>) +</I>><i> or next; +</I>><i> + $urpmi->install_packages($srpm, $chroot_tmp, $local_spool, +</I>><i> \%pack_provide, 'binary_test', "[REBUILD] binaries packages generated from +</I>><i> $srpm do not install correctly", { maintainer => $maintainer } <A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">, at packages</A>) +</I>><i> or return; +</I>><i> } else { +</I>><i> my $successfile = "$local_spool/log/$srpm/binary_test_$srpm-1.log"; +</I>><i> open my $f, ">$successfile"; +</I>><i> @@ -1066,7 +1052,64 @@ +</I>><i> dump_status($local_spool, \%run); +</I>><i> # dump_cache each time so that concurrent process can get updated +</I>><i> dump_cache_par(\%run) if $run{concurrent_run}; +</I>><i> + return 1; +</I>><i> +} +</I>><i> + +</I>><i> +my $rebuild; +</I>><i> +$run{group} = 0 if @{$run{todo}} == 1; +</I>><i> +if ($run{group}) { +</I>><i> + $rebuild = 1; +</I>><i> + $urpmi->set_local_media($local_spool); +</I>><i> + $urpmi->order_packages(\%provides, $luser) +</I>><i> + or die "FATAL $program_name: could not order packages"; +</I>><i> +} +</I>><i> +# +</I>><i> +# The build loop +</I>><i> +# +</I>><i> +my $prev_done = $done; +</I>><i> +do { +</I>><i> + $rebuild = 0; +</I>><i> + $done = $prev_done; +</I>><i> + my $i; +</I>><i> + my %children; +</I>><i> + for ($i; $i < @{$run{todo}}; $i++) { +</I>><i> + my ($dir, $srpm, $status) = @{$run{todo}[$i]}; +</I>><i> + if ($run{parallel}) { +</I>><i> + my $pid; +</I>><i> + # First cleanup all the finished ones +</I>><i> + do { +</I>><i> + $pid = waitpid(-1, WNOHANG); +</I>><i> + if ($pid > 0) { +</I>><i> + plog('INFO', "Child $pid has exited"); +</I>><i> + delete $children{$pid}; +</I>><i> + } +</I>><i> + } while $pid > 0; +</I>><i> + while (scalar keys %children >= $run{parallel}) { +</I>><i> + plog('INFO', "Too many children, waiting to fork more"); +</I>><i> + $pid = waitpid(-1, 0); +</I>><i> + delete $children{$pid} if $pid > 0; +</I>><i> + } +</I>><i> + my $pid = fork; +</I>><i> + if ($pid) { #parent +</I>><i> + $children{$pid} = 1; +</I>><i> + } elsif ($pid == 0) { #child +</I>><i> + $chroot_tmp .= "_" . int($i); +</I>><i> + rebuild_one($dir, $srpm, $status); +</I>><i> + exit; +</I>><i> + } else { +</I>><i> + die "could not fork"; +</I>><i> + } +</I>><i> + } else { +</I>><i> + rebuild_one($dir, $srpm, $status); +</I>><i> + } +</I>><i> } +</I>><i> + if ($run{parallel}) { +</I>><i> + foreach my $pid (keys %children) { +</I>><i> + plog('INFO', "Waiting for process $pid to exit"); +</I>><i> + waitpid($pid, 0); +</I>><i> + delete $children{$pid}; +</I>><i> + } +</I>><i> + } +</I>><i> if ($run{group}) { +</I>><i> my $i; +</I>><i> for ($i; $i < @{$run{todo}}; $i++) { +</I>><i> +</I></PRE> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="020707.html">[Mageia-dev] [soft-commits] [6666] foo +</A></li> + <LI>Next message: <A HREF="020717.html">[Mageia-dev] problems with latest update +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#20708">[ date ]</a> + <a href="thread.html#20708">[ thread ]</a> + <a href="subject.html#20708">[ subject ]</a> + <a href="author.html#20708">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://www.mageia.org/mailman/listinfo/mageia-dev">More information about the Mageia-dev +mailing list</a><br> +</body></html> |