Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67190 - INSTALL_MASK setting
Summary: INSTALL_MASK setting
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-10-11 20:50 UTC by Brian Jackson (RETIRED)
Modified: 2005-04-26 16:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
portage-install-mask.patch (portage-install-mask.patch,1.47 KB, patch)
2004-10-16 15:33 UTC, Brian Jackson (RETIRED)
Details | Diff
portage-install-mask.patch.2 (portage-install-mask.patch.2,799 bytes, patch)
2004-11-03 08:52 UTC, Brian Jackson (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Jackson (RETIRED) gentoo-dev 2004-10-11 20:50:57 UTC
I think it probably needs a little more work, but this is what I have so far


--- /usr/lib/portage/bin/ebuild.sh.orig 2004-10-06 21:00:11 +0000
+++ /usr/lib/portage/bin/ebuild.sh      2004-10-12 03:47:40 +0000
@@ -1005,6 +1005,23 @@

        pkg_preinst

+       # hopefully this will someday allow us to get rid of the no* feature flags
+       for no_inst in ${INSTALL_MASK} ; do
+               # if it's a dir, remove the whole thing
+               echo "${IMAGE}/${no_inst}"
+               if [ -d "${IMAGE}/${no_inst}" ] ; then
+                       einfo "Removing ${no_inst}"
+                       rm -Rf ${IMAGE}/${no_inst}
+                       continue
+               fi
+
+               # try to find and remove anything else
+               einfo "Removing files matching ${no_inst}"
+               echo "find ${IMAGE} -name '${no_inst}' -exec rm -fR {} \;"
+               find "${IMAGE}" -name ${no_inst}
+               find "${IMAGE}" -name ${no_inst} -exec rm -fR {} \;
+       done
+
        # remove man pages
        if hasq noman $FEATURES; then
                rm -fR "${IMAGE}/usr/share/man"
Comment 1 solar (RETIRED) gentoo-dev 2004-10-16 15:12:31 UTC
Using INSTALL_MASK="*.a *.h /usr/include /usr/lib/*.o " would sure make my life eaiser. I hope this one gets merged before .51 final. 
Comment 2 Brian Jackson (RETIRED) gentoo-dev 2004-10-16 15:33:42 UTC
Created attachment 41991 [details, diff]
portage-install-mask.patch
Comment 3 Brian Jackson (RETIRED) gentoo-dev 2004-10-18 07:42:16 UTC
solar and I were talking, and thought an additional line might be useful, and
would give all the expected behavior that most people would want out of this
feature:
rm -rf "${IMAGE}/${no_inst}"
Comment 4 Brian Harring (RETIRED) gentoo-dev 2004-10-28 04:39:35 UTC
Not sure if I like mixing dir names w/ find patterns.. potentially two vars?
Comment 5 Brian Jackson (RETIRED) gentoo-dev 2004-11-03 08:49:21 UTC
new patch that fixes the INSTALL_MASK="/usr/lib/*.o" case



--- /usr/lib/portage/bin/ebuild.sh.orig 2004-11-03 16:46:55 +0000
+++ /usr/lib/portage/bin/ebuild.sh      2004-10-28 18:15:57 +0000
@@ -1005,6 +1005,23 @@
 
        pkg_preinst
 
+       # hopefully this will someday allow us to get rid of the no* feature flags
+       # we don't want globbing for initial expansion, but afterwards, we do
+       local shopts=$-
+       set -o noglob
+       for no_inst in `echo "${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}
+
        # remove man pages
        if hasq noman $FEATURES; then
                rm -fR "${IMAGE}/usr/share/man"
Comment 6 Brian Jackson (RETIRED) gentoo-dev 2004-11-03 08:52:16 UTC
Created attachment 43226 [details, diff]
portage-install-mask.patch.2

updated patch that handles /usr/lib/*.o correctly
Comment 7 solar (RETIRED) gentoo-dev 2004-11-03 09:54:59 UTC
Iggy: Tested with patch2. It's working good and this revision is much cleaner I like it.

Brian Harring I don't get the dirname with filenames part. What concerns you?

Only thing that concerns me at all is if something like this were to ever happen 
INSTALL_MASK="../../../../../../../*" which could get turned into 
${IMAGE}/../../.. -> $ROOT
Perhaps using -xdev with the find command would be ideal?
Comment 8 Brian Harring (RETIRED) gentoo-dev 2004-11-07 11:27:50 UTC
In head now.
Comment 9 Jason Stubbs (RETIRED) gentoo-dev 2005-01-02 01:03:56 UTC
Added to portage_2_0
Comment 10 solar (RETIRED) gentoo-dev 2005-01-12 19:27:00 UTC
=sys-apps/portage-2.0.51-r10 includes INSTALL_MASK support
Comment 11 Peter Kovacs 2005-03-08 00:19:03 UTC
Hello.

Since I caqnot read skripts that well. Can you give a short description for what INSTALL_MASK Can be used? - I mean it is a "not documented feature" whch could be useful to others.
(If I am overlooked the place of the doc pleas point me there.)
thx a lot.
Comment 12 Brian Jackson (RETIRED) gentoo-dev 2005-03-08 04:58:18 UTC
It's intentionally not documented. When we feel it's ready for general consumption, we will document it in the proper place.
Comment 13 Brian Jackson (RETIRED) gentoo-dev 2005-04-26 16:59:09 UTC
Went in a while back