Re: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined

2014-07-27 Thread William Hubbs
On Sat, Jul 26, 2014 at 01:45:46PM -0400, Jonathan Callen wrote:
 
 *snip*

 If you want to say At most one of the flags 'foo', 'bar', and 'baz'
 may be selected, then you say it like so (requires EAPI=5):
 
 REQUIRED_USE=?? ( foo bar baz )
 
 If you want to say Exactly one of the flags ..., then you use:
 
 REQUIRED_USE=^^ ( foo bar baz )
 
 And, as always, you can say At least one of the flags ... with:
 
 REQUIRED_USE=|| ( foo bar baz )
 
 While each of these can be written using the foo? ( !bar )-type
 primitives, the messages portage outputs are generally better with
 '??', '^^', and '||', as you might see something like:
 
 
The following REQUIRED_USE flag constraints are unsatisfied:
  at-most-one-of ( foo bar baz )
 
 
 Which is, in my opinion, more readable.

Now I understand what ciaranm was suggesting in pkg_pretend. Note, this
is not shell syntax, but it conveys the idea...

pkg_pretend() {
count=0
for x in foo bar bas; do
use $x  count += 1
done
# Now, if count == 0 none of the flags are used, and
# if count  1 more than one is used, so die whenever appropriate
# with any error message you choose.
}

William



signature.asc
Description: Digital signature


Re: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined

2014-07-26 Thread Pacho Ramos
El sáb, 26-07-2014 a las 08:05 +, Duncan escribió:
 Ian Stakenvicius posted on Fri, 25 Jul 2014 14:49:44 -0400 as excerpted:
 
  Hey all..  So, putting aside for now how much of a mess this would be to
  implement in the virtuals' ebuilds themselves, what do people think of
  changing the virtuals so that they contain an entry in IUSE for each
  provider that can satisfy it?
  
  The idea here is that the package satisfying a virtual could be
  optionally explicitly-chosen through package.use (or USE= in make.conf,
  perhaps) instead of having an entry in @world, that way if nothing
  depends on the virtual then it and the provider can be - --depclean'ed
  from the system. The idea is specifically NOT to have rdeps depend on
  these flags, that would undermine the whole purpose of the virtual; it
  would just be for end-users to set if they so chose.
  
  This may also help with getting portage to peg a virtual's provider to a
  specific package instead of constantly trying to switch from one to
  another, ie, how systemd kept getting pulled in, in relation to the
  upower virtual.
 
 What about handling each such virtual_USE as a USE_EXPAND?  VIRTUAL_* as 
 reserved-namespace USE_EXPAND would give us full backward compatibility 
 along with an immediately identifiable namespace and virtually (heh) no 
 possibility of confusion with other configuration.
 
 Continuing with the earlier virtual/krb5 example, we'd have VIRTUAL_KRB5, 
 with possible settings in make.conf of:
 
 VIRTUAL_KRB5=mit-krb5
 VIRTUAL_KRB5=heimdal
 
 Virtually no possibility of confusion with normal USE flags, and the 
 matching virtual would be immediately identifiable, so no possibility of 
 getting confused on what it applies to, either.
 

I would also prefer to use USE_EXPAND to not mix normal USEs with
virtuals... but I would go with using the same VIRTUAL variable for
all virtuals, otherwise people will end up having dozens of VIRTUAL_
statements in make.conf (one per virtual package)




Re: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined

2014-07-26 Thread Michał Górny
Dnia 2014-07-26, o godz. 08:05:32
Duncan 1i5t5.dun...@cox.net napisał(a):

 Ian Stakenvicius posted on Fri, 25 Jul 2014 14:49:44 -0400 as excerpted:
 
  Hey all..  So, putting aside for now how much of a mess this would be to
  implement in the virtuals' ebuilds themselves, what do people think of
  changing the virtuals so that they contain an entry in IUSE for each
  provider that can satisfy it?
  
  The idea here is that the package satisfying a virtual could be
  optionally explicitly-chosen through package.use (or USE= in make.conf,
  perhaps) instead of having an entry in @world, that way if nothing
  depends on the virtual then it and the provider can be - --depclean'ed
  from the system. The idea is specifically NOT to have rdeps depend on
  these flags, that would undermine the whole purpose of the virtual; it
  would just be for end-users to set if they so chose.
  
  This may also help with getting portage to peg a virtual's provider to a
  specific package instead of constantly trying to switch from one to
  another, ie, how systemd kept getting pulled in, in relation to the
  upower virtual.
 
 What about handling each such virtual_USE as a USE_EXPAND?  VIRTUAL_* as 
 reserved-namespace USE_EXPAND would give us full backward compatibility 
 along with an immediately identifiable namespace and virtually (heh) no 
 possibility of confusion with other configuration.

USE_EXPAND are global by definition. We ought fight with the abuse of
USE_EXPAND rather than make another abuse legitimate. Especially that
you're going to increase a lot of new variables quickly for no really
good reason.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined

2014-07-26 Thread Ciaran McCreesh
On Sat, 26 Jul 2014 10:53:21 +0200
Michał Górny mgo...@gentoo.org wrote:
 USE_EXPAND are global by definition.

Naah. They're global by a Portage configuration file limitation. In the
old days, USE flags were global too...

-- 
Ciaran McCreesh


signature.asc
Description: PGP signature


Re: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined

2014-07-26 Thread Ian Stakenvicius
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 26/07/14 04:05 AM, Duncan wrote:
 Ian Stakenvicius posted on Fri, 25 Jul 2014 14:49:44 -0400 as
 excerpted:
 
 Hey all..  So, putting aside for now how much of a mess this
 would be to implement in the virtuals' ebuilds themselves, what
 do people think of changing the virtuals so that they contain an
 entry in IUSE for each provider that can satisfy it?
 
 The idea here is that the package satisfying a virtual could be 
 optionally explicitly-chosen through package.use (or USE= in
 make.conf, perhaps) instead of having an entry in @world, that
 way if nothing depends on the virtual then it and the provider
 can be - --depclean'ed from the system. The idea is specifically
 NOT to have rdeps depend on these flags, that would undermine the
 whole purpose of the virtual; it would just be for end-users to
 set if they so chose.
 
 This may also help with getting portage to peg a virtual's
 provider to a specific package instead of constantly trying to
 switch from one to another, ie, how systemd kept getting pulled
 in, in relation to the upower virtual.
 
 What about handling each such virtual_USE as a USE_EXPAND?
 VIRTUAL_* as reserved-namespace USE_EXPAND would give us full
 backward compatibility along with an immediately identifiable
 namespace and virtually (heh) no possibility of confusion with
 other configuration.
 
 Continuing with the earlier virtual/krb5 example, we'd have
 VIRTUAL_KRB5, with possible settings in make.conf of:
 
 VIRTUAL_KRB5=mit-krb5 VIRTUAL_KRB5=heimdal
 
 Virtually no possibility of confusion with normal USE flags, and
 the matching virtual would be immediately identifiable, so no
 possibility of getting confused on what it applies to, either.
 


*shrug*, sure..  effectively we just start using
IUSE=virtual_krb5_mit-krb5 instead of mit-krb5 but yes this would
work too.


-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iF4EAREIAAYFAlPTrbUACgkQ2ugaI38ACPAbcAD/VapV0WR+Z7aWcyHeehHzoHSw
Qi8o+EDkQpakD3bVVtAA/0WSTPsPmVWHq3Fn0iITXbprHsKWMV+mXPN23nbpUdzf
=aE4s
-END PGP SIGNATURE-