FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 09-22-2012, 07:55 AM
Michał Górny
 
Default A more natural (human-friendly) syntax for dependencies

Hello,

The current dependency syntax:

[VERSION-OP] PACKAGE-NAME ["-" PACKAGE-VERSION]

suffers a few problems:


1. It is not really human-friendly.

People don't say things like:

I need newer than monkey-1.2.

They say instead:

I need monkey, newer than version 1.2.


2. With long package names and versions, it becomes hard-to-read.

Consider the following:

>=dev-foo/bar-very-long-my-name-is-4-beta-17

Where does the version number start? And yes, this is a valid package
name to our rules.


3. Some potentially colliding package names are disallowed.

A package name can't end up with something looking like version. Thus,
if upstream names package:

frobnicator-11

We need to rename it in the tree, effectively losing the ability to
follow upstream naming and introducing a bunch of unnecessary MY_P, S
variables.


4. Adding, removing and changing versions is not friendly at all.

Consider the following dep:

>=dev-foo/bar-bas-bat-11.2.4_alpha

Now, you want to bump the dep to 11.3. You need to find the version
number, and modify it. Depending on the configuration, ^w is going to
eat the whole package name or just a single component.

Then, you want to remove the whole version. You need to first remove
the version number, making sure it doesn't eat a bit of package name
as well. Then, you have to go back to the beginning of the string,
and remove the operator.

Or you want to add a version. That one is simpler -- you just need to
go to one end of the dep, add the operator, then to the other, and add
the version.


The fore-mentioned problems could be solved through introducing a more
natural dependency syntax:

PACKAGE-NAME [[*WSP] VERSION-OP [*WSP] PACKAGE-VERSION]]


This way:

1. It follows exactly how people are reading it:

PACKAGE-NAME [is VERSION-OP than PACKAGE-VERSION]

2. It is always clear what is the version, and what is not.
Additionally, it allows you to introduce whitespace to increase
readability even more:

dev-foo/bar-very-long-my-name-is-4-beta >= 17

3. The optional (version dependency) part is at one side
of the string, so it is easy to add, change or remove. Two times ^w
and done!

4. It follows the syntax used by bash (for conditionals), pkg-config
-- it is more natural in the environment.

--
Best regards,
Michał Górny
 
Old 09-22-2012, 08:18 AM
Ulrich Mueller
 
Default A more natural (human-friendly) syntax for dependencies

>>>>> On Sat, 22 Sep 2012, Michał Górny wrote:

> A package name can't end up with something looking like version.

> Thus, if upstream names package:

> frobnicator-11

> We need to rename it in the tree, effectively losing the ability to
> follow upstream naming and introducing a bunch of unnecessary MY_P,
> S variables.

You need to be more precise here. Package names like "foo-1a" or
"foo-2_alpha" are perfectly legal, see the discussion in bug 174536.

What is currently not allowed are package names ending with a hyphen
followed by digits only (as in your above example). This seems to be
completely arbitrary, and we could remove this limitation, even with
existing dependency syntax.

Ulrich
 
Old 09-22-2012, 08:26 AM
Michał Górny
 
Default A more natural (human-friendly) syntax for dependencies

On Sat, 22 Sep 2012 10:18:31 +0200
Ulrich Mueller <ulm@gentoo.org> wrote:

> >>>>> On Sat, 22 Sep 2012, Michał Górny wrote:
>
> > A package name can't end up with something looking like version.
>
> > Thus, if upstream names package:
>
> > frobnicator-11
>
> > We need to rename it in the tree, effectively losing the ability to
> > follow upstream naming and introducing a bunch of unnecessary MY_P,
> > S variables.
>
> You need to be more precise here. Package names like "foo-1a" or
> "foo-2_alpha" are perfectly legal, see the discussion in bug 174536.
>
> What is currently not allowed are package names ending with a hyphen
> followed by digits only (as in your above example). This seems to be
> completely arbitrary, and we could remove this limitation, even with
> existing dependency syntax.

I doubt we can. And we just extended it into repository names, didn't
we?

--
Best regards,
Michał Górny
 
Old 09-22-2012, 09:05 AM
Ulrich Mueller
 
Default A more natural (human-friendly) syntax for dependencies

>>>>> On Sat, 22 Sep 2012, Michał Górny wrote:

>> What is currently not allowed are package names ending with a hyphen
>> followed by digits only (as in your above example). This seems to be
>> completely arbitrary, and we could remove this limitation, even with
>> existing dependency syntax.

> I doubt we can.

Nobody could tell me a technical reason why this limitation exists.
Why should "foo-1" be forbidden for PN if "foo-1a" is allowed?

> And we just extended it into repository names, didn't we?

Indeed, looks like I've missed this. But it shouldn't be a problem, if
we loosen the spec for package names, the one for repository names
just follows it.

Ulrich
 
Old 09-22-2012, 09:07 AM
Alex Alexander
 
Default A more natural (human-friendly) syntax for dependencies

On Sep 22, 2012 10:58 AM, "Michał Górny" <mgorny@gentoo.org> wrote:

>

> Hello,

>

> The current dependency syntax:

>

> * [VERSION-OP] PACKAGE-NAME ["-" PACKAGE-VERSION]

>

> suffers a few problems:

The syntax you are describing is used all over portage, not just dependencies. Some examples are the /etc/portage/package.* files, has_version or exact version matching when emerging.

Changing it just for dependencies would most certainly confuse people and tbh I like the current syntax :-)

Alex | wired
 
Old 09-22-2012, 03:12 PM
Luca Barbato
 
