public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] USE dependencies
@ 2009-01-04 13:54 Christian Faulhammer
  2009-01-04 15:34 ` Nirbheek Chauhan
  0 siblings, 1 reply; 11+ messages in thread
From: Christian Faulhammer @ 2009-01-04 13:54 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

Hi,

regarding USE dependencies what is the correct way if a package needs
one out of two USE flags?

|| ( cat-egory/package[foo] cat-egory/package[bar] )

or is there something else?

V-Li

-- 
Christian Faulhammer, Gentoo Lisp project
<URL:http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode

<URL:http://www.faulhammer.org/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 13:54 [gentoo-dev] USE dependencies Christian Faulhammer
@ 2009-01-04 15:34 ` Nirbheek Chauhan
  2009-01-04 15:46   ` Tomáš Chvátal
  0 siblings, 1 reply; 11+ messages in thread
From: Nirbheek Chauhan @ 2009-01-04 15:34 UTC (permalink / raw
  To: gentoo-dev

On Sun, Jan 4, 2009 at 7:24 PM, Christian Faulhammer <fauli@gentoo.org> wrote:
> Hi,
>
> regarding USE dependencies what is the correct way if a package needs
> one out of two USE flags?
>
> || ( cat-egory/package[foo] cat-egory/package[bar] )
>

That's the way right now as per portage EAPI=2 doc[1]

> or is there something else?

A short-cut for this would be similar in scope to
http://bugs.gentoo.org/show_bug.cgi?id=238887

/me thinks cat-egory/pkg[use1|use2] would be a nice way :)

1. http://dev.gentoo.org/~zmedico/portage/doc/portage.html#package-ebuild-eapi-2-draft

-- 
~Nirbheek Chauhan



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 15:34 ` Nirbheek Chauhan
@ 2009-01-04 15:46   ` Tomáš Chvátal
  2009-01-04 15:56     ` Ciaran McCreesh
  2009-01-04 16:04     ` Nirbheek Chauhan
  0 siblings, 2 replies; 11+ messages in thread
From: Tomáš Chvátal @ 2009-01-04 15:46 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 1076 bytes --]

Dne neděle 04 Leden 2009 16:34:02 Nirbheek Chauhan napsal(a):
> On Sun, Jan 4, 2009 at 7:24 PM, Christian Faulhammer <fauli@gentoo.org> 
wrote:
> > Hi,
> >
> > regarding USE dependencies what is the correct way if a package needs
> > one out of two USE flags?
> >
> > || ( cat-egory/package[foo] cat-egory/package[bar] )
>
> That's the way right now as per portage EAPI=2 doc[1]
>
> > or is there something else?
>
> A short-cut for this would be similar in scope to
> http://bugs.gentoo.org/show_bug.cgi?id=238887
>
> /me thinks cat-egory/pkg[use1|use2] would be a nice way :)
>
> 1.
> http://dev.gentoo.org/~zmedico/portage/doc/portage.html#package-ebuild-eapi
>-2-draft
This is all nice but i had one issue which was like this:
i have package with use foo and package2 with use bar
and package with foo depend on package2 with bar.

so this is not eapi2 incely handleable, what i would like to do is using 
arrows or something like that

package2[foo?->bar] or package2[foo->bar?]

now i handle it that way both packages have same useflag.

[-- Attachment #1.2: Type: text/html, Size: 2097 bytes --]

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 15:46   ` Tomáš Chvátal
@ 2009-01-04 15:56     ` Ciaran McCreesh
  2009-01-04 16:04     ` Nirbheek Chauhan
  1 sibling, 0 replies; 11+ messages in thread
From: Ciaran McCreesh @ 2009-01-04 15:56 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

On Sun, 4 Jan 2009 16:46:06 +0100
Tomáš Chvátal <scarabeus@gentoo.org> wrote:
> This is all nice but i had one issue which was like this:
> i have package with use foo and package2 with use bar
> and package with foo depend on package2 with bar.
> 
> so this is not eapi2 incely handleable, what i would like to do is
> using arrows or something like that
> 
> package2[foo?->bar] or package2[foo->bar?]
> 
> now i handle it that way both packages have same useflag.

Uhm... What's wrong with "foo? ( package2[bar] )"?

The shortcut [use?] forms are there because practical experience showed
them being very widely used, but they're just that -- shortcuts for
widely used cases.

This lot should probably be in the new developer quiz, if anyone's
maintaining it these days.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 15:46   ` Tomáš Chvátal
  2009-01-04 15:56     ` Ciaran McCreesh
@ 2009-01-04 16:04     ` Nirbheek Chauhan
  2009-01-04 16:08       ` Ciaran McCreesh
  1 sibling, 1 reply; 11+ messages in thread
