Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 273651 | Differences between
and this patch

Collapse All | Expand All

(-)a/bin/ebuild-helpers/4/dodoc (-1 / +2 lines)
Lines 5-11 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [ $# -lt 1 ] ; then
7
if [ $# -lt 1 ] ; then
8
	vecho "${0##*/}: at least one argument needed" 1>&2
8
	die "${0##*/}: at least one argument needed"
9
	exit 1
9
	exit 1
10
fi
10
fi
11
11
Lines 46-49 for x in "$@" ; do Link Here
46
46
47
done
47
done
48
48
49
[[ $ret -ne 0 ]] && die "$0 failed"
49
exit ${ret}
50
exit ${ret}
(-)a/bin/ebuild-helpers/dobin (-2 / +3 lines)
Lines 5-16 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [[ $# -lt 1 ]] ; then
7
if [[ $# -lt 1 ]] ; then
8
	vecho "$0: at least one argument needed" 1>&2
8
	helpers_die "$0: at least one argument needed"
9
	exit 1
9
	exit 1
10
fi
10
fi
11
11
12
if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
12
if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
13
	install -d "${D}${DESTTREE}/bin" || exit 2
13
	install -d "${D}${DESTTREE}/bin" || { helpers_die "$0: failed to install ${D}${DESTTREE}/bin"; exit 2; }
14
fi
14
fi
15
15
16
ret=0
16
ret=0
Lines 25-28 for x in "$@" ; do Link Here
25
	((ret|=$?))
25
	((ret|=$?))
26
done
26
done
27
27
28
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
28
exit ${ret}
29
exit ${ret}
(-)a/bin/ebuild-helpers/doconfd (-1 / +2 lines)
Lines 3-9 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
if [[ $# -lt 1 ]] ; then
5
if [[ $# -lt 1 ]] ; then
6
	echo "$0: at least one argument needed" 1>&2
6
	source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
7
	helpers_die "$0: at least one argument needed"
7
	exit 1
8
	exit 1
8
fi
9
fi
9
10
(-)a/bin/ebuild-helpers/dodir (-1 / +6 lines)
Lines 2-5 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
exec install -d ${DIROPTIONS} "${@/#/${D}/}"
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
7
install -d ${DIROPTIONS} "${@/#/${D}/}"
8
ret=$?
9
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
10
exit $ret
(-)a/bin/ebuild-helpers/dodoc (-2 / +4 lines)
Lines 2-10 Link Here
2
# Copyright 1999-2007 Gentoo Foundation
2
# Copyright 1999-2007 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [ $# -lt 1 ] ; then
7
if [ $# -lt 1 ] ; then
6
	source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
8
	helpers_die "${0##*/}: at least one argument needed"
7
	vecho "${0##*/}: at least one argument needed" 1>&2
8
	exit 1 	
9
	exit 1 	
9
fi
10
fi
10
11
Lines 24-27 for x in "$@" ; do Link Here
24
	fi
25
	fi
25
done
26
done
26
27
28
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
27
exit ${ret}
29
exit ${ret}
(-)a/bin/ebuild-helpers/doenvd (-1 / +2 lines)
Lines 3-9 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
if [[ $# -lt 1 ]] ; then
5
if [[ $# -lt 1 ]] ; then
6
	echo "$0: at least one argument needed" 1>&2
6
	source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
7
	helpers_die "$0: at least one argument needed"
7
	exit 1
8
	exit 1
8
fi
9
fi
9
10
(-)a/bin/ebuild-helpers/doexe (-1 / +2 lines)
Lines 5-11 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [[ $# -lt 1 ]] ; then
7
if [[ $# -lt 1 ]] ; then
8
	echo "$0: at least one argument needed" 1>&2
8
	helpers_die "$0: at least one argument needed"
9
	exit 1
9
	exit 1
10
fi
10
fi
11
11
Lines 39-42 done Link Here
39
39
40
rm -rf "$TMP"
40
rm -rf "$TMP"
41
41
42
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
42
exit $ret
43
exit $ret
(-)a/bin/ebuild-helpers/dohtml (-1 / +7 lines)
Lines 2-10 Link Here
2
# Copyright 2009 Gentoo Foundation
2
# Copyright 2009 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
7
PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
6
PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
8
PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
7
# Set EPYTHON variable as empty so that dohtml doesn't try
9
# Set EPYTHON variable as empty so that dohtml doesn't try
8
# to use potentially unsupported version of Python.
10
# to use potentially unsupported version of Python.
9
EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
11
EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
10
	exec "$PORTAGE_BIN_PATH/dohtml.py" "$@"
12
	"$PORTAGE_BIN_PATH/dohtml.py" "$@"
13
14
ret=$?
15
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
16
exit $ret
(-)a/bin/ebuild-helpers/doinfo (-2 / +3 lines)
Lines 5-16 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [[ -z $1 ]] ; then
7
if [[ -z $1 ]] ; then
8
	vecho "${0##*/}: at least one argument needed"
8
	helpers_die "${0##*/}: at least one argument needed"
9
	exit 1 	
9
	exit 1 	
10
fi
10
fi
11
11
12
if [[ ! -d ${D}usr/share/info ]] ; then
12
if [[ ! -d ${D}usr/share/info ]] ; then
13
	install -d "${D}usr/share/info" || exit 1
13
	install -d "${D}usr/share/info" || { helpers_die "$0: failed to install ${D}usr/share/info"; exit 1; }
14
fi
14
fi
15
15
16
install -m0644 "$@" "${D}usr/share/info"
16
install -m0644 "$@" "${D}usr/share/info"
Lines 19-23 if [ $rval -ne 0 ] ; then Link Here
19
	for x in "$@" ; do
19
	for x in "$@" ; do
20
		[ -e "$x" ] || echo "!!! ${0##*/}: $x does not exist" 1>&2
20
		[ -e "$x" ] || echo "!!! ${0##*/}: $x does not exist" 1>&2
21
	done
21
	done
22
	helpers_die "$0 failed"
22
fi
23
fi
23
exit $rval
24
exit $rval
(-)a/bin/ebuild-helpers/doinitd (-1 / +2 lines)
Lines 3-9 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
if [[ $# -lt 1 ]] ; then
5
if [[ $# -lt 1 ]] ; then
6
	echo "$0: at least one argument needed" 1>&2
6
	source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
7
	helpers_die "$0: at least one argument needed"
7
	exit 1
8
	exit 1
8
fi
9
fi
9
10
(-)a/bin/ebuild-helpers/doins (-2 / +3 lines)
Lines 5-11 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [ $# -lt 1 ] ; then
7
if [ $# -lt 1 ] ; then
8
	echo "${0##*/}: at least one argument needed" 1>&2
8
	helpers_die "${0##*/}: at least one argument needed"
9
	exit 1
9
	exit 1
10
fi
10
fi
11
11
Lines 21-26 if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then Link Here
21
	vecho "You should not use \${D} with helpers." 1>&2
21
	vecho "You should not use \${D} with helpers." 1>&2
22
	vecho "  --> ${INSDESTTREE}" 1>&2
22
	vecho "  --> ${INSDESTTREE}" 1>&2
23
	vecho "-------------------------------------------------------" 1>&2
23
	vecho "-------------------------------------------------------" 1>&2
24
	helpers_die "$0 used with \${D}"
24
	exit 1
25
	exit 1
25
fi
26
fi
26
27
Lines 126-129 for x in "$@" ; do Link Here
126
	fi
127
	fi
127
done
128
done
128
rm -rf "$TMP"
129
rm -rf "$TMP"
129
[[ $failed -ne 0 || $success -eq 0 ]] && exit 1 || exit 0
130
[[ $failed -ne 0 || $success -eq 0 ]] && { helpers_die "$0 failed"; exit 1; } || exit 0
(-)a/bin/ebuild-helpers/dolib (-2 / +5 lines)
Lines 2-7 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
# Setup ABI cruft
7
# Setup ABI cruft
6
LIBDIR_VAR="LIBDIR_${ABI}"
8
LIBDIR_VAR="LIBDIR_${ABI}"
7
if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
9
if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
Lines 14-24 libdir="${D}${DESTTREE}/${CONF_LIBDIR}" Link Here
14
16
15
17
16
if [[ $# -lt 1 ]] ; then
18
if [[ $# -lt 1 ]] ; then
17
	echo "$0: at least one argument needed" 1>&2
19
	helpers_die "$0: at least one argument needed"
18
	exit 1
20
	exit 1
19
fi
21
fi
20
if [[ ! -d ${libdir} ]] ; then
22
if [[ ! -d ${libdir} ]] ; then
21
	install -d "${libdir}" || exit 1
23
	install -d "${libdir}" || { helpers_die "$0: failed to install ${libdir}"; exit 1; }
22
fi
24
fi
23
25
24
ret=0
26
ret=0
Lines 37-40 for x in "$@" ; do Link Here
37
	((ret|=$?))
39
	((ret|=$?))
38
done
40
done
39
41
42
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
40
exit ${ret}
43
exit ${ret}
(-)a/bin/ebuild-helpers/doman (-1 / +2 lines)
Lines 5-11 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [[ $# -lt 1 ]] ; then
7
if [[ $# -lt 1 ]] ; then
8
	echo "$0: at least one argument needed" 1>&2
8
	helpers_die "$0: at least one argument needed"
9
	exit 1
9
	exit 1
10
fi
10
fi
11
11
Lines 60-63 for x in "$@" ; do Link Here
60
	fi
60
	fi
61
done
61
done
62
62
63
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
63
exit ${ret}
64
exit ${ret}
(-)a/bin/ebuild-helpers/domo (-1 / +4 lines)
Lines 2-10 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
mynum=${#}
7
mynum=${#}
6
if [ ${mynum} -lt 1 ] ; then
8
if [ ${mynum} -lt 1 ] ; then
7
	echo "${0}: at least one argument needed"
9
	helpers_die "${0}: at least one argument needed"
8
	exit 1
10
	exit 1
9
fi
11
fi
10
if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
12
if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
Lines 28-31 for x in "$@" ; do Link Here
28
	((ret|=$?))
30
	((ret|=$?))
29
done
31
done
30
32
33
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
31
exit $ret
34
exit $ret
(-)a/bin/ebuild-helpers/dosbin (-2 / +5 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ $# -lt 1 ]] ; then
7
if [[ $# -lt 1 ]] ; then
6
	echo "$0: at least one argument needed" 1>&2
8
	helpers_die "$0: at least one argument needed"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
12
if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
11
	install -d "${D}${DESTTREE}/sbin" || exit 2
13
	install -d "${D}${DESTTREE}/sbin" || { helpers_die "$0: failed to install ${D}${DESTTREE}/sbin"; exit 2; }
12
fi
14
fi
13
15
14
ret=0
16
ret=0
Lines 23-26 for x in "$@" ; do Link Here
23
	((ret|=$?))
25
	((ret|=$?))
24
done
26
done
25
27
28
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
26
exit ${ret}
29
exit ${ret}
(-)a/bin/ebuild-helpers/dosym (-2 / +7 lines)
Lines 2-13 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ $# -ne 2 ]] ; then
7
if [[ $# -ne 2 ]] ; then
6
	echo "$0: two arguments needed" 1>&2
8
	helpers_die "$0: two arguments needed"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
destdir=${2%/*}
12
destdir=${2%/*}
11
[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
13
[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
12
14
13
exec ln -snf "$1" "${D}$2"
15
ln -snf "$1" "${D}$2"
16
ret=$?
17
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
18
exit $ret
(-)a/bin/ebuild-helpers/ecompress (-4 / +10 lines)
Lines 5-11 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [[ -z $1 ]] ; then
7
if [[ -z $1 ]] ; then
8
	vecho "${0##*/}: at least one argument needed" 1>&2
8
	helpers_die "${0##*/}: at least one argument needed"
9
	exit 1
9
	exit 1
10
fi
10
fi
11
11
Lines 95-101 case $1 in Link Here
95
		;;
95
		;;
96
	--queue)
96
	--queue)
97
		shift
97
		shift
98
		exec touch "${@/%/.ecompress.file}"
98
		touch "${@/%/.ecompress.file}"
99
		ret=$?
100
		[[ $ret -ne 0 ]] && helpers_die "$0 failed"
101
		exit $ret
99
		;;
102
		;;
100
	--dequeue)
103
	--dequeue)
101
		[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
104
		[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
Lines 105-111 case $1 in Link Here
105
		find "${D}" -name '*.ecompress.file' -print0 | ${XARGS} -0 rm -f
108
		find "${D}" -name '*.ecompress.file' -print0 | ${XARGS} -0 rm -f
106
		;;
109
		;;
107
	--*)
110
	--*)
108
		vecho "${0##*/}: unknown arguments '$*'" 1>&2
111
		helpers_die "${0##*/}: unknown arguments '$*'"
109
		exit 1
112
		exit 1
110
		;;
113
		;;
111
	*)
114
	*)
Lines 142-147 case $1 in Link Here
142
		[[ -n ${suffix} ]] && echo -n "${@/%/${suffix}$'\001'}" | \
145
		[[ -n ${suffix} ]] && echo -n "${@/%/${suffix}$'\001'}" | \
143
			tr '\001' '\000' | ${XARGS} -0 rm -f
146
			tr '\001' '\000' | ${XARGS} -0 rm -f
144
		# Finally, let's actually do some real work
147
		# Finally, let's actually do some real work
145
		exec "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
148
		"${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
149
		ret=$?
150
		[[ $ret -ne 0 ]] && helpers_die "$0 failed"
151
		exit $ret
146
		;;
152
		;;
147
esac
153
esac
(-)a/bin/ebuild-helpers/ecompressdir (-3 / +7 lines)
Lines 5-11 Link Here
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
6
7
if [[ -z $1 ]] ; then
7
if [[ -z $1 ]] ; then
8
	vecho "${0##*/}: at least one argument needed" 1>&2
8
	helpers_die "${0##*/}: at least one argument needed"
9
	exit 1
9
	exit 1
10
fi
10
fi
11
11
Lines 21-27 case $1 in Link Here
21
		shift
21
		shift
22
		set -- "${@/%/.ecompress.dir}"
22
		set -- "${@/%/.ecompress.dir}"
23
		set -- "${@/#/${D}}"
23
		set -- "${@/#/${D}}"
24
		exec touch "$@"
24
		touch "$@"
25
		ret=$?
26
		[[ $ret -ne 0 ]] && helpers_die "$0 failed"
27
		exit $?
25
		;;
28
		;;
26
	--dequeue)
29
	--dequeue)
27
		[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
30
		[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
Lines 32-38 case $1 in Link Here
32
		exit 0
35
		exit 0
33
		;;
36
		;;
34
	--*)
37
	--*)
35
		vecho "${0##*/}: unknown arguments '$*'"
38
		helpers_die "${0##*/}: unknown arguments '$*'"
36
		exit 1
39
		exit 1
37
		;;
40
		;;
38
esac
41
esac
Lines 132-135 for dir in "$@" ; do Link Here
132
	restore_skip_dirs
135
	restore_skip_dirs
133
done
136
done
134
137
138
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
135
exit ${ret}
139
exit ${ret}
(-)a/bin/ebuild-helpers/emake (-1 / +4 lines)
Lines 21-24 if [[ $PORTAGE_QUIET != 1 ]] ; then Link Here
21
	) >&2
21
	) >&2
22
fi
22
fi
23
23
24
exec ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
24
${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
25
ret=$?
26
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
27
exit $ret
(-)a/bin/ebuild-helpers/fowners (-1 / +6 lines)
Lines 2-8 Link Here
2
# Copyright 1999-2007 Gentoo Foundation
2
# Copyright 1999-2007 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
# we can't prefix all arguments because
7
# we can't prefix all arguments because
6
# chown takes random options
8
# chown takes random options
7
slash="/"
9
slash="/"
8
exec chown "${@/#${slash}/${D}${slash}}"
10
chown "${@/#${slash}/${D}${slash}}"
11
ret=$?
12
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
13
exit $ret
(-)a/bin/ebuild-helpers/fperms (-1 / +6 lines)
Lines 2-8 Link Here
2
# Copyright 1999-2007 Gentoo Foundation
2
# Copyright 1999-2007 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
# we can't prefix all arguments because
7
# we can't prefix all arguments because
6
# chmod takes random options
8
# chmod takes random options
7
slash="/"
9
slash="/"
8
exec chmod "${@/#${slash}/${D}${slash}}"
10
chmod "${@/#${slash}/${D}${slash}}"
11
ret=$?
12
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
13
exit $ret
(-)a/bin/ebuild-helpers/newbin (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newconfd (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newdoc (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newenvd (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newexe (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newinitd (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newins (-3 / +9 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2009 Gentoo Foundation
2
# Copyright 1999-2009 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
Lines 18-27 case "$EAPI" in Link Here
18
		cp "$1" "$T/$2" || exit $?
20
		cp "$1" "$T/$2" || exit $?
19
		;;
21
		;;
20
	*)
22
	*)
21
		cp -P "$1" "$T/$2" || exit $?
23
		cp -P "$1" "$T/$2"
24
		ret=$?
25
		[[ $ret -ne 0 ]] && helpers_die "$0 failed"
26
		exit $ret
22
		;;
27
		;;
23
esac
28
esac
24
doins "${T}/${2}"
29
doins "${T}/${2}"
25
ret=$?
30
ret=$?
26
rm -rf "${T}/${2}"
31
rm -rf "${T}/${2}"
32
[[ $ret -ne 0 ]] && helpers_die "$0 failed"
27
exit $ret
33
exit $ret
(-)a/bin/ebuild-helpers/newlib.a (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newlib.so (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newman (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/ebuild-helpers/newsbin (-2 / +4 lines)
Lines 2-14 Link Here
2
# Copyright 1999-2006 Gentoo Foundation
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
4
5
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
5
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7
if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
6
	echo "$0: Need two arguments, old file and new file" 1>&2
8
	helpers_die "$0: Need two arguments, old file and new file"
7
	exit 1
9
	exit 1
8
fi
10
fi
9
11
10
if [ ! -e "$1" ] ; then
12
if [ ! -e "$1" ] ; then
11
	echo "!!! ${0##*/}: $1 does not exist" 1>&2
13
	helpers_die "!!! ${0##*/}: $1 does not exist"
12
	exit 1
14
	exit 1
13
fi
15
fi
14
16
(-)a/bin/isolated-functions.sh (-1 / +11 lines)
Lines 70-75 nonfatal() { Link Here
70
	PORTAGE_NONFATAL=1 "$@"
70
	PORTAGE_NONFATAL=1 "$@"
71
}
71
}
72
72
73
helpers_die() {
74
	case "${EAPI:-0}" in
75
		4)
76
			die "$@"
77
			;;
78
		*)
79
			echo -e "$@" >&2
80
			;;
81
	esac
82
}
83
73
die() {
84
die() {
74
	if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
85
	if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
75
		echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2
86
		echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2
76
- 

Return to bug 273651