summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-28 10:37:47 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-28 10:37:47 +0000
commit9d32ae401ea25227bd8bcfe7dfaad6c06e349a6b (patch)
tree5885d796649904e5c7bda8ed241b1f51f4a81552 /bin/misc-functions.sh
parentAvoid a TypeError with emerge -kN when there's no matching ebuild. (diff)
downloadportage-multirepo-9d32ae401ea25227bd8bcfe7dfaad6c06e349a6b.tar.gz
portage-multirepo-9d32ae401ea25227bd8bcfe7dfaad6c06e349a6b.tar.bz2
portage-multirepo-9d32ae401ea25227bd8bcfe7dfaad6c06e349a6b.zip
Use mtree to save/restore bsd file flags before/after prepall and installation. Thanks to Diego Pettenò for this patch (related to bug #153109).
svn path=/main/trunk/; revision=4863
Diffstat (limited to 'bin/misc-functions.sh')
-rwxr-xr-xbin/misc-functions.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 9ae010e4..3a1826e6 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -243,6 +243,24 @@ install_mask() {
set -${shopts}
}
+preinst_bsdflags() {
+ type -p chflags &>/dev/null || return 0
+ type -p mtree &>/dev/null || return 1
+ # 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() {
+ type -p chflags &>/dev/null || return 0
+ type -p mtree &>/dev/null || return 1
+ # Restore all the file flags that were saved before installation.
+ mtree -e -p "${ROOT}" -U -k flags < "${T}/bsdflags.mtree" &> /dev/null
+}
+
preinst_mask() {
if [ -z "$IMAGE" ]; then
eerror "${FUNCNAME}: IMAGE is unset"