From: Nirbheek Chauhan @ 2009-01-04 16:04 UTC (permalink / raw
  To: gentoo-dev

On Sun, Jan 4, 2009 at 9:16 PM, Tomáš Chvátal <scarabeus@gentoo.org> wrote:
> This is all nice but i had one issue which was like this:
> i have package with use foo and package2 with use bar
> and package with foo depend on package2 with bar.
>
> so this is not eapi2 incely handleable, what i would like to do is using
> arrows or something like that
>
> package2[foo?->bar] or package2[foo->bar?]
>
> now i handle it that way both packages have same useflag.

How about this:

New syntax            Expanded syntax
                Extension of
--------------------------------------------------------------------------------------------------------
pkg[foo?bar]           foo? ( cat/pkg[bar] ) !foo? ( cat/pkg )
         cat/pkg[foo?]
pkg[!foo?bar]          foo? ( cat/pkg ) !foo? ( cat/pkg[bar] )
         cat/pkg[foo?]
pkg[foo=bar]           foo? ( cat/pkg[bar] ) !foo? ( cat/pkg[-bar] )
      cat/pkg[foo=]
pkg[!foo=bar]          foo? ( cat/pkg[-bar] ) !foo? ( cat/pkg[bar] )
      cat/pkg[!foo=]

IMO, this is simple enough to understand, and use :)

-- 
~Nirbheek Chauhan



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 16:04     ` Nirbheek Chauhan
@ 2009-01-04 16:08       ` Ciaran McCreesh
  2009-01-04 16:48         ` Nirbheek Chauhan
  0 siblings, 1 reply; 11+ messages in thread
From: Ciaran McCreesh @ 2009-01-04 16:08 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

On Sun, 4 Jan 2009 21:34:18 +0530
"Nirbheek Chauhan" <nirbheek.chauhan@gmail.com> wrote:
> How about this:
> 
> New syntax            Expanded syntax
>                 Extension of
> --------------------------------------------------------------------------------------------------------
> pkg[foo?bar]           foo? ( cat/pkg[bar] ) !foo? ( cat/pkg )
>          cat/pkg[foo?]
> pkg[!foo?bar]          foo? ( cat/pkg ) !foo? ( cat/pkg[bar] )
>          cat/pkg[foo?]
> pkg[foo=bar]           foo? ( cat/pkg[bar] ) !foo? ( cat/pkg[-bar] )
>       cat/pkg[foo=]
> pkg[!foo=bar]          foo? ( cat/pkg[-bar] ) !foo? ( cat/pkg[bar] )
>       cat/pkg[!foo=]
> 
> IMO, this is simple enough to understand, and use :)

It's utterly useless. Unlike the existing shortcut forms, what you're
after isn't widely enough used to warrant its own shortcut. Use the
expanded form and have done with it.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 16:08       ` Ciaran McCreesh
@ 2009-01-04 16:48         ` Nirbheek Chauhan
  2009-01-04 16:58           ` David Leverton
  2009-01-04 16:59           ` Ciaran McCreesh
  0 siblings, 2 replies; 11+ messages in thread
From: Nirbheek Chauhan @ 2009-01-04 16:48 UTC (permalink / raw
  To: gentoo-dev

On Sun, Jan 4, 2009 at 9:38 PM, Ciaran McCreesh
<ciaran.mccreesh@googlemail.com> wrote:
> On Sun, 4 Jan 2009 21:34:18 +0530
> "Nirbheek Chauhan" <nirbheek.chauhan@gmail.com> wrote:
>> How about this:
>
> It's utterly useless. Unlike the existing shortcut forms, what you're
> after isn't widely enough used to warrant its own shortcut. Use the
> expanded form and have done with it.

On the contrary, the reverse of what you say is true. A simple grep of
the tree showed that:

95 ebuilds do  "use\ \([a-zA-Z0-9]\+\).*\&\&.*built_with_use.*\ \1\ "
and 937 do      "use.*\&\&.*built_with_use"

So, one would assume that ~842 ebuilds could make use of the
pkg[foo?bar] syntax.

Of course, this missed the ebuilds which do

if use blah; then
  built_with_use ...
...
fi

But statistically, these numbers should be accurate.

-- 
~Nirbheek Chauhan



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 16:48         ` Nirbheek Chauhan
@ 2009-01-04 16:58           ` David Leverton
  2009-01-05  8:31             ` Nirbheek Chauhan
  2009-01-04 16:59           ` Ciaran McCreesh
  1 sibling, 1 reply; 11+ messages in thread
From: David Leverton @ 2009-01-04 16:58 UTC (permalink / raw
  To: gentoo-dev

On Sunday 04 January 2009 16:48:38 Nirbheek Chauhan wrote:
> On the contrary, the reverse of what you say is true. A simple grep of
> the tree showed that:

In how many of those ebuilds would the long form be
    use1? ( cat/pkg[use2] )
rather than
    use1? ( cat/pkg[use2] ) !use1? ( cat/pkg )
?  Obviously I didn't look through all the hits, but the former seems quite 
common, and any possible shortcut would only save a few characters.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 16:48         ` Nirbheek Chauhan
  2009-01-04 16:58           ` David Leverton
@ 2009-01-04 16:59           ` Ciaran McCreesh
  1 sibling, 0 replies; 11+ messages in thread
