From: Fabian Groffen Date: Tue, 17 Oct 2006 20:39:50 +0000 (-0000) Subject: Use portage_const.EPREFIX instead of self["EPREFIX"] for consistency. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=778aef76bf4b94bfdf6d89993d0b1c6c9e2c3756;p=portage.git Use portage_const.EPREFIX instead of self["EPREFIX"] for consistency. Added eprefixify function which does sedding on files to add EPREFIX in. svn path=/main/branches/prefix/; revision=4740 --- diff --git a/bin/eprefixify b/bin/eprefixify new file mode 100755 index 000000000..44b03d998 --- /dev/null +++ b/bin/eprefixify @@ -0,0 +1,39 @@ +#!@BASH@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: $ + +# replaces @GENTOO_PORTAGE_EPREFIX@ with EPREFIX for the given files + +if [[ $# -lt 1 ]] ; then + echo "$0: at least one argument needed" 1>&2 + exit 1 +fi + +source "${PORTAGE_BIN_PATH}/isolated-functions.sh" +case "${NOCOLOR:-false}" in + yes|true) + unset_colors + ;; + no|false) + set_colors + ;; +esac + +ret=0 + +einfo "Adjusting to prefix ..." +for x in "$@" ; do + if [[ -e ${x} ]] ; then + ebegin ${x##*/} + sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" "${x}" + r=$? + eend $r + ((ret+=$r)) + else + echo "!!! ${0##*/}: ${x} does not exist" 1>&2 + false + fi +done + +exit ${ret} diff --git a/pym/portage.py b/pym/portage.py index fa6fbad37..8b0c9d7a3 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1386,7 +1386,7 @@ class config: for mypath, (gid, mode, modemask) in dir_mode_map.iteritems(): try: mydir = normalize_path( - os.path.join(self["ROOT"] + self["EPREFIX"], mypath)) + os.path.join(self["ROOT"] + portage_const.EPREFIX, mypath)) portage_util.ensure_dirs(mydir, gid=gid, mode=mode, mask=modemask) except portage_exception.PortageException, e: writemsg("!!! Directory initialization failed: '%s'\n" % mydir,