diff options
author | Ned Ludd <solar@gentoo.org> | 2006-03-08 03:39:54 +0000 |
---|---|---|
committer | Ned Ludd <solar@gentoo.org> | 2006-03-08 03:39:54 +0000 |
commit | eac80379527df3ec32fc59fc12848cae4e17e244 (patch) | |
tree | 68d512c9258236aa76c001a3135a20a3a9ec30c6 | |
parent | d6f586195be07a21b0e2ebb12c138c74281d48cb (diff) | |
download | portage-eac80379527df3ec32fc59fc12848cae4e17e244.tar.gz portage-eac80379527df3ec32fc59fc12848cae4e17e244.tar.bz2 portage-eac80379527df3ec32fc59fc12848cae4e17e244.zip |
- commit initial split install masking code. this commits adds new portage variable PKG_INSTALL_MASK for fine tuning what gets added to the binary .tbz2 and xpak data. This function will probably be later split out into a misc-functions.sh by zac
svn path=/main/trunk/; revision=2825
-rwxr-xr-x | bin/ebuild.sh | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index b369d1f38..546182ee4 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1069,6 +1069,9 @@ dyn_install() { prepall cd "${D}" + # Allow user to remove unwanted files. + install_mask "${D}" ${PKG_INSTALL_MASK} + declare -i UNSAFE=0 for i in $(find "${D}/" -type f -perm -2002); do ((UNSAFE++)) @@ -1298,6 +1301,28 @@ dyn_install() { trap SIGINT SIGQUIT } +install_mask() { + local root="$1" + shift + local install_mask="$*" + + # we don't want globbing for initial expansion, but afterwards, we do + local shopts=$- + set -o noglob + for no_inst in ${install_mask}; do + set +o noglob + einfo "Removing ${no_inst}" + # normal stuff + rm -Rf ${root}/${no_inst} >&/dev/null + + # we also need to handle globs (*.a, *.h, etc) + find "${root}" -name ${no_inst} -exec rm -fR {} \; >&/dev/null + done + # set everything back the way we found it + set +o noglob + set -${shopts} +} + dyn_preinst() { # set IMAGE depending if this is a binary or compile merge [ "${EMERGE_FROM}" == "binary" ] && IMAGE=${PKG_TMPDIR}/${PF}/bin \ @@ -1315,21 +1340,7 @@ dyn_preinst() { fi done - # we don't want globbing for initial expansion, but afterwards, we do - local shopts=$- - set -o noglob - for no_inst in ${INSTALL_MASK}; do - set +o noglob - einfo "Removing ${no_inst}" - # normal stuff - rm -Rf ${IMAGE}/${no_inst} >&/dev/null - - # we also need to handle globs (*.a, *.h, etc) - find "${IMAGE}" -name ${no_inst} -exec rm -fR {} \; >&/dev/null - done - # set everything back the way we found it - set +o noglob - set -${shopts} + install_mask "${IMAGE}" ${INSTALL_MASK} # remove share dir if unnessesary if hasq nodoc $FEATURES -o hasq noman $FEATURES -o hasq noinfo $FEATURES; then |