summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/2012-December/020708.html
blob: ebcc14514e8fa985a0aa26b0d1f9a403b7a889ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
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,  &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">root at mageia.org</A>&gt; wrote:
&gt;<i> Revision 6663 Author pterjan Date 2012-12-10 10:38:12 +0100 (Mon, 10 Dec
</I>&gt;<i> 2012)
</I>&gt;<i>
</I>&gt;<i> Log Message
</I>&gt;<i>
</I>&gt;<i> para
</I>
And this one did not get the one I changed in git, I will edit svn log :(

&gt;<i> Modified Paths
</I>&gt;<i>
</I>&gt;<i> build_system/iurt/trunk/iurt
</I>&gt;<i>
</I>&gt;<i> Modified: build_system/iurt/trunk/iurt
</I>&gt;<i> ===================================================================
</I>&gt;<i> --- build_system/iurt/trunk/iurt	2012-12-10 03:38:14 UTC (rev 6662)
</I>&gt;<i> +++ build_system/iurt/trunk/iurt	2012-12-10 09:38:12 UTC (rev 6663)
</I>&gt;<i> @@ -173,6 +173,9 @@
</I>&gt;<i>      [ &quot;&quot;, &quot;concurrent-run&quot;, 0, &quot;&quot;,
</I>&gt;<i>      &quot;Allow several iurt to run on different machines (slower)&quot;,
</I>&gt;<i>      sub { $run{concurrent_run} = 1 }, &quot;Activating concurrent run checks&quot; ],
</I>&gt;<i> +    [ &quot;&quot;, &quot;parallel&quot;, 1, &quot;&lt;n&gt;&quot;,
</I>&gt;<i> +    &quot;Build up to &lt;n&gt; packages in parallel&quot;,
</I>&gt;<i> +    sub {($run{parallel}) = @_; 1}, &quot;Enabling parallel build&quot; ],
</I>&gt;<i>      [ &quot;d&quot;, &quot;dir&quot;, -1, &quot;&quot;,
</I>&gt;<i>      &quot;Directory where to find packages to rebuild&quot;,
</I>&gt;<i>      sub { $run{extra_dir} = \@_; 1 }, &quot;Adding extra source packages
</I>&gt;<i> directories&quot; ],
</I>&gt;<i> @@ -813,33 +816,16 @@
</I>&gt;<i>  #$SIG{INT} = $s;
</I>&gt;<i>  $run{main} = 1;
</I>&gt;<i>
</I>&gt;<i> -my $rebuild;
</I>&gt;<i> -$run{group} = 0 if @{$run{todo}} == 1;
</I>&gt;<i> -if ($run{group}) {
</I>&gt;<i> -    $rebuild = 1;
</I>&gt;<i> -    $urpmi-&gt;set_local_media($local_spool);
</I>&gt;<i> -    $urpmi-&gt;order_packages(\%provides, $luser)
</I>&gt;<i> -	or die &quot;FATAL $program_name: could not order packages&quot;;
</I>&gt;<i> -}
</I>&gt;<i> -#
</I>&gt;<i> -# The build loop
</I>&gt;<i> -#
</I>&gt;<i> -my $prev_done = $done;
</I>&gt;<i> -do {
</I>&gt;<i> -    $rebuild = 0;
</I>&gt;<i> -    $done = $prev_done;
</I>&gt;<i> -    my $i;
</I>&gt;<i> -    for ($i; $i &lt; @{$run{todo}}; $i++) {
</I>&gt;<i> -	my ($dir, $srpm, $status) = @{$run{todo}[$i]};
</I>&gt;<i> -	
</I>&gt;<i> +sub rebuild_one {
</I>&gt;<i> +	my ($dir, $srpm, $status) = @_;
</I>&gt;<i>  	# CM: Set argv[0] (in the C sense) to something we can easily spot and
</I>&gt;<i>  	#     understand in process list
</I>&gt;<i>  	$0 = &quot;Iurt: $run{distro_tag} $run{my_arch} $run{media} $srpm&quot;;
</I>&gt;<i>
</I>&gt;<i> -	$status or next;
</I>&gt;<i> -	$done{$srpm} and next;
</I>&gt;<i> +	$status or return;
</I>&gt;<i> +	$done{$srpm} and return;
</I>&gt;<i>  	$done{$srpm} = 1;
</I>&gt;<i> -	check_version(\%run, $srpm, \%srpm_version) or next;
</I>&gt;<i> +	check_version(\%run, $srpm, \%srpm_version) or return;
</I>&gt;<i>  	if ($run{debug}) { $run{debug}++ == 2 and exit() }
</I>&gt;<i>  	$done++;
</I>&gt;<i>  	plog('NOTIFY', &quot;Build package $srpm [$done/$to_compile]&quot;);
</I>&gt;<i> @@ -849,7 +835,7 @@
</I>&gt;<i>  	    $run{status}{$srpm} = 'missing';
</I>&gt;<i>  	    dump_cache_par(\%run);
</I>&gt;<i>  	    dump_status($local_spool, \%run);
</I>&gt;<i> -	    next;
</I>&gt;<i> +	    return;
</I>&gt;<i>  	}
</I>&gt;<i>  	# FIXME unfortunately urpmi stalls quite often
</I>&gt;<i>  	my $retry = 0;
</I>&gt;<i> @@ -864,14 +850,14 @@
</I>&gt;<i>  	
</I>&gt;<i>  	if (!$run{use_old_chroot}) {
</I>&gt;<i>  	    $chroot_tmp = create_temp_chroot(\%run, $config,
</I>&gt;<i> -		$chroot_tmp, $chroot_ref) or next;
</I>&gt;<i> +		$chroot_tmp, $chroot_ref) or return;
</I>&gt;<i>  	}
</I>&gt;<i>
</I>&gt;<i>  	if (!$urpmi-&gt;urpmi_command($chroot_tmp)) {
</I>&gt;<i>  	    plog('DEBUG', &quot;Creating chroot failed.\nCommand was: $chroot_tmp&quot;);
</I>&gt;<i> -	    next;
</I>&gt;<i> +	    return;
</I>&gt;<i>  	}
</I>&gt;<i> -	$srpm =~ /(.*)-[^-]+-[^-]+\.src\.rpm$/ or next;
</I>&gt;<i> +	$srpm =~ /(.*)-[^-]+-[^-]+\.src\.rpm$/ or return;
</I>&gt;<i>  	my ($maintainer, $cc);
</I>&gt;<i>  	if (!$run{warn}) {
</I>&gt;<i>  	    ($maintainer) = get_maint(\%run, $srpm);
</I>&gt;<i> @@ -885,7 +871,7 @@
</I>&gt;<i>  	#($maintainer, $cc) = ($config-&gt;{admin},'');
</I>&gt;<i>
</I>&gt;<i>  	plog('DEBUG', &quot;creating user $luser in chroot&quot;);
</I>&gt;<i> -	add_local_user($chroot_tmp, \%run, $config, $luser, $run{uid}) or next;
</I>&gt;<i> +	add_local_user($chroot_tmp, \%run, $config, $luser, $run{uid}) or return;
</I>&gt;<i>
</I>&gt;<i>  	my $old_srpm = $srpm;
</I>&gt;<i>  	my ($ret, $spec);
</I>&gt;<i> @@ -908,7 +894,7 @@
</I>&gt;<i>  	    $run{status}{$srpm} = 'recreate_srpm_failure';
</I>&gt;<i>  	    dump_cache_par(\%run);
</I>&gt;<i>  	    dump_status($local_spool, \%run);
</I>&gt;<i> -	    next;
</I>&gt;<i> +	    return;
</I>&gt;<i>  	}
</I>&gt;<i>
</I>&gt;<i>  	(my $log_dirname = $srpm) =~ s/.*:(.*)\.src.rpm/$1/;
</I>&gt;<i> @@ -928,7 +914,7 @@
</I>&gt;<i>  	my $ok = $urpmi-&gt;install_packages($srpm, $chroot_tmp, $local_spool,
</I>&gt;<i> \%pack_provide, 'install_deps', &quot;[REBUILD] install of build dependencies of
</I>&gt;<i> $srpm failed on $run{my_arch}&quot;, { maintainer =&gt; $maintainer },
</I>&gt;<i> &quot;$path_srpm/$srpm&quot;);
</I>&gt;<i>  	if (!$ok) {
</I>&gt;<i>  	    $run{status}{$srpm} ||= 'install_deps_failure';
</I>&gt;<i> -	    next;
</I>&gt;<i> +	    return;
</I>&gt;<i>  	}
</I>&gt;<i>
</I>&gt;<i>  	# try to workarround the rpm -qa db4 error(2) from dbcursor-&gt;c_get:
</I>&gt;<i> @@ -1009,7 +995,7 @@
</I>&gt;<i>  	    # 20060615
</I>&gt;<i>  	    dump_cache_par(\%run);
</I>&gt;<i>  	    dump_status($local_spool, \%run);
</I>&gt;<i> -	    next;
</I>&gt;<i> +	    return;
</I>&gt;<i>  	}
</I>&gt;<i>
</I>&gt;<i>  	# do some cleaning if the compilation is successful
</I>&gt;<i> @@ -1019,7 +1005,7 @@
</I>&gt;<i>  	opendir my $binfh, &quot;$chroot_tmp/home/$luser/rpmbuild/RPMS/&quot;;
</I>&gt;<i>  	my @packages;
</I>&gt;<i>  	foreach my $bindir (readdir $binfh) {
</I>&gt;<i> -	    -d &quot;$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir&quot; or next;
</I>&gt;<i> +	    -d &quot;$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir&quot; or return;
</I>&gt;<i>  	    opendir my $rpmfh, &quot;$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir&quot;;
</I>&gt;<i>  	    push @packages, map {
</I>&gt;<i> &quot;$chroot_tmp/home/$luser/rpmbuild/RPMS/$bindir/$_&quot; } grep { !/src\.rpm$/ &amp;&amp;
</I>&gt;<i> /\.rpm$/ } readdir $rpmfh;
</I>&gt;<i>  	}
</I>&gt;<i> @@ -1028,7 +1014,7 @@
</I>&gt;<i>  	# segfaulting when trying to install packages
</I>&gt;<i>
</I>&gt;<i>  	if ($config-&gt;{check_binary_file}) {
</I>&gt;<i> -	    $urpmi-&gt;install_packages($srpm, $chroot_tmp, $local_spool,
</I>&gt;<i> \%pack_provide, 'binary_test', &quot;[REBUILD] binaries packages generated from
</I>&gt;<i> $srpm do not install correctly&quot;, { maintainer =&gt; $maintainer } <A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">, at packages</A>)
</I>&gt;<i> or next;
</I>&gt;<i> +	    $urpmi-&gt;install_packages($srpm, $chroot_tmp, $local_spool,
</I>&gt;<i> \%pack_provide, 'binary_test', &quot;[REBUILD] binaries packages generated from
</I>&gt;<i> $srpm do not install correctly&quot;, { maintainer =&gt; $maintainer } <A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">, at packages</A>)
</I>&gt;<i> or return;
</I>&gt;<i>  	} else  {
</I>&gt;<i>  	    my $successfile = &quot;$local_spool/log/$srpm/binary_test_$srpm-1.log&quot;;
</I>&gt;<i>  	    open my $f, &quot;&gt;$successfile&quot;;
</I>&gt;<i> @@ -1066,7 +1052,64 @@
</I>&gt;<i>  	dump_status($local_spool, \%run);
</I>&gt;<i>  	# dump_cache each time so that concurrent process can get updated
</I>&gt;<i>  	dump_cache_par(\%run) if $run{concurrent_run};
</I>&gt;<i> +    return 1;
</I>&gt;<i> +}
</I>&gt;<i> +
</I>&gt;<i> +my $rebuild;
</I>&gt;<i> +$run{group} = 0 if @{$run{todo}} == 1;
</I>&gt;<i> +if ($run{group}) {
</I>&gt;<i> +    $rebuild = 1;
</I>&gt;<i> +    $urpmi-&gt;set_local_media($local_spool);
</I>&gt;<i> +    $urpmi-&gt;order_packages(\%provides, $luser)
</I>&gt;<i> +	or die &quot;FATAL $program_name: could not order packages&quot;;
</I>&gt;<i> +}	
</I>&gt;<i> +#
</I>&gt;<i> +# The build loop
</I>&gt;<i> +#
</I>&gt;<i> +my $prev_done = $done;
</I>&gt;<i> +do {
</I>&gt;<i> +    $rebuild = 0;
</I>&gt;<i> +    $done = $prev_done;
</I>&gt;<i> +    my $i;
</I>&gt;<i> +    my %children;
</I>&gt;<i> +    for ($i; $i &lt; @{$run{todo}}; $i++) {
</I>&gt;<i> +	my ($dir, $srpm, $status) = @{$run{todo}[$i]};
</I>&gt;<i> +	if ($run{parallel}) {
</I>&gt;<i> +	    my $pid;
</I>&gt;<i> +	    # First cleanup all the finished ones
</I>&gt;<i> +	    do {
</I>&gt;<i> +		$pid = waitpid(-1, WNOHANG);
</I>&gt;<i> +		if ($pid &gt; 0) {
</I>&gt;<i> +		    plog('INFO', &quot;Child $pid has exited&quot;);
</I>&gt;<i> +		    delete $children{$pid};
</I>&gt;<i> +	        }
</I>&gt;<i> +	    } while $pid &gt; 0;
</I>&gt;<i> +	    while (scalar keys %children &gt;= $run{parallel}) {
</I>&gt;<i> +		plog('INFO', &quot;Too many children, waiting to fork more&quot;);
</I>&gt;<i> +		$pid = waitpid(-1, 0);
</I>&gt;<i> +		delete $children{$pid} if $pid &gt; 0;
</I>&gt;<i> +	    }
</I>&gt;<i> +	    my $pid = fork;
</I>&gt;<i> +	    if ($pid) { #parent
</I>&gt;<i> +		$children{$pid} = 1;
</I>&gt;<i> +	    } elsif ($pid == 0) { #child
</I>&gt;<i> +		$chroot_tmp .= &quot;_&quot; . int($i);
</I>&gt;<i> +		rebuild_one($dir, $srpm, $status);
</I>&gt;<i> +		exit;
</I>&gt;<i> +	    } else {
</I>&gt;<i> +		die &quot;could not fork&quot;;
</I>&gt;<i> +	    }
</I>&gt;<i> +	} else {
</I>&gt;<i> +	    rebuild_one($dir, $srpm, $status);
</I>&gt;<i> +	}
</I>&gt;<i>      }
</I>&gt;<i> +    if ($run{parallel}) {
</I>&gt;<i> +	foreach my $pid (keys %children) {
</I>&gt;<i> +	    plog('INFO', &quot;Waiting for process $pid to exit&quot;);
</I>&gt;<i> +	    waitpid($pid, 0);
</I>&gt;<i> +	    delete $children{$pid};
</I>&gt;<i> +	}
</I>&gt;<i> +    }
</I>&gt;<i>      if ($run{group}) {
</I>&gt;<i>  	my $i;
</I>&gt;<i>  	for ($i; $i &lt; @{$run{todo}}; $i++) {
</I>&gt;<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>