Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix
authorFabian Groffen <grobian@gentoo.org>
Mon, 2 May 2011 17:38:24 +0000 (19:38 +0200)
committerFabian Groffen <grobian@gentoo.org>
Mon, 2 May 2011 17:38:24 +0000 (19:38 +0200)
Conflicts:
bin/misc-functions.sh
pym/portage/package/ebuild/doebuild.py
runtests.sh

13 files changed:
1  2 
bin/ebuild.sh
bin/isolated-functions.sh
bin/misc-functions.sh
bin/repoman
man/emerge.1
pym/_emerge/Package.py
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/_emerge/emergelog.py
pym/_emerge/main.py
pym/portage/dbapi/bintree.py
pym/portage/package/ebuild/doebuild.py
runtests.sh

diff --cc bin/ebuild.sh
Simple merge
Simple merge
index 3bf506054dec93ec5456fcc4e3ba0ab91a136bd0,b28b73fff2fc3802c908f0bbc7334b62dfa22c99..dce730ac1825339f42c8098f4af0b39183cef376
mode 100644,100755..100644
@@@ -1249,220 -741,6 +1267,204 @@@ install_mask() 
        set -${shopts}
  }
  
- 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
- }
- 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
- }
 +preinst_aix() {
 +      if [[ ${CHOST} != *-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=${CHOST}-ar
 +              strip=${CHOST}-strip
 +      elif [[ ${CBUILD} == "${CHOST}" ]] && type ar >/dev/null 2>&1 && type strip >/dev/null 2>&1; then
 +              ar=ar
 +              strip=strip
 +      elif [[ -x /usr/ccs/bin/ar && -x /usr/ccs/bin/strip ]]; then
 +              ar=/usr/ccs/bin/ar
 +              strip=/usr/ccs/bin/strip
 +      else
 +              die "cannot find where to use 'ar' and 'strip' from"
 +      fi
 +      local archives_members= archives=() chmod400files=()
 +      local archive_member soname runpath needed archive contentmember
 +      while read archive_member; do
 +              archive_member=${archive_member#*;${EPREFIX}/} # drop "^type;EPREFIX/"
 +              soname=${archive_member#*;}
 +              runpath=${soname#*;}
 +              needed=${runpath#*;}
 +              soname=${soname%%;*}
 +              runpath=${runpath%%;*}
 +              archive_member=${archive_member%%;*} # drop ";soname;runpath;needed$"
 +              archive=${archive_member%[*}
 +              if [[ ${archive_member} != *'['*']' ]]; then
 +                      if [[ "${soname};${runpath};${needed}" == "${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[@]}]=${archive}
 +                      fi
 +                      continue
 +              fi
 +              archives_members="${archives_members}:(${archive_member}):"
 +              contentmember="${archive%/*}/.${archive##*/}${archive_member#${archive}}"
 +              # 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." 
 +              } > "${ED}${contentmember}" || die "cannot create ${contentmember}"
 +              chmod400files[${#chmod400files[@]}]=${ED}${contentmember}
 +      done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1
 +      [[ ${#chmod400files[@]} == 0 ]] ||
 +      chmod 0400 "${chmod400files[@]}" || die "cannot chmod ${chmod400files[@]}"
 +
 +      local preservemembers libmetadir prunedirs=()
 +      local FILE MEMBER FLAGS
 +      for archive in "${archives[@]}"; do
 +              preservemembers=
 +              while read line; do
 +                      [[ -n ${line} ]] || continue
 +                      FILE= MEMBER= FLAGS=
 +                      eval ${line}
 +                      [[ ${FILE} == ${EROOT}${archive} ]] ||
 +                      die "invalid result of aixdll-query for ${EROOT}${archive}"
 +                      [[ -n ${MEMBER} && " ${FLAGS} " == *" SHROBJ "* ]] || continue
 +                      [[ ${archives_members} == *":(${archive}[${MEMBER}]):"* ]] && continue
 +                      preservemembers="${preservemembers} ${MEMBER}"
 +              done <<-EOF
 +                      $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS)
 +              EOF
 +              [[ -n ${preservemembers} ]] || continue
 +              einfo "preserving (on spec) ${archive}[${preservemembers# }]"
 +              libmetadir=${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 "cannot unpack ${EROOT}${archive}"
 +              chmod u+w ${preservemembers} || die "cannot chmod${preservemembers}"
 +              ${strip} -X32_64 -e ${preservemembers} || die "cannot strip${preservemembers}"
 +              ${ar} -X32_64 -q "${ED}${archive}" ${preservemembers} || die "cannot update ${archive}"
 +              eend $?
 +              popd >/dev/null || die "cannot leave ${libmetadir}"
 +              prunedirs[${#prunedirs[@]}]=${libmetadir}
 +      done
 +      [[ ${#prunedirs[@]} == 0 ]] ||
 +      rm -rf "${prunedirs[@]}" || die "cannot prune ${prunedirs[@]}"
 +      return 0
 +}
 +
 +postinst_aix() {
 +      if [[ ${CHOST} != *-aix* ]] || hasq binchecks ${RESTRICT}; then
 +              return 0
 +      fi
 +      local MY_PR=${PR%r0}
 +      local ar strip
 +      if type ${CHOST}-ar >/dev/null 2>&1 && type ${CHOST}-strip >/dev/null 2>&1; then
 +              ar=${CHOST}-ar
 +              strip=${CHOST}-strip
 +      elif [[ ${CBUILD} == "${CHOST}" ]] && type ar >/dev/null 2>&1 && type strip >/dev/null 2>&1; then
 +              ar=ar
 +              strip=strip
 +      elif [[ -x /usr/ccs/bin/ar && -x /usr/ccs/bin/strip ]]; then
 +              ar=/usr/ccs/bin/ar
 +              strip=/usr/ccs/bin/strip
 +      else
 +              die "cannot find where to use 'ar' and 'strip' from"
 +      fi
 +      local archives_members= archives=() activearchives=
 +      local archive_member soname runpath needed
 +      while read archive_member; do
 +              archive_member=${archive_member#*;${EPREFIX}/} # drop "^type;EPREFIX/"
 +              soname=${archive_member#*;}
 +              runpath=${soname#*;}
 +              needed=${runpath#*;}
 +              soname=${soname%%;*}
 +              runpath=${runpath%%;*}
 +              archive_member=${archive_member%%;*} # drop ";soname;runpath;needed$"
 +              [[ ${archive_member} == *'['*']' ]] && continue
 +              [[ "${soname};${runpath};${needed}" == "${archive_member##*/};;" ]] || continue
 +              # most likely is an archive stub, we might have to
 +              # drop members being preserved shared objects.
 +              archives[${#archives[@]}]=${archive_member}
 +              activearchives="${activearchives}:(${archive_member}):"
 +      done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1
 +
 +      local type allcontentmembers= oldarchives=()
 +      local contentmember
 +      while read type contentmember; do
 +              [[ ${type} == 'obj' ]] || continue
 +              contentmember=${contentmember% *} # drop " timestamp$"
 +              contentmember=${contentmember% *} # drop " hash$"
 +              [[ ${contentmember##*/} == *'['*']' ]] || continue
 +              contentmember=${contentmember#${EPREFIX}/}
 +              allcontentmembers="${allcontentmembers}:(${contentmember}):"
 +              contentmember=${contentmember%[*}
 +              contentmember=${contentmember%/.*}/${contentmember##*/.}
 +              [[ ${activearchives} == *":(${contentmember}):"* ]] && continue
 +              oldarchives[${#oldarchives[@]}]=${contentmember}
 +      done < "${EPREFIX}/var/db/pkg/${CATEGORY}/${P}${MY_PR:+-}${MY_PR}/CONTENTS"
 +
 +      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}${archive}"
 +              delmembers=
 +              while read line; do
 +                      [[ -n ${line} ]] || continue
 +                      FILE= MEMBER= FLAGS=
 +                      eval ${line}
 +                      [[ ${FILE} == "${EROOT}${archive}" ]] ||
 +                      die "invalid result '${FILE}' of aixdll-query, expected '${EROOT}${archive}'"
 +                      [[ -n ${MEMBER} && " ${FLAGS} " == *" SHROBJ "* ]] || continue
 +                      [[ ${allcontentmembers} == *":(${archive%/*}/.${archive##*/}[${MEMBER}]):"* ]] && continue
 +                      delmembers="${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 backup ${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 put ${EROOT}${archive} in place"
 +              eend $?
 +      done
 +      local libmetadir keepmembers prunedirs=()
 +      for archive in "${oldarchives[@]}"; do
 +              [[ -r ${EROOT}${archive} && -w ${EROOT}${archive} ]] ||
 +              chmod a+r,u+w "${EROOT}${archive}" || die "cannot chmod ${EROOT}${archive}"
 +              keepmembers=
 +              while read line; do
 +                      FILE= MEMBER= FLAGS=
 +                      eval ${line}
 +                      [[ ${FILE} == "${EROOT}${archive}" ]] ||
 +                      die "invalid result of aixdll-query for ${EROOT}${archive}"
 +                      [[ -n ${MEMBER} && " ${FLAGS} " == *" SHROBJ "* ]] || continue
 +                      [[ ${allcontentmembers} == *":(${archive%/*}/.${archive##*/}[${MEMBER}]):"* ]] || continue
 +                      keepmembers="${keepmembers} ${MEMBER}"
 +              done <<-EOF
 +                      $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS)
 +              EOF
 +
 +              if [[ -n ${keepmembers} ]]; then
 +                      einfo "preserving (extra)${keepmembers}"
 +                      libmetadir=${EROOT}${archive%/*}/.${archive##*/}
 +                      [[ ! -e ${libmetadir} ]] || rm -rf "${libmetadir}" || die "cannot prune ${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 ${keepmembers}"
 +                      rm -f "${EROOT}${archive}.new" || die "cannot prune ${EROOT}${archive}.new"
 +                      ${ar} -X32_64 -q "${EROOT}${archive}.new" ${keepmembers} || die "cannot create ${EROOT}${archive}.new"
 +                      mv -f "${EROOT}${archive}.new" "${EROOT}${archive}" || die "cannot put ${EROOT}${archive} in place"
 +                      popd > /dev/null || die "cannot leave ${libmetadir}"
 +                      prunedirs[${#prunedirs[@]}]=${libmetadir}
 +                      eend $?
 +              fi
 +      done
 +      [[ ${#prunedirs[@]} == 0 ]] ||
 +      rm -rf "${prunedirs[@]}" || die "cannot prune ${prunedirs[@]}"
 +      return 0
 +}
 +
  preinst_mask() {
        if [ -z "${D}" ]; then
                 eerror "${FUNCNAME}: D is unset"
diff --cc bin/repoman
Simple merge
diff --cc man/emerge.1
Simple merge
Simple merge
index a15f5e4de0c6c351aaa28c84c827f9d6be84cce2,6379b368a37b58f72d2189fb0cec4e7a8392a8c5..1672d4753d1f9a5082fea2cb6ad06d29cb9fb1e6
@@@ -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, darkgreen, \
        red, yellow
Simple merge
Simple merge
Simple merge
Simple merge
index 94c0961f888b928cc7fff697889d2430078ff09e,1c0482224936826cd2ba818ce25121cc9861c4ce..ad483989e7f56d771f3826bc69bc3d19171c0667
@@@ -1274,16 -1233,10 +1274,14 @@@ _post_phase_cmds = 
                "install_symlink_html_docs"],
  
        "preinst" : [
-               "preinst_bsdflags",
 +              "preinst_aix",
                "preinst_sfperms",
                "preinst_selinux_labels",
                "preinst_suid_scan",
 -              "preinst_mask"]
 +              "preinst_mask"],
 +
 +      "postinst" : [
-               "postinst_aix",
-               "postinst_bsdflags"]
++              "postinst_aix"]
  }
  
  def _post_phase_userpriv_perms(mysettings):
diff --cc runtests.sh
index 0ae49315f445681be15b1c143ef430a38f31f65c,11aec60f52eaf6f692f5764fc7cc77ed9b907b64..dadd32db1c4ab403d9e41380b7fd2ace46658385
@@@ -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
  
  PYTHON_VERSIONS="2.6 2.7 3.1 3.2 3.3"
  
@@@ -24,9 -26,9 +26,9 @@@ trap interrupted SIGIN
  
  exit_status="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; then
 -              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="1"
                fi