Bug 2861 - work with empty /proc
: work with empty /proc
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/hasher)
: unstable
: all Linux
: P5 enhancement
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2003-08-20 12:12 by
Modified: 2003-08-25 15:18 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2003-08-20 12:12:40
/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=\"$(echo \"$ugid2\" |cut -d: -f2)\"

 [ -n \"$nprocs\" ] ||
-       nprocs=\"$(N=`egrep -cs ^cpu[0-9]+ /proc/stat`; [ \"$N\"
-gt 0 ] 2>/dev/null && echo -n \"$N\" || echo 1)\"
+       nprocs=\"$(N=`egrep -cs ^cpu[0-9]+ /proc/stat ||:`; [
\"$N\" -gt 0 ] 2>/dev/null && echo -n \"$N\" ||
echo 1)\"

 filelist=\"$(print_uris setup filesystem rpm
\'fakeroot>=0:0.7.3\')\" ||
        Fatal \"failed to generate initial package file list.\"

---

---
hasher-0.4-alt1
------- Comment #1 From 2003-08-20 12:19:19 -------
Thanks, fixed in upcoming release (0.5-alt1).
------- Comment #2 From 2003-08-20 12:19:19 -------
Thanks, fixed in upcoming release (0.5-alt1).