aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-22 01:26:18 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-22 01:26:18 +0000
commit54cfde465957adde802fbd788acd99203ef6d665 (patch)
tree4fee83c7807c84284616ab7193c258a7b5c85163
parent786abaefa90e3cdc198cd37ff1430f910d7a99ea (diff)
downloadpaludis-54cfde465957adde802fbd788acd99203ef6d665.tar.gz
paludis-54cfde465957adde802fbd788acd99203ef6d665.tar.xz
Fix ebuild_notice in utils/ scripts
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am1
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash36
-rwxr-xr-xpaludis/repositories/e/ebuild/pipe_functions.bash73
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/donewins3
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/dosym3
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/prep.in3
6 files changed, 81 insertions, 38 deletions
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index 0287d4a..8e54a37 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -15,6 +15,7 @@ libexecprog_SCRIPTS = \
install_functions.bash \
multilib_functions.bash \
output_functions.bash \
+ pipe_functions.bash \
sandbox.bash \
source_functions.bash \
usage_error.bash \
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 6ad2791..d3f454f 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -104,41 +104,7 @@ ebuild_load_module()
exit 123
}
-paludis_pipe_command()
-{
- [[ -n "${PALUDIS_SKIP_PIPE_COMMAND_CHECK}" ]] && return
-
- if [[ -z "${PALUDIS_PIPE_COMMAND_WRITE_FD}" ]]; then
- type die &>/dev/null && eval die "\"PALUDIS_PIPE_COMMAND_WRITE_FD unset\""
- echo "PALUDIS_PIPE_COMMAND_WRITE_FD unset" 1>&2
- exit 123
- fi
- if [[ -z "${PALUDIS_PIPE_COMMAND_READ_FD}" ]]; then
- type die &>/dev/null && eval die "\"PALUDIS_PIPE_COMMAND_READ_FD unset\""
- echo "PALUDIS_PIPE_COMMAND_READ_FD unset" 1>&2
- exit 123
- fi
-
- local r r1 rest
- r="$(echo "$@" | {
- if ! locked_pipe_command "${PALUDIS_PIPE_COMMAND_WRITE_FD}" "${PALUDIS_PIPE_COMMAND_READ_FD}" ; then
- type die &>/dev/null && eval die "\"locked_pipe_command failed\""
- echo "locked_pipe_command failed" 1>&2
- exit 123
- fi
- })"
-
- r1="${r:0:1}"
- rest="${r:1}"
- if [[ "${r1}" != "O" ]] ; then
- type die &>/dev/null && eval die "\"paludis_pipe_command returned error '\${r1}' with text '\${rest}'\""
- echo "paludis_pipe_command returned error '${r1}' with text '${rest}'" 1>&2
- exit 123
- fi
-
- echo "$rest"
-}
-
+ebuild_load_module pipe_functions
ebuild_load_module die_functions
ebuild_load_module output_functions
ebuild_load_module echo_functions
diff --git a/paludis/repositories/e/ebuild/pipe_functions.bash b/paludis/repositories/e/ebuild/pipe_functions.bash
new file mode 100755
index 0000000..b9dcdee
--- /dev/null
+++ b/paludis/repositories/e/ebuild/pipe_functions.bash
@@ -0,0 +1,73 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+paludis_pipe_command()
+{
+ [[ -n "${PALUDIS_SKIP_PIPE_COMMAND_CHECK}" ]] && return
+
+ if [[ -z "${PALUDIS_PIPE_COMMAND_WRITE_FD}" ]]; then
+ type die &>/dev/null && eval die "\"PALUDIS_PIPE_COMMAND_WRITE_FD unset\""
+ echo "PALUDIS_PIPE_COMMAND_WRITE_FD unset" 1>&2
+ if [[ -n ${EBUILD_KILL_PID} ]]; then
+ echo "paludis_pipe_command: making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
+ kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+ fi
+ exit 123
+ fi
+ if [[ -z "${PALUDIS_PIPE_COMMAND_READ_FD}" ]]; then
+ type die &>/dev/null && eval die "\"PALUDIS_PIPE_COMMAND_READ_FD unset\""
+ echo "PALUDIS_PIPE_COMMAND_READ_FD unset" 1>&2
+ if [[ -n ${EBUILD_KILL_PID} ]]; then
+ echo "paludis_pipe_command: making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
+ kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+ fi
+ exit 123
+ fi
+
+ local r r1 rest
+ r="$(echo "$@" | {
+ if ! locked_pipe_command "${PALUDIS_PIPE_COMMAND_WRITE_FD}" "${PALUDIS_PIPE_COMMAND_READ_FD}" ; then
+ type die &>/dev/null && eval die "\"locked_pipe_command failed\""
+ echo "locked_pipe_command failed" 1>&2
+ if [[ -n ${EBUILD_KILL_PID} ]]; then
+ echo "paludis_pipe_command: making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
+ kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+ fi
+ exit 123
+ fi
+ })"
+
+ r1="${r:0:1}"
+ rest="${r:1}"
+ if [[ "${r1}" != "O" ]] ; then
+ type die &>/dev/null && eval die "\"paludis_pipe_command returned error '\${r1}' with text '\${rest}'\""
+ echo "paludis_pipe_command returned error '${r1}' with text '${rest}'" 1>&2
+ if [[ -n ${EBUILD_KILL_PID} ]]; then
+ echo "paludis_pipe_command: making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
+ kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+ fi
+ exit 123
+ fi
+
+ echo "$rest"
+}
+
diff --git a/paludis/repositories/e/ebuild/utils/donewins b/paludis/repositories/e/ebuild/utils/donewins
index 193dd11..9428526 100755
--- a/paludis/repositories/e/ebuild/utils/donewins
+++ b/paludis/repositories/e/ebuild/utils/donewins
@@ -22,7 +22,8 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_EBUILD_DIR}/pipe_functions.bash
+source ${PALUDIS_EBUILD_DIR}/output_functions.bash
if [[ ! -d ${T} ]]; then
echo "${0}: \${T} not valid; aborting" >&2
diff --git a/paludis/repositories/e/ebuild/utils/dosym b/paludis/repositories/e/ebuild/utils/dosym
index c6709b7..a54b115 100755
--- a/paludis/repositories/e/ebuild/utils/dosym
+++ b/paludis/repositories/e/ebuild/utils/dosym
@@ -22,7 +22,8 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_EBUILD_DIR}/pipe_functions.bash
+source ${PALUDIS_EBUILD_DIR}/output_functions.bash
if [[ ! -d ${D} ]]; then
echo "${0}: \${D} not valid; aborting" >&2
diff --git a/paludis/repositories/e/ebuild/utils/prep.in b/paludis/repositories/e/ebuild/utils/prep.in
index 38a43b0..2bc94f3 100755
--- a/paludis/repositories/e/ebuild/utils/prep.in
+++ b/paludis/repositories/e/ebuild/utils/prep.in
@@ -18,7 +18,8 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+source ${PALUDIS_EBUILD_DIR}/pipe_functions.bash
+source ${PALUDIS_EBUILD_DIR}/output_functions.bash
ebuild_notice "qa" "Ebuilds shouldn't be calling $0 manually."