Bug 2861

Summary: work with empty /proc
Product: Sisyphus Reporter: imz <vanyaz>
Component: hasherAssignee: Dmitry V. Levin <ldv>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 CC: at, glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   

Description imz 2003-08-20 12:12:40 MSD
/usr/share/hasher/initroot terminates too early when /proc is empty. This patch makes it work:

--- initroot.orig       2003-07-30 18:24:24 +0400
+++ initroot    2003-08-20 12:08:44 +0400
@@ -107,7 +107,7 @@
 gid2=\&quot;$(echo \&quot;$ugid2\&quot; |cut -d: -f2)\&quot;
 
 [ -n \&quot;$nprocs\&quot; ] ||
-       nprocs=\&quot;$(N=`egrep -cs ^cpu[0-9]+ /proc/stat`; [ \&quot;$N\&quot; -gt 0 ] 2&gt;/dev/null &amp;&amp; echo -n \&quot;$N\&quot; || echo 1)\&quot;
+       nprocs=\&quot;$(N=`egrep -cs ^cpu[0-9]+ /proc/stat ||:`; [ \&quot;$N\&quot; -gt 0 ] 2&gt;/dev/null &amp;&amp; echo -n \&quot;$N\&quot; || echo 1)\&quot;
 
 filelist=\&quot;$(print_uris setup filesystem rpm \'fakeroot&gt;=0:0.7.3\')\&quot; ||
        Fatal \&quot;failed to generate initial package file list.\&quot;

---

---
hasher-0.4-alt1
Comment 1 Dmitry V. Levin 2003-08-20 12:19:19 MSD
Thanks, fixed in upcoming release (0.5-alt1).
Comment 2 Dmitry V. Levin 2003-08-20 12:19:19 MSD
Thanks, fixed in upcoming release (0.5-alt1).