summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-04-30 07:24:48 +0000
committerZac Medico <zmedico@gentoo.org>2009-04-30 07:24:48 +0000
commit15284b7da00a81be915decf64487419c8b84df13 (patch)
tree1a1520c9eda536ce1c9d30214e76a9a3a9a8c742 /bin
parentSet executable. (trunk r13388) (diff)
downloadportage-multirepo-15284b7da00a81be915decf64487419c8b84df13.tar.gz
portage-multirepo-15284b7da00a81be915decf64487419c8b84df13.tar.bz2
portage-multirepo-15284b7da00a81be915decf64487419c8b84df13.zip
Add dohard and doset helper which die for EAPI 3. TODO: Make the die
helper use pipe or socket IPC instead of a signal, to avoid a potential race condition in signal delivery. Thanks to to Tiziano Müller <dev-zero@g.o> for the initial patch. (trunk r13389) svn path=/main/branches/2.1.6/; revision=13541
Diffstat (limited to 'bin')
-rwxr-xr-xbin/banned-helper7
l---------bin/ebuild-helpers/3/dohard1
l---------bin/ebuild-helpers/3/dosed1
-rwxr-xr-xbin/ebuild-helpers/die12
-rwxr-xr-xbin/ebuild.sh4
5 files changed, 23 insertions, 2 deletions
diff --git a/bin/banned-helper b/bin/banned-helper
new file mode 100755
index 00000000..aa962a1f
--- /dev/null
+++ b/bin/banned-helper
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Copyright 2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+die "'${0##*/}' has been banned for EAPI '$EAPI'"
+exit 1
diff --git a/bin/ebuild-helpers/3/dohard b/bin/ebuild-helpers/3/dohard
new file mode 120000
index 00000000..1a6b57a3
--- /dev/null
+++ b/bin/ebuild-helpers/3/dohard
@@ -0,0 +1 @@
+../../banned-helper \ No newline at end of file
diff --git a/bin/ebuild-helpers/3/dosed b/bin/ebuild-helpers/3/dosed
new file mode 120000
index 00000000..1a6b57a3
--- /dev/null
+++ b/bin/ebuild-helpers/3/dosed
@@ -0,0 +1 @@
+../../banned-helper \ No newline at end of file
diff --git a/bin/ebuild-helpers/die b/bin/ebuild-helpers/die
new file mode 100755
index 00000000..e871bd9f
--- /dev/null
+++ b/bin/ebuild-helpers/die
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Copyright 2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# TODO: Eliminate race condition in signal delivery by using pipe or socket
+# IPC to guarantee that the ebuild process and all of its children (including
+# this helper) are killed immediately, ensuring that "false success" is
+# impossible.
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+die "$@"
+exit 1
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5f78c8e4..9cbd748e 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -56,8 +56,8 @@ qa_call() {
return $retval
}
-# subshell die support
-EBUILD_MASTER_PID=$$
+# Subshell/helper die support (must export for the die helper).
+export EBUILD_MASTER_PID=$$
trap 'exit 1' SIGTERM
EBUILD_SH_ARGS="$*"