Make portage.bsd_chflags correspond to FEATURES=chflags so that it can be
authorZac Medico <zmedico@gentoo.org>
Mon, 13 Apr 2009 21:21:53 +0000 (21:21 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 13 Apr 2009 21:21:53 +0000 (21:21 -0000)
used for related conditionals in shell code.

svn path=/main/trunk/; revision=13342

bin/ebuild-helpers/prepall
bin/ebuild.sh
bin/misc-functions.sh
pym/portage/__init__.py

index eec5c814c9150b4fefec6ed9896a3641cfca8f69..da37f571d2d91efa994471c7f4acaee2fa7ebbcf 100755 (executable)
@@ -5,7 +5,7 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
-if type -P chflags > /dev/null && type -P mtree > /dev/null ; then
+if hasq chflags $FEATURES ; then
        # Save all the file flags for restoration at the end of prepall.
        mtree -c -p "${D}" -k flags > "${T}/bsdflags.mtree"
        # Remove all the file flags so that prepall can do anything necessary.
@@ -18,7 +18,7 @@ prepallinfo
 
 prepallstrip
 
-if type -P chflags > /dev/null && type -P mtree > /dev/null; then
+if hasq chflags $FEATURES ; then
        # Restore all the file flags that were saved at the beginning of prepall.
        mtree -U -e -p "${D}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
 fi
index 8fad20b877564f6ffea3ce373e96c3885d25c6f4..6e5d483e3a3b7d43927580d01f22d3451758cba6 100755 (executable)
@@ -698,7 +698,7 @@ dyn_clean() {
        elif [ ! -d "${PORTAGE_BUILDDIR}" ] ; then
                return 0
        fi
-       if type -P chflags > /dev/null ; then
+       if hasq chflags $FEATURES ; then
                chflags -R noschg,nouchg,nosappnd,nouappnd "${PORTAGE_BUILDDIR}"
                chflags -R nosunlnk,nouunlnk "${PORTAGE_BUILDDIR}" 2>/dev/null
        fi
index 9ffbe0eccf27971a90518e24fc7be27f51d856d7..5e7d29b79a9da9fc494cc4b639edd05c572175e0 100755 (executable)
@@ -492,8 +492,7 @@ install_mask() {
 }
 
 preinst_bsdflags() {
-       type -P chflags > /dev/null || return 0
-       type -P mtree > /dev/null || return 1
+       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
@@ -503,8 +502,7 @@ preinst_bsdflags() {
 }
 
 postinst_bsdflags() {
-       type -P chflags > /dev/null || return 0
-       type -P mtree > /dev/null || return 1
+       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
 }
index a658f90a3e70653c60d03e117ecb9d85d8c3a03b..520eb61d87122760b93682273faa8aa73cf88932 100644 (file)
@@ -1842,6 +1842,9 @@ class config(object):
                                if "usersandbox" in self.features:
                                        self.features.remove("usersandbox")
 
+                       if bsd_chflags:
+                               self.features.add('chflags')
+
                        self["FEATURES"] = " ".join(sorted(self.features))
                        self.backup_changes("FEATURES")
                        global _glep_55_enabled, _validate_cache_for_unsupported_eapis