512feb33a98d04c3998590d14f821d01d35c37dd
[portage.git] / bin / ebuild-helpers / prepall
1 #!/bin/bash
2 # Copyright 1999-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
7 [[ " ${USE} " == *" prefix "* ]] || \
8         case "$EAPI" in 0|1|2) ED=${D} ;; esac
9
10 if has chflags $FEATURES ; then
11         # Save all the file flags for restoration at the end of prepall.
12         mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
13         # Remove all the file flags so that prepall can do anything necessary.
14         chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
15         chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
16 fi
17
18 prepallman
19 prepallinfo
20
21 prepallstrip
22
23 if has chflags $FEATURES ; then
24         # Restore all the file flags that were saved at the beginning of prepall.
25         mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
26 fi