1 |
Author: zmedico |
2 |
Date: 2009-07-30 21:29:45 +0000 (Thu, 30 Jul 2009) |
3 |
New Revision: 13861 |
4 |
|
5 |
Modified: |
6 |
main/trunk/bin/ebuild.sh |
7 |
Log: |
8 |
Move the setsid code (from bug #278895) as early as possible. |
9 |
|
10 |
|
11 |
Modified: main/trunk/bin/ebuild.sh |
12 |
=================================================================== |
13 |
--- main/trunk/bin/ebuild.sh 2009-07-30 20:59:09 UTC (rev 13860) |
14 |
+++ main/trunk/bin/ebuild.sh 2009-07-30 21:29:45 UTC (rev 13861) |
15 |
@@ -18,6 +18,23 @@ |
16 |
unset PORTAGE_ROOTPATH |
17 |
fi |
18 |
|
19 |
+ROOTPATH=${ROOTPATH##:} |
20 |
+ROOTPATH=${ROOTPATH%%:} |
21 |
+PREROOTPATH=${PREROOTPATH##:} |
22 |
+PREROOTPATH=${PREROOTPATH%%:} |
23 |
+PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin${ROOTPATH:+:}$ROOTPATH |
24 |
+export PATH |
25 |
+ |
26 |
+if [[ -z $PORTAGE_SETSID && -n $1 && $1 != depend ]] ; then |
27 |
+ if type -P setsid >/dev/null ; then |
28 |
+ # Use setsid to create a new login session so that we can use SIGHUP |
29 |
+ # to ensure that no orphaned subprocesses are left running. |
30 |
+ export PORTAGE_SETSID=1 |
31 |
+ exec setsid "$PORTAGE_BIN_PATH/ebuild.sh" "$@" |
32 |
+ fi |
33 |
+fi |
34 |
+[[ $PORTAGE_SETSID = 1 ]] && trap 'trap : SIGHUP ; kill -s SIGHUP 0 ;' EXIT |
35 |
+ |
36 |
# These two functions wrap sourcing and calling respectively. At present they |
37 |
# perform a qa check to make sure eclasses and ebuilds and profiles don't mess |
38 |
# with shell opts (shopts). Ebuilds/eclasses changing shopts should reset them |
39 |
@@ -64,24 +81,6 @@ |
40 |
# Unset some variables that break things. |
41 |
unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE |
42 |
|
43 |
-ROOTPATH=${ROOTPATH##:} |
44 |
-ROOTPATH=${ROOTPATH%%:} |
45 |
-PREROOTPATH=${PREROOTPATH##:} |
46 |
-PREROOTPATH=${PREROOTPATH%%:} |
47 |
-PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin${ROOTPATH:+:}$ROOTPATH |
48 |
-export PATH |
49 |
- |
50 |
-if [[ -z $PORTAGE_SETSID && \ |
51 |
- -n $EBUILD_SH_ARGS && $EBUILD_SH_ARGS != depend ]] ; then |
52 |
- if type -P setsid >/dev/null ; then |
53 |
- # Use setsid to create a new login session so that we can use SIGHUP |
54 |
- # to ensure that no orphaned subprocesses are left running. |
55 |
- export PORTAGE_SETSID=1 |
56 |
- exec setsid "$PORTAGE_BIN_PATH/ebuild.sh" $EBUILD_SH_ARGS |
57 |
- fi |
58 |
-fi |
59 |
-trap '[[ $PORTAGE_SETSID = 1 ]] && { trap : SIGHUP ; kill -s SIGHUP 0 ; }' EXIT |
60 |
- |
61 |
source "${PORTAGE_BIN_PATH}/isolated-functions.sh" &>/dev/null |
62 |
|
63 |
# Set IMAGE for minimal backward compatibility with |