[gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Michał Górny
Hello, all.

Some time ago I wrote a small tool called install-mask. As the name
suggests, it was intended to help with manipulating INSTALL_MASK.
I think that its most important feature was ability to use pre-defined
mask lists to easily mask unwanted directories without getting into
the details.

For example, you could do:

  install-mask -a systemd

and it masked all directories related to systemd that were safe to be
masked.

The original solution had a few weak points, however, and since it was
an external tool it didn't help most of the Gentoo users. For this
reason, I wanted to implement the necessary bits in portage itself. Now
kensington reminded me of it and offered to work on it, so I'd like to
revive the topic.

What we need is an agreement where to put the 'mask lists'. That is, we
need a mapping of pre-defined keys to descriptions  lists of paths.
I have two ideas.


IDEA ONE

I'm thinking of doing something similar to USE_EXPAND. That is,
a structure like:

- a top-level install-mask.desc that keeps mapping of keys to
  descriptions,

- install-mask directory where each file name matches the install-mask
  key and file contents list all the paths.

For example:

install-mask.desc:

  bash-completion: app-shells/bash completions
  systemd: sys-apps/systemd unit files and auxiliary files

install-mask/bash-completion:

  /usr/share/bash-completion

install-mask/systemd:

  /usr/lib/systemd/system
  /usr/lib/systemd/user


IDEA TWO

A single file with ini-like syntax (alike layout.conf) that holds all
the info. Such file can be found already in
$PORTDIR/app-portage/install-mask/files/location-db.conf:

Example contents:

  [systemd]
  path=/usr/lib/systemd/system
  path=/usr/lib/systemd/user
  description=systemd unit and auxiliary files.

  [bash-completion]
  path=/usr/share/bash-completion


In both cases, the keys could be put into INSTALL_MASK in make.conf:

  INSTALL_MASK=systemd bash-completion

What are your thoughts?

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Peter Stuge
Michał Górny wrote:
   INSTALL_MASK=systemd bash-completion
 
 What are your thoughts?

It seems like this will generally duplicate all -USE flags.

Would it make sense to instead have a single setting which changes
the meaning of USE to be that everything not USEd is install-masked?

Rather than adding another distinct step into the pipeline, perhaps
the trigger for doing the filtering can instead be integrated with an
existing mechanism, to optimize for low complexity and high reuse?


//Peter


pgpCDs45sOpxc.pgp
Description: PGP signature


Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Luis Ressel
I've got an additional proposal: It would be interesting if this
feature could also make use of the LINGUAS var for selectively
filtering /usr/share/man and and /usr/share/locale, as most ebuilds
don't respect this variable natively.

-- 
Luis Ressel ara...@aixah.de
GPG fpr: F08D 2AF6 655E 25DE 52BC  E53D 08F5 7F90 3029 B5BD


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Michał Górny
Dnia 2014-01-11, o godz. 16:56:37
Luis Ressel ara...@aixah.de napisał(a):

 I've got an additional proposal: It would be interesting if this
 feature could also make use of the LINGUAS var for selectively
 filtering /usr/share/man and and /usr/share/locale, as most ebuilds
 don't respect this variable natively.

That's a side goal.

I was thinking of something like:

  INSTALL_MASK=linguas -linguas_XX

that would remove all linguas except for language XX.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Alan McKinnon
On 11/01/2014 18:01, Michał Górny wrote:
 Dnia 2014-01-11, o godz. 16:56:37
 Luis Ressel ara...@aixah.de napisał(a):
 
 I've got an additional proposal: It would be interesting if this
 feature could also make use of the LINGUAS var for selectively
 filtering /usr/share/man and and /usr/share/locale, as most ebuilds
 don't respect this variable natively.
 
 That's a side goal.
 
 I was thinking of something like:
 
   INSTALL_MASK=linguas -linguas_XX
 
 that would remove all linguas except for language XX.


That is similar to USE=nosomething with all the attendant user
support problems it brings.

A far better method from a user point of view is to install the linguas
the user explicitly asked for. Your proposal as worded will be taken at
first glance to mean install all linguas, but not XX as most users
won't see the MASK portion and forget to flip the logic around in their
head.

How much work is it to get native support for LINGUAS into all ebuilds?
That would be the intuitive place considering there is already USE flags
for LINGUAS.

-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Luis Ressel
On Sat, 11 Jan 2014 17:01:34 +0100
Michał Górny mgo...@gentoo.org wrote:

 That's a side goal.
 
 I was thinking of something like:
 
   INSTALL_MASK=linguas -linguas_XX
 
 that would remove all linguas except for language XX.

That would be enough for me. A bit of a duplication of information,
but if it eases the implementation, that shouldn't be much of a problem.

But imho it'd be nice if this approach didn't require a separate config
entry for each language (that'd be 233 entries).


-- 
Luis Ressel ara...@aixah.de
GPG fpr: F08D 2AF6 655E 25DE 52BC  E53D 08F5 7F90 3029 B5BD


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Michał Górny
Dnia 2014-01-11, o godz. 17:21:46
Luis Ressel ara...@aixah.de napisał(a):

 On Sat, 11 Jan 2014 17:01:34 +0100
 Michał Górny mgo...@gentoo.org wrote:
 
  That's a side goal.
  
  I was thinking of something like:
  
INSTALL_MASK=linguas -linguas_XX
  
  that would remove all linguas except for language XX.
 
 That would be enough for me. A bit of a duplication of information,
 but if it eases the implementation, that shouldn't be much of a problem.
 
 But imho it'd be nice if this approach didn't require a separate config
 entry for each language (that'd be 233 entries).

I agree. But I think it's cleaner to have 233 extra files than
third special case there :).

OTOH, we could just make portage use LINGUAS to create implicit
INSTALL_MASK using directory paths. That wouldn't actually require any
magic in INSTALL_MASK itself.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Michał Górny
Dnia 2014-01-11, o godz. 18:15:09
Alan McKinnon alan.mckin...@gmail.com napisał(a):

 A far better method from a user point of view is to install the linguas
 the user explicitly asked for. Your proposal as worded will be taken at
 first glance to mean install all linguas, but not XX as most users
 won't see the MASK portion and forget to flip the logic around in their
 head.

As said on the other mail, I think we could just make portage
implicitly convert LINGUAS into INSTALL_MASK. That is, use the old
variable and give it a bit of new behavior.

 How much work is it to get native support for LINGUAS into all ebuilds?
 That would be the intuitive place considering there is already USE flags
 for LINGUAS.

Honestly? I'm all limbs against LINGUAS in its current form. It's just
extra dumb.

We have basically two cases:

1. packages that make LINGUAS into USE flags and use them to control
l10n. It's just useless extra work and extra rebuilds for locale
change.

2. packages that respect LINGUAS implicitly. That is, install only some
of the files silently and you don't even know which were enabled.

install-mask provides a clean framework to strip linguas with
binpackage friendliness potential.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Alan McKinnon
On 11/01/2014 18:52, Michał Górny wrote:
 Dnia 2014-01-11, o godz. 18:15:09
 Alan McKinnon alan.mckin...@gmail.com napisał(a):
 
 A far better method from a user point of view is to install the linguas
 the user explicitly asked for. Your proposal as worded will be taken at
 first glance to mean install all linguas, but not XX as most users
 won't see the MASK portion and forget to flip the logic around in their
 head.
 
 As said on the other mail, I think we could just make portage
 implicitly convert LINGUAS into INSTALL_MASK. That is, use the old
 variable and give it a bit of new behavior.

Do you mean retain LINGUAS in make.conf and remove it from emerge -p
output?

I don't know much about how LINGUAS works behind the scenes, but you
seem to be proposing a scheme that works something like this:

1. User specifics what LINGUAS they want in make.conf
2. Portage magically and invisibly installs files only for that LINGUA

That seems a good approach, it unclutters emerge -p output [the amount
of clutter that causes, together with APACHE2_MODULES, CAMERAS,
PHP_MODULES etc is quite unbelievable] and gives the user what they
asked for. If you hide the negative logic in the implementation that is
double bonus

 
 How much work is it to get native support for LINGUAS into all ebuilds?
 That would be the intuitive place considering there is already USE flags
 for LINGUAS.
 
 Honestly? I'm all limbs against LINGUAS in its current form. It's just
 extra dumb.
 
 We have basically two cases:
 
 1. packages that make LINGUAS into USE flags and use them to control
 l10n. It's just useless extra work and extra rebuilds for locale
 change.
 
 2. packages that respect LINGUAS implicitly. That is, install only some
 of the files silently and you don't even know which were enabled.
 
 install-mask provides a clean framework to strip linguas with
 binpackage friendliness potential.
 


-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-dev] RFC: storing predefined INSTALL_MASK directory lists in repos

2014-01-11 Thread Michał Górny
Dnia 2014-01-11, o godz. 19:11:21
Alan McKinnon alan.mckin...@gmail.com napisał(a):

 On 11/01/2014 18:52, Michał Górny wrote:
  Dnia 2014-01-11, o godz. 18:15:09
  Alan McKinnon alan.mckin...@gmail.com napisał(a):
  
  A far better method from a user point of view is to install the linguas
  the user explicitly asked for. Your proposal as worded will be taken at
  first glance to mean install all linguas, but not XX as most users
  won't see the MASK portion and forget to flip the logic around in their
  head.
  
  As said on the other mail, I think we could just make portage
  implicitly convert LINGUAS into INSTALL_MASK. That is, use the old
  variable and give it a bit of new behavior.
 
 Do you mean retain LINGUAS in make.conf and remove it from emerge -p
 output?

Yes, and no. Packages that explicitly use LINGUAS will still use it
as USE flags. However, other packages will get the stripping
implicitly.

 I don't know much about how LINGUAS works behind the scenes, but you
 seem to be proposing a scheme that works something like this:
 
 1. User specifics what LINGUAS they want in make.conf
 2. Portage magically and invisibly installs files only for that LINGUA

Well, currently build system often invisibly strips LINGUAS. But this
sucks since we don't know if it did it or not afterwards. if portage
stripped them, portage will have all the details.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature