public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Suggestion for new dependency syntax
@ 2001-10-24 14:50 Karl Trygve Kalleberg
  2001-10-24 23:16 ` Dan Armak
  2001-10-26  9:11 ` [gentoo-dev] Suggestion for new dependency syntax Grant Goodyear
  0 siblings, 2 replies; 11+ messages in thread
From: Karl Trygve Kalleberg @ 2001-10-24 14:50 UTC (permalink / raw
  To: gentoo-dev

Hi gang.

I have discussed the need for this with drobbins last week. Sorry it took
so long before my suggestion materialized.

Woodchip: Warning, long and complicated mail (but this is justified by 
sticking to one topic through the entire mail, I should hope) ;p



We have sometimes discussed the need for a more precise syntax (and adhering
implementation) for specifying dependencies between packages.

Why do we want a more powerful dependency system ?

- If for no other reason, it's because the current syntax cannot gracefully
  handle ! (not)
- We really want to be able to have a set-theoretic-based syntax, since that
  is what is employed (logically) inside Portage.

Since the syntax is so closely tied to the functionality it represents, I 
will spare you the linguistic babble about semantics and rules, and rather
let the syntax speak for itself.


New syntax for complex dependencies:

 dev-libs/glib[ >=1.2 ]

 - This can of course also be written a tad simpler as

 >=dev-libs/glib-1.2


 dev-libs/glib[ >=1.2 <=1.2.14 ]

 - This defines the interval from 1.2.0 to 1.2.14, inclusive.

 dev-libs/glib[ >1.2 <1.2.14 =1.2.18]

 - This defines the interval from 1.2.1 to 1.2.13, inclusive (yes,
   read twice if you disagree), plus 1.2.18

 dev-libs/glib[1.2*]

 - This defines any 1.2 version, and is equivalent to

 dev-libs/glib-1.2*

 
 dev-libs/glib[1.2* !1.2.12* 1.2.12.3]

 - All 1.2 versions are okay, _except_ any 1.2.12 versions , 
   but 1.2.12.3 is okay again. (Call this set A).

 dev-libs/glib[ ((1.2* !1.2.12* 1.2.12.3) | 1.3*) & >=1.4.12 ]

 - Any of the versions in set A are okay, or any 1.3 version. In addition,
   we also have to have 1.4.12 or newer installed.

   This is where the new system allows us to package things that are really
   weird and require multiple versions of various things, without resorting 
   to calling the base package libxml2 or ssh2 or qt3, or whatever.

The same syntactical constructs can also be applied at inter-package
level:

DEPEND="[ dev-libs/foo[1.2* !1.2.12*] | >=dev-libs/bar-1.3 ]
        =dev-libs/baz-1.0"

DEPEND="foo? ([ dev-libs/foo[1.2* !1.2.12*] & 
                >=dev-libs/baz-1.0 |
                =dev-libs/baar-1.0] )"


In general, [] enclose the new syntactical constructs, and thus act as
an 'escape mechanism' from the old syntax.

One thing about the '|' (or) construct: foo | bar is equivalent to:
if not foo, then bar, it does NOT mean foo & !bar.


The main problem of exporting such as powerful/possibly complex mechanism 
as this, is that ebuilds can become unmaintainable. I really do not think 
that will be a problem, since for the majority of ebuilds, the "simplified"
(ie, old) syntax is more than enough. 

Only for fairly complex dependendency cases will the (full) power of the 
new syntax be applied, and that will probably always be done by the hardcore
Gentoo packagers anyway. 

I have elected not to comment on some of the more subtle points at various
points above. If anybody wants to get really dirty, I suggest we do it on
IRC.

Comments are required!



Kind regards,

Karl T







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

end of thread, other threads:[~2001-10-26 17:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-24 14:50 [gentoo-dev] Suggestion for new dependency syntax Karl Trygve Kalleberg
2001-10-24 23:16 ` Dan Armak
2001-10-26  6:02   ` Karl Trygve Kalleberg
2001-10-26  8:10     ` Jon Nelson
2001-10-26 10:16       ` [gentoo-dev] "Conflicts" [was -Re: Suggestion for new dependency syntax-] Tom von Schwerdtner
2001-10-26 10:58         ` [gentoo-dev] " Jon Nelson
2001-10-26  9:11 ` [gentoo-dev] Suggestion for new dependency syntax Grant Goodyear
2001-10-26  9:28   ` Jon Nelson
2001-10-26  9:45     ` Grant Goodyear
2001-10-26 11:01     ` Tom von Schwerdtner
2001-10-26 11:27       ` Jon Nelson

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