1 |
Author: zmedico |
2 |
Date: 2009-04-24 02:18:34 +0000 (Fri, 24 Apr 2009) |
3 |
New Revision: 13389 |
4 |
|
5 |
Added: |
6 |
main/trunk/bin/banned-helper |
7 |
main/trunk/bin/ebuild-helpers/3/dohard |
8 |
main/trunk/bin/ebuild-helpers/3/dosed |
9 |
main/trunk/bin/ebuild-helpers/die |
10 |
Modified: |
11 |
main/trunk/bin/ebuild.sh |
12 |
Log: |
13 |
Add dohard and doset helper which die for EAPI 3. TODO: Make the die |
14 |
helper use pipe or socket IPC instead of a signal, to avoid a potential |
15 |
race condition in signal delivery. Thanks to to Tiziano M?\195?\188ller <dev-zero@g.o> |
16 |
for the initial patch. |
17 |
|
18 |
|
19 |
Added: main/trunk/bin/banned-helper |
20 |
=================================================================== |
21 |
--- main/trunk/bin/banned-helper (rev 0) |
22 |
+++ main/trunk/bin/banned-helper 2009-04-24 02:18:34 UTC (rev 13389) |
23 |
@@ -0,0 +1,7 @@ |
24 |
+#!/bin/bash |
25 |
+# Copyright 2009 Gentoo Foundation |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+# $Id$ |
28 |
+ |
29 |
+die "'${0##*/}' has been banned for EAPI '$EAPI'" |
30 |
+exit 1 |
31 |
|
32 |
|
33 |
Property changes on: main/trunk/bin/banned-helper |
34 |
___________________________________________________________________ |
35 |
Name: svn:executable |
36 |
+ * |
37 |
Name: svn:keywords |
38 |
+ Id |
39 |
|
40 |
Added: main/trunk/bin/ebuild-helpers/3/dohard |
41 |
=================================================================== |
42 |
--- main/trunk/bin/ebuild-helpers/3/dohard (rev 0) |
43 |
+++ main/trunk/bin/ebuild-helpers/3/dohard 2009-04-24 02:18:34 UTC (rev 13389) |
44 |
@@ -0,0 +1 @@ |
45 |
+link ../../banned-helper |
46 |
\ No newline at end of file |
47 |
|
48 |
|
49 |
Property changes on: main/trunk/bin/ebuild-helpers/3/dohard |
50 |
___________________________________________________________________ |
51 |
Name: svn:special |
52 |
+ * |
53 |
|
54 |
Added: main/trunk/bin/ebuild-helpers/3/dosed |
55 |
=================================================================== |
56 |
--- main/trunk/bin/ebuild-helpers/3/dosed (rev 0) |
57 |
+++ main/trunk/bin/ebuild-helpers/3/dosed 2009-04-24 02:18:34 UTC (rev 13389) |
58 |
@@ -0,0 +1 @@ |
59 |
+link ../../banned-helper |
60 |
\ No newline at end of file |
61 |
|
62 |
|
63 |
Property changes on: main/trunk/bin/ebuild-helpers/3/dosed |
64 |
___________________________________________________________________ |
65 |
Name: svn:special |
66 |
+ * |
67 |
|
68 |
Added: main/trunk/bin/ebuild-helpers/die |
69 |
=================================================================== |
70 |
--- main/trunk/bin/ebuild-helpers/die (rev 0) |
71 |
+++ main/trunk/bin/ebuild-helpers/die 2009-04-24 02:18:34 UTC (rev 13389) |
72 |
@@ -0,0 +1,12 @@ |
73 |
+#!/bin/bash |
74 |
+# Copyright 2009 Gentoo Foundation |
75 |
+# Distributed under the terms of the GNU General Public License v2 |
76 |
+# $Id$ |
77 |
+ |
78 |
+# TODO: Eliminate race condition in signal delivery by using pipe or socket |
79 |
+# IPC to guarantee that the ebuild process and all of its children (including |
80 |
+# this helper) are killed immediately, ensuring that "false success" is |
81 |
+# impossible. |
82 |
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
83 |
+die "$@" |
84 |
+exit 1 |
85 |
|
86 |
|
87 |
Property changes on: main/trunk/bin/ebuild-helpers/die |
88 |
___________________________________________________________________ |
89 |
Name: svn:executable |
90 |
+ * |
91 |
Name: svn:keywords |
92 |
+ Id |
93 |
|
94 |
Modified: main/trunk/bin/ebuild.sh |
95 |
=================================================================== |
96 |
--- main/trunk/bin/ebuild.sh 2009-04-24 00:15:24 UTC (rev 13388) |
97 |
+++ main/trunk/bin/ebuild.sh 2009-04-24 02:18:34 UTC (rev 13389) |
98 |
@@ -56,8 +56,8 @@ |
99 |
return $retval |
100 |
} |
101 |
|
102 |
-# subshell die support |
103 |
-EBUILD_MASTER_PID=$$ |
104 |
+# Subshell/helper die support (must export for the die helper). |
105 |
+export EBUILD_MASTER_PID=$$ |
106 |
trap 'exit 1' SIGTERM |
107 |
|
108 |
EBUILD_SH_ARGS="$*" |