I just found out the hard way that having absolute paths in "INSTALL_MASK" does not do exactly what I thought it would. The difference is felt when you have wildcards. For example, I have the following INSTALL_MASK to preventively purge any locales that I am not interested in: /usr/share/locale/[^bej]*/ /usr/share/locale/b[^g]*/... etc. However, these wildcards get matched against the live filesystem. So, if a package installs a locale that I don't yet have on the real filesystem, the wildcard won't match and the locale will get though. Here is a "steps to reproduce" (picking a random small package): 1. emerge -C eselect-vi (make sure you don't have this one) 2. env INSTALL_MASK='/usr/share/eselect/modules/*.eselect' emerge eselect-vi Expected results: /usr/share/eselect/modules/vi.eselect not getting merged Actual results: /usr/share/eselect/modules/vi.eselect is merged I could agree that this is desired behavior, but please at least add a mention in the manpage. Everywhere I've looked I've seen absolute paths given as examples ("/usr/share/info" being a common one) and that has lead me (and maybe others) off-track. I can confirm that removing the leading slashes from all entries in INSTALL_MASK had the desired effect. I would personally favor a warning (is that an overkill?) when an absolute path is encountered in INSTALL_MASK.
Additional note. I wanted to strip the leading slashes automatically, but it is not trivial to do in bash considering that what we are starting with is not an array. I was looking at bin/misc-functions.sh and the call to install_mask() from preinst_mask() is where the wildcards are expanded. Not an easy task, but I guess a warning would be good...
Hmm, when I read the code correctly then absolute paths should just work as intended (matched against $IMAGE).
(In reply to comment #2) > Hmm, when I read the code correctly then absolute paths should just work as > intended (matched against $IMAGE). Not if you have wildcards. The wildcards are expanded when the mask is passed to install-mask() and if the path is absolute they get matched against the live system. For example: # env INSTALL_MASK='/usr/share/eselect/modules/*.eselect' emerge eselect-vi ... snip ... >>> Done. * checking 1 files for package collisions >>> Merging app-admin/eselect-vi-1.1.4 to / * Removing /usr/share/eselect/modules/bashcomp.eselect * Removing /usr/share/eselect/modules/binutils.eselect * Removing /usr/share/eselect/modules/env.eselect * Removing /usr/share/eselect/modules/java-nsplugin.eselect * Removing /usr/share/eselect/modules/java-vm.eselect * Removing /usr/share/eselect/modules/kernel.eselect * Removing /usr/share/eselect/modules/mailer.eselect * Removing /usr/share/eselect/modules/news.eselect * Removing /usr/share/eselect/modules/opengl.eselect * Removing /usr/share/eselect/modules/profile.eselect * Removing /usr/share/eselect/modules/rc.eselect * Removing /usr/share/eselect/modules/repo.eselect * Removing /usr/share/info --- /usr/ --- /usr/share/ --- /usr/share/eselect/ --- /usr/share/eselect/modules/ >>> /usr/share/eselect/modules/vi.eselect >>> app-admin/eselect-vi-1.1.4 merged.
Hmm, so we'd have to disable globbing also before calling install_mask(). Mike, Ned, what do you think about that?
for sanity sake, we can just prefix each argument with ./ while processing ...
(In reply to comment #5) > for sanity sake, we can just prefix each argument with ./ while processing ... Your choice.