Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 219286 - INSTALL_MASK does nothing for installing .tbz2 from a binary repository
Summary: INSTALL_MASK does nothing for installing .tbz2 from a binary repository
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL: http://www.nabble.com/emerge-tbz2%27s...
Whiteboard:
Keywords: InVCS, REGRESSION
: 219287 (view as bug list)
Depends on:
Blocks: 216231
  Show dependency tree
 
Reported: 2008-04-25 18:05 UTC by Christopher Friedt
Modified: 2008-05-06 08:38 UTC (History)
2 users (show)

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


Attachments
fix environment handling for INSTALL_MASK (install_mask.patch,821 bytes, patch)
2008-05-05 06:04 UTC, Zac Medico
Details | Diff
fix INSTALL_MASK (install_mask.patch,1.33 KB, patch)
2008-05-05 21:57 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Friedt 2008-04-25 18:05:39 UTC
I'm trying to use INSTALL_MASK="*.h *.la *.a *.pc" to filter out files when I install packages from an http repository.

It doesn't work. Please see URL for all information such as make.conf, emerge --info, output, etc.

Reproducible: Always

Steps to Reproduce:
1.steps to reproduce are outlined in the URL
2.
3.

Actual Results:  
.h, .a, and .la files in question exist after installation

Expected Results:  
.h, .a, and .la files should not be installed

I can use qmerge for now and it will strip the packages appropriately, but qmerge doesn't handle dependency resolution nearly as well as emerge does. So right now i'm stuck first running emerge -pv, processing the output, and then running qmerge on each individual package.

This might be considered a duplicate of bug number 81025, but I don't have sufficient privileges to reopen the bug
http://bugs.gentoo.org/show_bug.cgi?id=81025
Comment 1 solar (RETIRED) gentoo-dev 2008-04-25 18:13:20 UTC
This is not a dupe of that other bug. This is a newly introduced regression.
I'm able to reproduce it also using sys-apps/portage-2.1.4.4

cd /dev/shm/
ROOT=$PWD/ INSTALL_MASK="bb"  emerge -Kq busybox
Comment 2 Christopher Friedt 2008-04-25 18:44:12 UTC
*** Bug 219287 has been marked as a duplicate of this bug. ***
Comment 3 Christopher Friedt 2008-04-29 13:55:35 UTC
INSTALL_MASK has no effect if it's defined in /etc/make.conf, but if it's exported as an environment variable it works without a problem.
Comment 4 Christopher Friedt 2008-04-29 13:57:35 UTC
(In reply to comment #3)
> INSTALL_MASK has no effect if it's defined in /etc/make.conf, but if it's
> exported as an environment variable it works without a problem.
> 

Sorry, that's incorrect. There are still installed .h files when I emerge to a completely blank filesystem.

Comment 5 Zac Medico gentoo-dev 2008-05-05 06:04:57 UTC
Created attachment 151887 [details, diff]
fix environment handling for INSTALL_MASK
Comment 6 Christopher Friedt 2008-05-05 12:41:39 UTC
(In reply to comment #5)
> Created an attachment (id=151887) [edit]
> fix environment handling for INSTALL_MASK
> 

# cd /dev/shm
# ROOT=${PWD} INSTALL_MASK="*.h" emerge -Kv --nodeps zlib
...
# find . -name '*.h'
#

Excellent! Thanks a lot Zac - I was attempting to dig through the portage source code to try and fix this myself, but I really couldn't find where to begin. 

Oddly though, using INSTALL_MASK="bb" still doesn't strip out /bin/bb if I follow Ned's test below. Things like *.h, *.la, /usr/share, etc, work fine though. 

Do you think that this will find its way (back) into the main portage source?
Should I mark the bug as fixed or wait until it's back in portage?
Comment 7 Zac Medico gentoo-dev 2008-05-05 16:23:35 UTC
(In reply to comment #6)
> Oddly though, using INSTALL_MASK="bb" still doesn't strip out /bin/bb if I
> follow Ned's test below. Things like *.h, *.la, /usr/share, etc, work fine
> though. 

If you set INSTALL_MASK="*/bb" that will cause the find command in bin/misc-functions.sh to match it:

	set -o noglob
	for no_inst in ${install_mask}; do
		set +o noglob
		quiet_mode || einfo "Removing ${no_inst}"
		# normal stuff
		rm -Rf "${root}"/${no_inst} >&/dev/null
	
		# we also need to handle globs (*.a, *.h, etc)
		find "${root}" -path "${no_inst}" -exec rm -fR {} \; >/dev/null
	done


> Do you think that this will find its way (back) into the main portage source?
> Should I mark the bug as fixed or wait until it's back in portage?

I'll mark it fixed pretty soon when portage-2.1.5_rc7 is released with the patch.
Comment 8 solar (RETIRED) gentoo-dev 2008-05-05 16:59:21 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Oddly though, using INSTALL_MASK="bb" still doesn't strip out /bin/bb if I
> > follow Ned's test below. Things like *.h, *.la, /usr/share, etc, work fine
> > though. 
> 
> If you set INSTALL_MASK="*/bb" that will cause the find command in
> bin/misc-functions.sh to match it:

That is a change in behavior. Is it unavoidable?

find "${root}" -path "${no_inst}" -exec rm -fR {} \; >/dev/null
Would -o -name "{$no_inst}" also do the trick?

The old syntax worked as such "/bin/{busybox,bb,foo} *.a /path/to/file base_name_file"
Comment 9 Mike Doty (RETIRED) gentoo-dev 2008-05-05 18:22:27 UTC
this blocks emul-linux-x86-* building.
Comment 10 Zac Medico gentoo-dev 2008-05-05 21:57:02 UTC
Created attachment 152019 [details, diff]
fix INSTALL_MASK

(In reply to comment #8)
> find "${root}" -path "${no_inst}" -exec rm -fR {} \; >/dev/null
> Would -o -name "{$no_inst}" also do the trick?

That's included in this new patch.

(In reply to comment #9)
> this blocks emul-linux-x86-* building.

You can apply this patch to portage if you want. It's going to be released in portage-2.1.5_rc7 later today.
Comment 11 Christopher Friedt 2008-05-06 02:45:35 UTC
(In reply to comment #10)
> Created an attachment (id=152019) [edit]
> fix INSTALL_MASK
> 
> (In reply to comment #8)
> > find "${root}" -path "${no_inst}" -exec rm -fR {} \; >/dev/null
> > Would -o -name "{$no_inst}" also do the trick?
> 
> That's included in this new patch.
> 
> (In reply to comment #9)
> > this blocks emul-linux-x86-* building.
> 
> You can apply this patch to portage if you want. It's going to be released in
> portage-2.1.5_rc7 later today.
> 

I just tried this patch and it doesn't work. It seems that -name /usr/share/doc is not cut out. Apparently -name only works for files and not directories. 

I think that the previous patch worked, so I might go back to using that.
Comment 12 Zac Medico gentoo-dev 2008-05-06 04:28:45 UTC
(In reply to comment #11)
> I just tried this patch and it doesn't work. It seems that -name /usr/share/doc
> is not cut out. Apparently -name only works for files and not directories. 

I don't see how this is a problem because /usr/share/doc should be removed by the rm -Rf "${root}"/${no_inst} part.
Comment 13 Zac Medico gentoo-dev 2008-05-06 08:38:29 UTC
This patch is included in 2.1.5_rc7. Please reopen if there are any more problems.