Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 396315 - PKG_INSTALL_MASK is not supported by quickpkg
Summary: PKG_INSTALL_MASK is not supported by quickpkg
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-28 15:04 UTC by Joakim Tjernlund
Modified: 2011-12-31 21:18 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2011-12-28 15:04:04 UTC
Creating binary pkgs with quickpkg (sys-apps/portage) using PKG_INSTALL_MASK
does not exclude files in PKG_INSTALL_MASK from the binary package.

The docs hints that PKG_INSTALL_MASK should do that for binary pkgs.

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2011-12-28 18:45:45 UTC
It's really intended for use with FEATURES=buidpkg, rather than quickpkg. Since quickpkg does not use a temporary directory to create the tar file, it can't use the existing PKG_INSTALL_MASK code. Rather than implement this behavior for quickpkg, I'd prefer to simply note in the documentation that PKG_INSTALL_MASK is not supported by quickpkg.
Comment 2 Joakim Tjernlund 2011-12-29 09:46:17 UTC
Perhaps it is possible to use tar --exclude PATTERN?

I am guessing here mainly because the semantics of
INSTALL_MASK value range isn't documented.
Comment 3 Joakim Tjernlund 2011-12-29 14:48:51 UTC
Perhaps I should mention that I think quickpkg is very valuable for
embedded development.
Build you apps/libs into a target root fs. Possibly tweak some
stuff in the root fs and when you are happy, use quickpkg
to package them, using PKG_INSTALL_MASK to omit unwanted
files on the target.
Comment 4 Zac Medico gentoo-dev 2011-12-29 21:04:56 UTC
(In reply to comment #2)
> Perhaps it is possible to use tar --exclude PATTERN?

In order to avoid copying files to a temporary directory, we're using python's tarfile module rather than the tar program. So, it we's probably want to use python's glob module to implement the pattern matching.

> I am guessing here mainly because the semantics of
> INSTALL_MASK value range isn't documented.

Here's the relevant snippet of code:

for no_inst in ${install_mask}; do
	# normal stuff
	rm -Rf "${root}"/${no_inst} >&/dev/null

	# we also need to handle globs (*.a, *.h, etc)
	find "${root}" \( -path "${no_inst}" -or -name "${no_inst}" \) \
		-exec rm -fR {} \; >/dev/null 2>&1
done

That should be easy to emulate with python's glob module.
Comment 5 Joakim Tjernlund 2011-12-30 15:26:08 UTC
I see how works now, thanks.

One thing I miss though is the ability to keep some files and remove
everyone else. That would imply some NOT operator though.
I guess that isn't available with globbing?
Comment 6 Zac Medico gentoo-dev 2011-12-30 15:48:07 UTC
No, there's no NOT operator, but I guess we could add INSTALL and PKG_INSTALL variables to control which files are allowed to be installed.
Comment 7 Joakim Tjernlund 2011-12-30 18:50:51 UTC
That would be awesome!

First PKG_INSTALL/INSTALL(INSTALL is a bit generic and could clash) would
generate the complete file list and the INSTALL_MASK would be applied
afterwards.

Perhaps PKG_INSTALL_LIST/INSTALL_LIST are better names?

solar, adding you too for portage-utils support too :)
Comment 8 solar (RETIRED) gentoo-dev 2011-12-31 01:46:52 UTC
Removing myself and adding portage-utils@ 

Why would we need a new variable name?
Comment 9 SpanKY gentoo-dev 2011-12-31 03:58:25 UTC
is that necessary ?  couldn't we use python's glob to expand everything, and then handle the "not" logic ourselves ?
Comment 10 Zac Medico gentoo-dev 2011-12-31 09:30:19 UTC
(In reply to comment #9)
> is that necessary ?  couldn't we use python's glob to expand everything, and
> then handle the "not" logic ourselves ?

I'm not sure I understand the question. No one's saying that python's glob/fnmatch modules can't be used to support PKG_INSTALL_MASK in quickpkg. Is that what you're asking about?

The PKG_INSTALL_LIST/INSTALL_LIST idea is about adding a way to do the inverse of PKG_INSTALL_MASK/INSTALL_MASK, where you specify which files you want instead of which files you don't want.
Comment 11 Joakim Tjernlund 2011-12-31 10:49:45 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > is that necessary ?  couldn't we use python's glob to expand everything, and
> > then handle the "not" logic ourselves ?
> 
> I'm not sure I understand the question. No one's saying that python's
> glob/fnmatch modules can't be used to support PKG_INSTALL_MASK in quickpkg. Is
> that what you're asking about?
> 
> The PKG_INSTALL_LIST/INSTALL_LIST idea is about adding a way to do the inverse
> of PKG_INSTALL_MASK/INSTALL_MASK, where you specify which files you want
> instead of which files you don't want.

Me too, how would we handle not logic if no new variable?

I guess we could extend the syntax for INSTALL_MASK to include
NOT logic but would not that interfere with globbing?
Comment 12 SpanKY gentoo-dev 2011-12-31 21:18:28 UTC
sorry, i misread comment #5.  if quickpkg installs PKG_INSTALL_MASK now, then that's all i was concerned with.