From: Ciaran McCreesh @ 2009-01-04 16:59 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 752 bytes --]

On Sun, 4 Jan 2009 22:18:38 +0530
"Nirbheek Chauhan" <nirbheek.chauhan@gmail.com> wrote:
> On Sun, Jan 4, 2009 at 9:38 PM, Ciaran McCreesh
> <ciaran.mccreesh@googlemail.com> wrote:
> > On Sun, 4 Jan 2009 21:34:18 +0530
> > "Nirbheek Chauhan" <nirbheek.chauhan@gmail.com> wrote:
> >> How about this:
> >
> > It's utterly useless. Unlike the existing shortcut forms, what
> > you're after isn't widely enough used to warrant its own shortcut.
> > Use the expanded form and have done with it.
> 
> On the contrary, the reverse of what you say is true. A simple grep of
> the tree showed that:

The problem with your simple grep is that it's simple. The problem with
your proposed shortcut is that it's not simple.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-04 16:58           ` David Leverton
@ 2009-01-05  8:31             ` Nirbheek Chauhan
  2009-01-05  8:40               ` Nirbheek Chauhan
  0 siblings, 1 reply; 11+ messages in thread
From: Nirbheek Chauhan @ 2009-01-05  8:31 UTC (permalink / raw
  To: gentoo-dev

On Sun, Jan 4, 2009 at 10:28 PM, David Leverton
<levertond@googlemail.com> wrote:
> On Sunday 04 January 2009 16:48:38 Nirbheek Chauhan wrote:
>> On the contrary, the reverse of what you say is true. A simple grep of
>> the tree showed that:
>
> In how many of those ebuilds would the long form be
>    use1? ( cat/pkg[use2] )
> rather than
>    use1? ( cat/pkg[use2] ) !use1? ( cat/pkg )
> ?  Obviously I didn't look through all the hits, but the former seems quite
> common, and any possible shortcut would only save a few characters.
>

Well, to get that info, you'd have to do even  more shell-foo :)
I believe that KDE-related packages often have dependencies of the
former sort; for example

use imlib && built_with_use dev-libs/imlib X

I've personally encountered use-deps of the type:

use cairo && built_with_use category/cairo X
use avahi && built_with_use net-dns/avahi gtk

etc.

Also, the same logic would apply to the existing pkg[use?] deps too.
However, pkg[use1?use2] seem to be (at the very least) common in
relation to pkg[use?] deps.

-- 
~Nirbheek Chauhan



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] USE dependencies
  2009-01-05  8:31             ` Nirbheek Chauhan
@ 2009-01-05  8:40               ` Nirbheek Chauhan
  0 siblings, 0 replies; 11+ messages in thread
From: Nirbheek Chauhan @ 2009-01-05  8:40 UTC (permalink / raw
  To: gentoo-dev

On Mon, Jan 5, 2009 at 2:01 PM, Nirbheek Chauhan
<nirbheek.chauhan@gmail.com> wrote:
>
> use cairo && built_with_use category/cairo X
> use avahi && built_with_use net-dns/avahi gtk

Oops, sorry, I misunderstood what you were saying; I agree; most of
the cases are of the type

use1? ( cat/pkg1[use2] )
!use1? ( <nothing> )

And if use1 and use2 are the same, the package will:

use1? ( cat/pkg1[use1] )
!use1? ( cat/pkg1 )

So, yes, cat/pkg[use1?use2] is a minority use-case; thanks for
clearing that up :)

-- 
~Nirbheek Chauhan



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-01-05  8:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-04 13:54 [gentoo-dev] USE dependencies Christian Faulhammer
2009-01-04 15:34 ` Nirbheek Chauhan
2009-01-04 15:46   ` Tomáš Chvátal
2009-01-04 15:56     ` Ciaran McCreesh
2009-01-04 16:04     ` Nirbheek Chauhan
2009-01-04 16:08       ` Ciaran McCreesh
2009-01-04 16:48         ` Nirbheek Chauhan
2009-01-04 16:58           ` David Leverton
2009-01-05  8:31             ` Nirbheek Chauhan
2009-01-05  8:40               ` Nirbheek Chauhan
2009-01-04 16:59           ` Ciaran McCreesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox