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.
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
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
}
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
}
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
}
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