Default A more natural (human-friendly) syntax for dependencies

On 09/22/2012 09:55 AM, Michał Górny wrote:
> Hello,
>
> The current dependency syntax:
>
> [VERSION-OP] PACKAGE-NAME ["-" PACKAGE-VERSION]
>
> suffers a few problems:

I like the current syntax.

lu
 
Old 09-22-2012, 03:13 PM
Ciaran McCreesh
 
Default A more natural (human-friendly) syntax for dependencies

On Sat, 22 Sep 2012 09:55:08 +0200
Michał Górny <mgorny@gentoo.org> wrote:
> The fore-mentioned problems could be solved through introducing a more
> natural dependency syntax:
>
> PACKAGE-NAME [[*WSP] VERSION-OP [*WSP] PACKAGE-VERSION]]

If we'd rather not break backwards compatibility and add in all kinds
of whitespace-related mess, another option is cat/pkg[>=2.3].

--
Ciaran McCreesh
 
Old 09-22-2012, 03:37 PM
Michał Górny
 
Default A more natural (human-friendly) syntax for dependencies

On Sat, 22 Sep 2012 17:12:04 +0200
Luca Barbato <lu_zero@gentoo.org> wrote:

> On 09/22/2012 09:55 AM, Michał Górny wrote:
> > Hello,
> >
> > The current dependency syntax:
> >
> > [VERSION-OP] PACKAGE-NAME ["-" PACKAGE-VERSION]
> >
> > suffers a few problems:
>
> I like the current syntax.

Does that invalidate my arguments?

--
Best regards,
Michał Górny
 
Old 09-22-2012, 04:13 PM
Luca Barbato
 
Default A more natural (human-friendly) syntax for dependencies

On 09/22/2012 09:55 AM, Michał Górny wrote:
> Hello,
>
> The current dependency syntax:
>
> [VERSION-OP] PACKAGE-NAME ["-" PACKAGE-VERSION]
>
> suffers a few problems:

I like the current one your proposal seems quite a problem for a large
deal of usecases.

> 1. It is not really human-friendly.
>
> People don't say things like:
>
> I need newer than monkey-1.2.
>
> They say instead:
>
> I need monkey, newer than version 1.2.

"I need monkey-1.2 or newer" sounds natural to me.

> 2. With long package names and versions, it becomes hard-to-read.
>
> Consider the following:
>
> >=dev-foo/bar-very-long-my-name-is-4-beta-17
>
> Where does the version number start? And yes, this is a valid package
> name to our rules.


> 4. Adding, removing and changing versions is not friendly at all.
>
> Consider the following dep:
>
> >=dev-foo/bar-bas-bat-11.2.4_alpha
>
> Now, you want to bump the dep to 11.3. You need to find the version
> number, and modify it. Depending on the configuration, ^w is going to
> eat the whole package name or just a single component.

Use a better editor.

> Then, you want to remove the whole version. You need to first remove
> the version number, making sure it doesn't eat a bit of package name
> as well. Then, you have to go back to the beginning of the string,
> and remove the operator.

> PACKAGE-NAME [[*WSP] VERSION-OP [*WSP] PACKAGE-VERSION]]

whitespace as separator for atoms looks a huge can of worms waiting to
be opened. how you'd pass that to emerge? How you make a list of atoms?

Please try not fix/break what is not broken.

lu
 
Old 09-22-2012, 04:30 PM
Michał Górny
 
Default A more natural (human-friendly) syntax for dependencies

On Sat, 22 Sep 2012 18:13:48 +0200
Luca Barbato <lu_zero@gentoo.org> wrote:

> On 09/22/2012 09:55 AM, Michał Górny wrote:
> > Hello,
> >
> > The current dependency syntax:
> >
> > [VERSION-OP] PACKAGE-NAME ["-" PACKAGE-VERSION]
> >
> > suffers a few problems:
>
> I like the current one your proposal seems quite a problem for a large
> deal of usecases.
>
> > 1. It is not really human-friendly.
> >
> > People don't say things like:
> >
> > I need newer than monkey-1.2.
> >
> > They say instead:
> >
> > I need monkey, newer than version 1.2.
>
> "I need monkey-1.2 or newer" sounds natural to me.

'monkey-1.2' or 'monkey version 1.2'? The former being a package name.

> > 4. Adding, removing and changing versions is not friendly at all.
> >
> > Consider the following dep:
> >
> > >=dev-foo/bar-bas-bat-11.2.4_alpha
> >
> > Now, you want to bump the dep to 11.3. You need to find the version
> > number, and modify it. Depending on the configuration, ^w is going
> > to eat the whole package name or just a single component.
>
> Use a better editor.

Which one has automagic atom stripping?

> > Then, you want to remove the whole version. You need to first remove
> > the version number, making sure it doesn't eat a bit of package name
> > as well. Then, you have to go back to the beginning of the string,
> > and remove the operator.
>
> > PACKAGE-NAME [[*WSP] VERSION-OP [*WSP] PACKAGE-VERSION]]
>
> whitespace as separator for atoms looks a huge can of worms waiting to
> be opened. how you'd pass that to emerge? How you make a list of
> atoms?

emerge 'foo >= 1.1' 'bar < 1.0'?
emerge foo '>=' 1.1 bar '<' 1.0?

And what do you mean by 'a list of atoms'? I don't see a single problem
parsing this syntax. It's a very simple stream of tokens.

> Please try not fix/break what is not broken.

So we're now switching Gentoo to EOL and just fixing bugs?

--
Best regards,
Michał Górny
 

Thread Tools




All times are GMT. The time now is 08:19 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org