From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from <gentoo-commits+bounces-341227-garchives=archives.gentoo.org@lists.gentoo.org>) id 1QGx7d-0005sZ-9C for garchives@archives.gentoo.org; Mon, 02 May 2011 17:41:25 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ED69E1C00B; Mon, 2 May 2011 17:41:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9249E1C00B for <gentoo-commits@lists.gentoo.org>; Mon, 2 May 2011 17:41:17 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BD3C01B4019 for <gentoo-commits@lists.gentoo.org>; Mon, 2 May 2011 17:41:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2C2C580505 for <gentoo-commits@lists.gentoo.org>; Mon, 2 May 2011 17:41:16 +0000 (UTC) From: "Fabian Groffen" <grobian@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" <grobian@gentoo.org> Message-ID: <6a851bcab5cab34dba3a1d89ce603480989e02a1.grobian@gentoo> Subject: [gentoo-commits] proj/portage:prefix commit in: / X-VCS-Repository: proj/portage X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 6a851bcab5cab34dba3a1d89ce603480989e02a1 Date: Mon, 2 May 2011 17:41:16 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: d44336007e148c3bedad5558f9c7cf41 commit: 6a851bcab5cab34dba3a1d89ce603480989e02a1 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Mon May 2 17:38:24 2011 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Mon May 2 17:38:24 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D6a851bca Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/misc-functions.sh pym/portage/package/ebuild/doebuild.py runtests.sh bin/ebuild.sh | 35 ++ bin/isolated-functions.sh | 4 +- bin/misc-functions.sh | 86 ++-- bin/repoman | 48 +-- man/emerge.1 | 29 ++- man/portage.5 | 20 +- man/repoman.1 | 12 +- pym/_emerge/DepPriority.py | 10 +- pym/_emerge/DepPriorityNormalRange.py | 4 +- pym/_emerge/DepPrioritySatisfiedRange.py | 3 +- pym/_emerge/Dependency.py | 9 +- pym/_emerge/EbuildPhase.py | 7 +- pym/_emerge/Package.py | 3 +- pym/_emerge/Scheduler.py | 65 --- pym/_emerge/UnmergeDepPriority.py | 6 +- pym/_emerge/actions.py | 145 +++++-- pym/_emerge/create_depgraph_params.py | 6 +- pym/_emerge/depgraph.py | 482 ++++++++++++++++= ++---- pym/_emerge/emergelog.py | 10 +- pym/_emerge/help.py | 44 ++- pym/_emerge/main.py | 117 +++++- pym/_emerge/resolver/backtracking.py | 15 +- pym/portage/dbapi/bintree.py | 8 +- pym/portage/package/ebuild/doebuild.py | 35 +- pym/portage/tests/resolver/ResolverPlayground.py | 4 +- pym/portage/tests/resolver/test_autounmask.py | 33 ++- pym/portage/tests/resolver/test_rebuild.py | 69 +++ runtests.sh | 4 +- 28 files changed, 978 insertions(+), 335 deletions(-) diff --cc bin/misc-functions.sh index 3bf5060,b28b73f..dce730a mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@@ -1249,220 -741,6 +1267,204 @@@ install_mask()=20 set -${shopts} } =20 - preinst_bsdflags() { - hasq chflags $FEATURES || return - # Save all the file flags for restoration after installation. - mtree -c -p "${D}" -k flags > "${T}/bsdflags.mtree" - # Remove all the file flags so that the merge phase can do anything - # necessary. - chflags -R noschg,nouchg,nosappnd,nouappnd "${D}" - chflags -R nosunlnk,nouunlnk "${D}" 2>/dev/null - } -=20 - postinst_bsdflags() { - hasq chflags $FEATURES || return - # Restore all the file flags that were saved before installation. - mtree -e -p "${ROOT}" -U -k flags < "${T}/bsdflags.mtree" &> /dev/null - } -=20 +preinst_aix() { + if [[ ${CHOST} !=3D *-aix* ]] || hasq binchecks ${RESTRICT}; then + return 0 + fi + local ar strip + if type ${CHOST}-ar >/dev/null 2>&1 && type ${CHOST}-strip >/dev/null = 2>&1; then + ar=3D${CHOST}-ar + strip=3D${CHOST}-strip + elif [[ ${CBUILD} =3D=3D "${CHOST}" ]] && type ar >/dev/null 2>&1 && t= ype strip >/dev/null 2>&1; then + ar=3Dar + strip=3Dstrip + elif [[ -x /usr/ccs/bin/ar && -x /usr/ccs/bin/strip ]]; then + ar=3D/usr/ccs/bin/ar + strip=3D/usr/ccs/bin/strip + else + die "cannot find where to use 'ar' and 'strip' from" + fi + local archives_members=3D archives=3D() chmod400files=3D() + local archive_member soname runpath needed archive contentmember + while read archive_member; do + archive_member=3D${archive_member#*;${EPREFIX}/} # drop "^type;EPREFI= X/" + soname=3D${archive_member#*;} + runpath=3D${soname#*;} + needed=3D${runpath#*;} + soname=3D${soname%%;*} + runpath=3D${runpath%%;*} + archive_member=3D${archive_member%%;*} # drop ";soname;runpath;needed= $" + archive=3D${archive_member%[*} + if [[ ${archive_member} !=3D *'['*']' ]]; then + if [[ "${soname};${runpath};${needed}" =3D=3D "${archive##*/};;" && = -e ${EROOT}${archive} ]]; then + # most likely is an archive stub that already exists, + # may have to preserve members being a shared object. + archives[${#archives[@]}]=3D${archive} + fi + continue + fi + archives_members=3D"${archives_members}:(${archive_member}):" + contentmember=3D"${archive%/*}/.${archive##*/}${archive_member#${arch= ive}}" + # portage does os.lstat() on merged files every now + # and then, so keep stamp-files for archive members + # around to get the preserve-libs feature working. + { echo "Please leave this file alone, it is an important helper" + echo "for portage to implement the 'preserve-libs' feature on AIX."=20 + } > "${ED}${contentmember}" || die "cannot create ${contentmember}" + chmod400files[${#chmod400files[@]}]=3D${ED}${contentmember} + done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1 + [[ ${#chmod400files[@]} =3D=3D 0 ]] || + chmod 0400 "${chmod400files[@]}" || die "cannot chmod ${chmod400files[= @]}" + + local preservemembers libmetadir prunedirs=3D() + local FILE MEMBER FLAGS + for archive in "${archives[@]}"; do + preservemembers=3D + while read line; do + [[ -n ${line} ]] || continue + FILE=3D MEMBER=3D FLAGS=3D + eval ${line} + [[ ${FILE} =3D=3D ${EROOT}${archive} ]] || + die "invalid result of aixdll-query for ${EROOT}${archive}" + [[ -n ${MEMBER} && " ${FLAGS} " =3D=3D *" SHROBJ "* ]] || continue + [[ ${archives_members} =3D=3D *":(${archive}[${MEMBER}]):"* ]] && co= ntinue + preservemembers=3D"${preservemembers} ${MEMBER}" + done <<-EOF + $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS) + EOF + [[ -n ${preservemembers} ]] || continue + einfo "preserving (on spec) ${archive}[${preservemembers# }]" + libmetadir=3D${ED}${archive%/*}/.${archive##*/} + mkdir "${libmetadir}" || die "cannot create ${libmetadir}" + pushd "${libmetadir}" >/dev/null || die "cannot cd to ${libmetadir}" + ${ar} -X32_64 -x "${EROOT}${archive}" ${preservemembers} || die "cann= ot unpack ${EROOT}${archive}" + chmod u+w ${preservemembers} || die "cannot chmod${preservemembers}" + ${strip} -X32_64 -e ${preservemembers} || die "cannot strip${preserve= members}" + ${ar} -X32_64 -q "${ED}${archive}" ${preservemembers} || die "cannot = update ${archive}" + eend $? + popd >/dev/null || die "cannot leave ${libmetadir}" + prunedirs[${#prunedirs[@]}]=3D${libmetadir} + done + [[ ${#prunedirs[@]} =3D=3D 0 ]] || + rm -rf "${prunedirs[@]}" || die "cannot prune ${prunedirs[@]}" + return 0 +} + +postinst_aix() { + if [[ ${CHOST} !=3D *-aix* ]] || hasq binchecks ${RESTRICT}; then + return 0 + fi + local MY_PR=3D${PR%r0} + local ar strip + if type ${CHOST}-ar >/dev/null 2>&1 && type ${CHOST}-strip >/dev/null = 2>&1; then + ar=3D${CHOST}-ar + strip=3D${CHOST}-strip + elif [[ ${CBUILD} =3D=3D "${CHOST}" ]] && type ar >/dev/null 2>&1 && t= ype strip >/dev/null 2>&1; then + ar=3Dar + strip=3Dstrip + elif [[ -x /usr/ccs/bin/ar && -x /usr/ccs/bin/strip ]]; then + ar=3D/usr/ccs/bin/ar + strip=3D/usr/ccs/bin/strip + else + die "cannot find where to use 'ar' and 'strip' from" + fi + local archives_members=3D archives=3D() activearchives=3D + local archive_member soname runpath needed + while read archive_member; do + archive_member=3D${archive_member#*;${EPREFIX}/} # drop "^type;EPREFI= X/" + soname=3D${archive_member#*;} + runpath=3D${soname#*;} + needed=3D${runpath#*;} + soname=3D${soname%%;*} + runpath=3D${runpath%%;*} + archive_member=3D${archive_member%%;*} # drop ";soname;runpath;needed= $" + [[ ${archive_member} =3D=3D *'['*']' ]] && continue + [[ "${soname};${runpath};${needed}" =3D=3D "${archive_member##*/};;" = ]] || continue + # most likely is an archive stub, we might have to + # drop members being preserved shared objects. + archives[${#archives[@]}]=3D${archive_member} + activearchives=3D"${activearchives}:(${archive_member}):" + done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1 + + local type allcontentmembers=3D oldarchives=3D() + local contentmember + while read type contentmember; do + [[ ${type} =3D=3D 'obj' ]] || continue + contentmember=3D${contentmember% *} # drop " timestamp$" + contentmember=3D${contentmember% *} # drop " hash$" + [[ ${contentmember##*/} =3D=3D *'['*']' ]] || continue + contentmember=3D${contentmember#${EPREFIX}/} + allcontentmembers=3D"${allcontentmembers}:(${contentmember}):" + contentmember=3D${contentmember%[*} + contentmember=3D${contentmember%/.*}/${contentmember##*/.} + [[ ${activearchives} =3D=3D *":(${contentmember}):"* ]] && continue + oldarchives[${#oldarchives[@]}]=3D${contentmember} + done < "${EPREFIX}/var/db/pkg/${CATEGORY}/${P}${MY_PR:+-}${MY_PR}/CONT= ENTS" + + local archive line delmembers + local FILE MEMBER FLAGS + for archive in "${archives[@]}"; do + [[ -r ${EROOT}${archive} && -w ${EROOT}${archive} ]] || + chmod a+r,u+w "${EROOT}${archive}" || die "cannot chmod ${EROOT}${arc= hive}" + delmembers=3D + while read line; do + [[ -n ${line} ]] || continue + FILE=3D MEMBER=3D FLAGS=3D + eval ${line} + [[ ${FILE} =3D=3D "${EROOT}${archive}" ]] || + die "invalid result '${FILE}' of aixdll-query, expected '${EROOT}${a= rchive}'" + [[ -n ${MEMBER} && " ${FLAGS} " =3D=3D *" SHROBJ "* ]] || continue + [[ ${allcontentmembers} =3D=3D *":(${archive%/*}/.${archive##*/}[${M= EMBER}]):"* ]] && continue + delmembers=3D"${delmembers} ${MEMBER}" + done <<-EOF + $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS) + EOF + [[ -n ${delmembers} ]] || continue + einfo "dropping ${archive}[${delmembers# }]" + rm -f "${EROOT}${archive}".new || die "cannot prune ${EROOT}${archive= }.new" + cp "${EROOT}${archive}" "${EROOT}${archive}".new || die "cannot backu= p ${archive}" + ${ar} -X32_64 -z -o -d "${EROOT}${archive}".new ${delmembers} || die = "cannot remove${delmembers} from ${archive}.new" + mv -f "${EROOT}${archive}".new "${EROOT}${archive}" || die "cannot pu= t ${EROOT}${archive} in place" + eend $? + done + local libmetadir keepmembers prunedirs=3D() + for archive in "${oldarchives[@]}"; do + [[ -r ${EROOT}${archive} && -w ${EROOT}${archive} ]] || + chmod a+r,u+w "${EROOT}${archive}" || die "cannot chmod ${EROOT}${arc= hive}" + keepmembers=3D + while read line; do + FILE=3D MEMBER=3D FLAGS=3D + eval ${line} + [[ ${FILE} =3D=3D "${EROOT}${archive}" ]] || + die "invalid result of aixdll-query for ${EROOT}${archive}" + [[ -n ${MEMBER} && " ${FLAGS} " =3D=3D *" SHROBJ "* ]] || continue + [[ ${allcontentmembers} =3D=3D *":(${archive%/*}/.${archive##*/}[${M= EMBER}]):"* ]] || continue + keepmembers=3D"${keepmembers} ${MEMBER}" + done <<-EOF + $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS) + EOF + + if [[ -n ${keepmembers} ]]; then + einfo "preserving (extra)${keepmembers}" + libmetadir=3D${EROOT}${archive%/*}/.${archive##*/} + [[ ! -e ${libmetadir} ]] || rm -rf "${libmetadir}" || die "cannot pr= une ${libmetadir}" + mkdir "${libmetadir}" || die "cannot create ${libmetadir}" + pushd "${libmetadir}" >/dev/null || die "cannot cd to ${libmetadir}" + ${ar} -X32_64 -x "${EROOT}${archive}" ${keepmembers} || die "cannot = unpack ${archive}" + ${strip} -X32_64 -e ${keepmembers} || die "cannot strip ${keepmember= s}" + rm -f "${EROOT}${archive}.new" || die "cannot prune ${EROOT}${archiv= e}.new" + ${ar} -X32_64 -q "${EROOT}${archive}.new" ${keepmembers} || die "can= not create ${EROOT}${archive}.new" + mv -f "${EROOT}${archive}.new" "${EROOT}${archive}" || die "cannot p= ut ${EROOT}${archive} in place" + popd > /dev/null || die "cannot leave ${libmetadir}" + prunedirs[${#prunedirs[@]}]=3D${libmetadir} + eend $? + fi + done + [[ ${#prunedirs[@]} =3D=3D 0 ]] || + rm -rf "${prunedirs[@]}" || die "cannot prune ${prunedirs[@]}" + return 0 +} + preinst_mask() { if [ -z "${D}" ]; then eerror "${FUNCNAME}: D is unset" diff --cc pym/_emerge/actions.py index a15f5e4,6379b36..1672d47 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@@ -28,10 -28,10 +28,10 @@@ from portage import o from portage import digraph from portage import _unicode_decode from portage.cache.cache_errors import CacheError -from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH +from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH, EPREFIX from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG from portage.dbapi.dep_expand import dep_expand - from portage.dep import Atom, extended_cp_match + from portage.dep import Atom, extended_cp_match, _get_useflag_re from portage.exception import InvalidAtom from portage.output import blue, bold, colorize, create_color_func, dar= kgreen, \ red, yellow diff --cc pym/portage/package/ebuild/doebuild.py index 94c0961,1c04822..ad48398 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@@ -1274,16 -1233,10 +1274,14 @@@ _post_phase_cmds =3D=20 "install_symlink_html_docs"], =20 "preinst" : [ + "preinst_aix", "preinst_sfperms", "preinst_selinux_labels", "preinst_suid_scan", - "preinst_mask"] + "preinst_mask"], + + "postinst" : [ - "postinst_aix", - "postinst_bsdflags"] ++ "postinst_aix"] } =20 def _post_phase_userpriv_perms(mysettings): diff --cc runtests.sh index 0ae4931,11aec60..dadd32d --- a/runtests.sh +++ b/runtests.sh @@@ -1,4 -1,6 +1,6 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ + # Copyright 2010-2011 Gentoo Foundation + # Distributed under the terms of the GNU General Public License v2 =20 PYTHON_VERSIONS=3D"2.6 2.7 3.1 3.2 3.3" =20 @@@ -24,9 -26,9 +26,9 @@@ trap interrupted SIGIN =20 exit_status=3D"0" for version in ${PYTHON_VERSIONS}; do - if [[ -x /usr/bin/python${version} ]]; then + if [[ -x @PREFIX_PORTAGE_PYTHON@${version} ]]; then echo -e "${GOOD}Testing with Python ${version}...${NORMAL}" - if ! @PREFIX_PORTAGE_PYTHON@${version} pym/portage/tests/runTests; th= en - if ! /usr/bin/python${version} pym/portage/tests/runTests "$@" ; then ++ if ! @PREFIX_PORTAGE_PYTHON@${version} pym/portage/tests/runTests "$@= " ; then echo -e "${BAD}Testing with Python ${version} failed${NORMAL}" exit_status=3D"1" fi