mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-21 22:30:59 +02:00
s-l-r: actually include the new patch
This commit is contained in:
parent
36fd21af13
commit
6443e4a0af
1 changed files with 42 additions and 0 deletions
42
app-portage/smart-live-rebuild/files/four.patch
Normal file
42
app-portage/smart-live-rebuild/files/four.patch
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
diff --git a/smartliverebuild/core.py b/smartliverebuild/core.py
|
||||
index e367111..f213c66 100644
|
||||
--- a/smartliverebuild/core.py
|
||||
+++ b/smartliverebuild/core.py
|
||||
@@ -22,6 +22,7 @@ def SmartLiveRebuild(opts, pm, cliargs = None):
|
||||
out.err('The argument to --jobs option must be a positive integer.')
|
||||
raise SLRFailure('')
|
||||
|
||||
+ global childpid
|
||||
childpid = None
|
||||
commpipe = None
|
||||
superuser = (os.geteuid() == 0)
|
||||
@@ -31,9 +32,18 @@ def SmartLiveRebuild(opts, pm, cliargs = None):
|
||||
portage_gid = pm_conf.userpriv_gid
|
||||
if portage_uid and portage_gid:
|
||||
if superuser:
|
||||
+ def chld_handler(sig, frame):
|
||||
+ global childpid
|
||||
+ if os.wait()[0] == childpid:
|
||||
+ childpid = None
|
||||
+
|
||||
out.s1('Forking to drop superuser privileges ...')
|
||||
+ old_chld = signal.signal(signal.SIGCHLD, chld_handler)
|
||||
commpipe = os.pipe()
|
||||
childpid = os.fork()
|
||||
+
|
||||
+ if childpid == 0:
|
||||
+ signal.signal(signal.SIGCHLD, old_chld)
|
||||
else:
|
||||
out.err("setuid requested but there's no 'portage' user in the system")
|
||||
return 1
|
||||
@@ -180,9 +190,6 @@ option.
|
||||
out.result('Found %s%d%s packages to rebuild.' % (out.white, len(packages), out.s1reset))
|
||||
finally:
|
||||
if childpid: # make sure that we leave no orphans
|
||||
- try:
|
||||
- os.kill(childpid, signal.SIGTERM)
|
||||
- except OSError:
|
||||
- pass
|
||||
+ os.kill(childpid, signal.SIGTERM)
|
||||
|
||||
return packages
|
||||
Loading…
Reference in a new issue