--#!/usr/bin/python
++#!@PORTAGE_PYTHON@
# Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
if [ $# -lt 1 ] ; then
- vecho "${0##*/}: at least one argument needed" 1>&2
+ die "${0##*/}: at least one argument needed"
exit 1
fi
-#!/bin/bash
+#!@PORTAGE_BASH@
- # Copyright 2009 Gentoo Foundation
+ # Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
- # 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
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
die "$@"
exit 1
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- vecho "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
-if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
- install -d "${D}${DESTTREE}/bin" || { helpers_die "$0: failed to install ${D}${DESTTREE}/bin"; exit 2; }
+if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
- install -d "${ED}${DESTTREE}/bin" || exit 2
++ install -d "${ED}${DESTTREE}/bin" || { helpers_die "$0: failed to install ${ED}${DESTTREE}/bin"; exit 2; }
fi
ret=0
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
- exec install -d ${DIROPTIONS} "${@/#/${ED}/}"
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
+
-install -d ${DIROPTIONS} "${@/#/${D}/}"
++install -d ${DIROPTIONS} "${@/#/${ED}/}"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
+
if [ $# -lt 1 ] ; then
- source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
- vecho "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
-#!/bin/bash
+#!@PORTAGE_BASH@
- # Copyright 2009 Gentoo Foundation
+ # Copyright 2009-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
+
-PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
-PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
+PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}
+PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}
- # Set EPYTHON variable as empty so that dohtml doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- exec "$PORTAGE_BIN_PATH/dohtml.py" "$@"
+ PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
++ "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
+
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
exit 1
fi
-if [[ ! -d ${D}usr/share/info ]] ; then
- install -d "${D}usr/share/info" || { helpers_die "$0: failed to install ${D}usr/share/info"; exit 1; }
+if [[ ! -d ${ED}usr/share/info ]] ; then
- install -d "${ED}usr/share/info" || exit 1
++ install -d "${ED}usr/share/info" || { helpers_die "$0: failed to install ${ED}usr/share/info"; exit 1; }
fi
-install -m0644 "$@" "${D}usr/share/info"
+install -m0644 "$@" "${ED}usr/share/info"
rval=$?
if [ $rval -ne 0 ] ; then
for x in "$@" ; do
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
if [ $# -lt 1 ] ; then
- echo "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then
vecho "-------------------------------------------------------" 1>&2
- vecho "You should not use \${D} with helpers." 1>&2
+ vecho "You should not use \${D} or \${ED} with helpers." 1>&2
vecho " --> ${INSDESTTREE}" 1>&2
vecho "-------------------------------------------------------" 1>&2
+ helpers_die "$0 used with \${D}"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
mynum=${#}
if [ ${mynum} -lt 1 ] ; then
- echo "${0}: at least one argument needed"
+ helpers_die "${0}: at least one argument needed"
exit 1
fi
-if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
- install -d "${D}${DESTTREE}/share/locale/"
+if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then
+ install -d "${ED}${DESTTREE}/share/locale/"
fi
ret=0
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
+
if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
+ helpers_die "$0: at least one argument needed"
exit 1
fi
-if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
- install -d "${D}${DESTTREE}/sbin" || { helpers_die "$0: failed to install ${D}${DESTTREE}/sbin"; exit 2; }
+if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
- install -d "${ED}${DESTTREE}/sbin" || exit 2
++ install -d "${ED}${DESTTREE}/sbin" || { helpers_die "$0: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
fi
ret=0
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
+
if [[ $# -ne 2 ]] ; then
- echo "$0: two arguments needed" 1>&2
+ helpers_die "$0: two arguments needed"
exit 1
fi
-destdir=${2%/*}
-[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
+target="${1}"
+linkname="${2}"
+[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
+destdir=${linkname%/*}
+[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
- exec ln -snf "${target}" "${ED}/${linkname}"
-
-ln -snf "$1" "${D}$2"
++ln -snf "${target}" "${ED}/${linkname}"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
if [[ -z $1 ]] ; then
- vecho "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
if [[ -z $1 ]] ; then
- vecho "${0##*/}: at least one argument needed" 1>&2
+ helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
--queue)
shift
set -- "${@/%/.ecompress.dir}"
- set -- "${@/#/${D}}"
+ set -- "${@/#/${ED}}"
- exec touch "$@"
+ touch "$@"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $?
;;
--dequeue)
[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
) >&2
fi
- exec ${MAKE:-make} SHELL="${BASH:-/bin/bash}" ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
-${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
++${MAKE:-make} SHELL="${BASH:-/bin/bash}" ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
+
# we can't prefix all arguments because
# chown takes random options
slash="/"
- exec chown "${@/#${slash}/${ED}${slash}}"
-chown "${@/#${slash}/${D}${slash}}"
++chown "${@/#${slash}/${ED}${slash}}"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
+
# we can't prefix all arguments because
# chmod takes random options
slash="/"
- exec chmod "${@/#${slash}/${ED}${slash}}"
-chmod "${@/#${slash}/${D}${slash}}"
++chmod "${@/#${slash}/${ED}${slash}}"
+ ret=$?
+ [[ $ret -ne 0 ]] && helpers_die "$0 failed"
+ exit $ret
-#!/bin/bash
+#!@PORTAGE_BASH@
- # Copyright 2009 Gentoo Foundation
+ # Copyright 2009-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
-PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
+PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}
+PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}
- # Set EPYTHON variable as empty so that dohtml doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- exec "$PORTAGE_BIN_PATH/portageq" "$@"
+ PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/portageq" "$@"
++ exec "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "$PORTAGE_BIN_PATH/portageq" "$@"
--- /dev/null
-#!/bin/bash
++#!@PORTAGE_BASH@
+ # Copyright 2010 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+
+ PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
+ PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
+ PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
- exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@"
++ exec "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@"
--- /dev/null
-#!/usr/bin/python
++#!@PORTAGE_PYTHON@
+ # Copyright 2010 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+ #
+ # This is a helper which which ebuild processes can use
+ # to communicate with portage's main python process.
+
+ import os
+ import pickle
+ import select
+ import signal
+ import sys
+
+ def debug_signal(signum, frame):
+ import pdb
+ pdb.set_trace()
+ signal.signal(signal.SIGUSR1, debug_signal)
+
+ # Avoid sandbox violations after python upgrade.
+ pym_path = os.path.join(os.path.dirname(
+ os.path.dirname(os.path.realpath(__file__))), "pym")
+ if os.environ.get("SANDBOX_ON") == "1":
+ sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
+ if pym_path not in sandbox_write:
+ sandbox_write.append(pym_path)
+ os.environ["SANDBOX_WRITE"] = \
+ ":".join(filter(None, sandbox_write))
+
+ import portage
+
+ class EbuildIpc(object):
+
+ def __init__(self):
+ self.fifo_dir = os.environ['PORTAGE_BUILDDIR']
+ self.ipc_in_fifo = os.path.join(self.fifo_dir, '.ipc_in')
+ self.ipc_out_fifo = os.path.join(self.fifo_dir, '.ipc_out')
+ self.ipc_lock_file = os.path.join(self.fifo_dir, '.ipc_lock')
+
+ def communicate(self, args):
+ # Make locks quiet since unintended locking messages displayed on
+ # stdout could corrupt the intended output of this program.
+ portage.locks._quiet = True
+ lock_obj = portage.locks.lockfile(self.ipc_lock_file, unlinkfile=True)
+ try:
+ return self._communicate(args)
+ finally:
+ portage.locks.unlockfile(lock_obj)
+
+ def _communicate(self, args):
+ input_fd = os.open(self.ipc_out_fifo, os.O_RDONLY|os.O_NONBLOCK)
+ input_file = os.fdopen(input_fd, 'rb')
+ output_file = open(self.ipc_in_fifo, 'wb')
+ pickle.dump(args, output_file)
+ output_file.flush()
+
+ events = select.select([input_file], [], [])
+ reply = pickle.load(input_file)
+ output_file.close()
+ input_file.close()
+
+ (out, err, rval) = reply
+
+ if out:
+ portage.util.writemsg_stdout(out, noiselevel=-1)
+
+ if err:
+ portage.util.writemsg(err, noiselevel=-1)
+
+ return rval
+
+ def ebuild_ipc_main(args):
+ ebuild_ipc = EbuildIpc()
+ return ebuild_ipc.communicate(args)
+
+ if __name__ == '__main__':
+ sys.exit(ebuild_ipc_main(sys.argv[1:]))
-#!/bin/bash
+#!@PORTAGE_BASH@
- # Copyright 1999-2009 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
-PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}"
+PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"
+PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}"
# Don't use sandbox's BASH_ENV for new shells because it does
# 'source /etc/profile' which can interfere with the build
die "portageq calls (has_version calls portageq) are not allowed in the global scope"
fi
- # Set EPYTHON variable as empty so that portageq doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_BIN_PATH}"/portageq has_version "${ROOT}" "$1"
+ if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
+ "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1" "$USE"
+ return $?
+ fi
+
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1"
++ "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1"
local retval=$?
case "${retval}" in
0)
die "portageq calls are not allowed in the global scope"
fi
- # Set EPYTHON variable as empty so that portageq doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_BIN_PATH}/portageq" "$@"
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" "$@"
++ "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" "$@"
}
die "portageq calls (best_version calls portageq) are not allowed in the global scope"
fi
- # Set EPYTHON variable as empty so that portageq doesn't try
- # to use potentially unsupported version of Python.
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
+ if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
+ "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1" "$USE"
+ return $?
+ fi
+
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
++ "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
local retval=$?
case "${retval}" in
0)
export DESTTREE=""
else
export DESTTREE=$1
++<<<<<<< HEAD
+ if [ ! -d "${ED}${DESTTREE}" ]; then
+ install -d "${ED}${DESTTREE}"
++=======
+ if [ ! -d "${D}${DESTTREE}" ]; then
+ install -d "${D}${DESTTREE}"
+ local ret=$?
+ if [[ $ret -ne 0 ]] ; then
+ helpers_die "$0 failed"
+ return $ret
+ fi
++>>>>>>> overlays-gentoo-org/master
fi
fi
}
export INSDESTTREE=""
else
export INSDESTTREE=$1
- if [ ! -d "${D}${INSDESTTREE}" ]; then
- install -d "${D}${INSDESTTREE}"
+ if [ ! -d "${ED}${INSDESTTREE}" ]; then
+ install -d "${ED}${INSDESTTREE}"
+ local ret=$?
+ if [[ $ret -ne 0 ]] ; then
+ helpers_die "$0 failed"
+ return $ret
+ fi
fi
fi
}
export _E_EXEDESTTREE_=""
else
export _E_EXEDESTTREE_="$1"
- if [ ! -d "${D}${_E_EXEDESTTREE_}" ]; then
- install -d "${D}${_E_EXEDESTTREE_}"
+ if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then
+ install -d "${ED}${_E_EXEDESTTREE_}"
+ local ret=$?
+ if [[ $ret -ne 0 ]] ; then
+ helpers_die "$0 failed"
+ return $ret
+ fi
fi
fi
}
export _E_DOCDESTTREE_=""
else
export _E_DOCDESTTREE_="$1"
- if [ ! -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
- install -d "${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+ if [ ! -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
+ install -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+ local ret=$?
+ if [[ $ret -ne 0 ]] ; then
+ helpers_die "$0 failed"
+ return $ret
+ fi
fi
fi
}
"
fi
- EPYTHON= "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
++ "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
}
# @FUNCTION: preprocess_ebuild_env
umask 002
save_ebuild_env | filter_readonly_variables > "$T/environment"
assert "save_ebuild_env failed"
- chown portage:portage "$T/environment" &>/dev/null
+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "$T/environment" &>/dev/null
chmod g+w "$T/environment" &>/dev/null
fi
+ [[ -n $PORTAGE_EBUILD_EXIT_FILE ]] && > "$PORTAGE_EBUILD_EXIT_FILE"
+ [[ -n $PORTAGE_IPC_DAEMON ]] && "$PORTAGE_BIN_PATH"/ebuild-ipc exit 0
exit 0
)
exit $?
-#!/bin/bash
+#!@PORTAGE_BASH@
- # Copyright 1999-2009 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Miscellaneous shell functions that make use of the ebuild env but don't need
[[ ${abort} == "yes" ]] && die "add those ldscripts"
# Make sure people don't store libtool files or static libs in /lib
- # on AIX, "dynamic libs" have extention .a, so don't get false
- f=$(ls "${D}"lib*/*.{a,la} 2>/dev/null)
++ # on AIX, "dynamic libs" have extension .a, so don't get false
+ # positives
+ [[ ${CHOST} == *-aix* ]] \
+ && f=$(ls "${ED}"lib*/*.la 2>/dev/null || true) \
+ || f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null)
if [[ -n ${f} ]] ; then
vecho -ne '\a\n'
eqawarn "QA Notice: Excessive files found in the / partition"
done
[[ $reset_debug = 1 ]] && set -x
f=$(cat "${PORTAGE_LOG_FILE}" | \
- EPYTHON= "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
- "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
++ "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "$PORTAGE_BIN_PATH"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
if [[ -n ${f} ]] ; then
# In the future this will be a forced "die". In preparation,
tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \
bzip2 -cf > "$PORTAGE_BINPKG_TMPFILE"
assert "failed to pack binary package: '$PORTAGE_BINPKG_TMPFILE'"
- EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "$PORTAGE_BIN_PATH"/xpak-helper.py recompose \
+ PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/xpak-helper.py recompose \
++ "${PORTAGE_PYTHON:-@PORTAGE_PYTHON@}" "$PORTAGE_BIN_PATH"/xpak-helper.py recompose \
"$PORTAGE_BINPKG_TMPFILE" "$PORTAGE_BUILDDIR/build-info"
if [ $? -ne 0 ]; then
rm -f "${PORTAGE_BINPKG_TMPFILE}"
-#!/usr/bin/python -O
+#!@PORTAGE_PYTHON@ -O
- # Copyright 1999-2006 Gentoo Foundation
+ # Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Next to do: dep syntax checking in mask files
from itertools import chain
from stat import S_ISDIR
- if not hasattr(__builtins__, "set"):
- from sets import Set as set
-
-
-try:
- import portage
-except ImportError:
- from os import path as osp
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+# for an explanation on this logic, see pym/_emerge/__init__.py
+import os
+import sys
+if os.environ.__contains__("PORTAGE_PYTHONPATH"):
+ sys.path.insert(0, os.environ["PORTAGE_PYTHONPATH"])
+else:
+ sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym"))
+import portage
-
portage._disable_legacy_globals()
+
+ try:
+ import xml.etree.ElementTree
+ from xml.parsers.expat import ExpatError
+ except ImportError:
+ msg = ["Please enable python's \"xml\" USE flag in order to use repoman."]
+ from portage.output import EOutput
+ out = EOutput()
+ for line in msg:
+ out.eerror(line)
+ sys.exit(1)
+
from portage import os
from portage import subprocess_getstatusoutput
from portage import _encodings
from itertools import chain
import portage
from portage.cache.mappings import slot_dict_class
- from portage.dep import isvalidatom, paren_reduce, use_reduce, \
- paren_normalize, paren_enclose, _slot_re
+ from portage.dep import isvalidatom, use_reduce, \
+ paren_enclose, _slot_re
+ from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
+from portage.const import EPREFIX
from _emerge.Task import Task
if sys.hexversion >= 0x3000000:
"INHERITED", "IUSE", "KEYWORDS",
"LICENSE", "PDEPEND", "PROVIDE", "RDEPEND",
"repository", "PROPERTIES", "RESTRICT", "SLOT", "USE",
- "_mtime_", "DEFINED_PHASES", "EPREFIX"]
- "_mtime_", "DEFINED_PHASES", "REQUIRED_USE"]
++ "_mtime_", "DEFINED_PHASES", "REQUIRED_USE", "EPREFIX"]
def __init__(self, **kwargs):
Task.__init__(self, **kwargs)
mreasons.append(
_MaskReason("invalid", "invalid: %s" % (msg,)))
+ if pkg.metadata["REQUIRED_USE"] and \
+ eapi_has_required_use(pkg.metadata["EAPI"]):
+ required_use = pkg.metadata["REQUIRED_USE"]
+ use = pkg.use.enabled
+ iuse = pkgsettings._get_implicit_iuse()
+ iuse.update(pkg.iuse.all)
+ try:
+ required_use_is_sat = portage.dep.check_required_use(
+ required_use, use, iuse)
+ except portage.exception.InvalidDependString:
+ mreasons.append("invalid: REQUIRED_USE")
+ else:
+ if not required_use_is_sat:
+ msg = "violated use flag constraints: '%s'" % required_use
+ mreasons.append(msg)
+
+ if pkg.built and not pkg.installed:
+ if not "EPREFIX" in pkg.metadata or not pkg.metadata["EPREFIX"]:
+ mreasons.append("missing EPREFIX")
+ elif len(pkg.metadata["EPREFIX"].strip()) < len(pkgsettings["EPREFIX"]):
+ mreasons.append("EPREFIX: '%s' too small" % pkg.metadata["EPREFIX"])
+
if not pkg.metadata["SLOT"]:
mreasons.append(
_MaskReason("invalid", "SLOT: undefined"))
from portage.cache.mappings import slot_dict_class
from portage.dbapi.virtual import fakedbapi
+ from portage.dep import use_reduce, paren_enclose
from portage.exception import InvalidPackageName, \
PermissionDenied, PortageException
+from portage.const import EAPI
from portage.localization import _
from portage import _movefile
["BUILD_TIME", "CHOST", "DEPEND", "EAPI", "IUSE", "KEYWORDS",
"LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE",
"RDEPEND", "repository", "RESTRICT", "SLOT", "USE", "DEFINED_PHASES",
- "EPREFIX"])
- "REQUIRED_USE"])
++ "REQUIRED_USE", "EPREFIX"])
self._aux_cache_slot_dict = slot_dict_class(self._aux_cache_keys)
self._aux_cache = {}
["BUILD_TIME", "CHOST", "DEPEND", "DESCRIPTION", "EAPI",
"IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES",
"PROVIDE", "RDEPEND", "repository", "SLOT", "USE", "DEFINED_PHASES",
- "EPREFIX"]
- "REQUIRED_USE"]
++ "REQUIRED_USE", "EPREFIX"]
self._pkgindex_aux_keys = list(self._pkgindex_aux_keys)
self._pkgindex_use_evaluated_keys = \
("LICENSE", "RDEPEND", "DEPEND",
"RESTRICT": "",
"SLOT" : "0",
"USE" : "",
- "DEFINED_PHASES" : ""
+ "DEFINED_PHASES" : "",
+ "REQUIRED_USE" : ""
}
- self._pkgindex_inherited_keys = ["CHOST", "repository"]
+ self._pkgindex_inherited_keys = ["CHOST", "repository", "EPREFIX"]
self._pkgindex_default_header_data = {
"repository":""
}
mydict.pop("AA", None)
# Prefix variables are supported starting with EAPI 3.
- if phase == 'depend' or eapi is None or not eapi_supports_prefix(eapi):
- mydict.pop("ED", None)
- mydict.pop("EPREFIX", None)
- mydict.pop("EROOT", None)
+ # but during transition, we just support them anywhere
- #if phase == 'depend' or eapi in (None, "0", "1", "2"):
- # mydict.pop("ED", None)
- # mydict.pop("EPREFIX", None)
- # mydict.pop("EROOT", None)
++# if phase == 'depend' or eapi is None or not eapi_supports_prefix(eapi):
++# mydict.pop("ED", None)
++# mydict.pop("EPREFIX", None)
++# mydict.pop("EROOT", None)
if phase == 'depend':
mydict.pop('FILESDIR', None)
--- /dev/null
-#!/bin/bash
++#!@PORTAGE_BASH@
+
+ PYTHON_VERSIONS="2.6 2.7 3.1 3.2"
+
+ case "${NOCOLOR:-false}" in
+ yes|true)
+ GOOD=
+ BAD=
+ NORMAL=
+ ;;
+ no|false)
+ GOOD=$'\e[1;32m'
+ BAD=$'\e[1;31m'
+ NORMAL=$'\e[0m'
+ ;;
+ esac
+
+ exit_status="0"
+ for version in ${PYTHON_VERSIONS}; do
- if [[ -x /usr/bin/python${version} ]]; then
++ if [[ -x @PORTAGE_PYTHON@${version} ]]; then
+ echo -e "${GOOD}Testing with Python ${version}...${NORMAL}"
- if ! PYTHONPATH="pym${PYTHONPATH:+:}${PYTHONPATH}" /usr/bin/python${version} pym/portage/tests/runTests; then
++ if ! PYTHONPATH="pym${PYTHONPATH:+:}${PYTHONPATH}" @PORTAGE_PYTHON@${version} pym/portage/tests/runTests; then
+ echo -e "${BAD}Testing with Python ${version} failed${NORMAL}"
+ exit_status="1"
+ fi
+ echo
+ fi
+ done
+
+ exit ${exit_status}