public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] A more natural (human-friendly) syntax for dependencies
@ 2012-09-22  7:55 Michał Górny
  2012-09-22  8:18 ` Ulrich Mueller
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Michał Górny @ 2012-09-22  7:55 UTC (permalink / raw
  To: Gentoo Developer Mailing List

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

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

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

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

end of thread, other threads:[~2012-09-25 23:44 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22  7:55 [gentoo-dev] A more natural (human-friendly) syntax for dependencies Michał Górny
2012-09-22  8:18 ` Ulrich Mueller
2012-09-22  8:26   ` Michał Górny
2012-09-22  9:05     ` Ulrich Mueller
2012-09-22  9:07 ` Alex Alexander
2012-09-22 16:32   ` Michał Górny
2012-09-22 15:12 ` Luca Barbato
2012-09-22 15:37   ` Michał Górny
2012-09-22 15:13 ` Ciaran McCreesh
2012-09-22 16:13 ` Luca Barbato
2012-09-22 16:30   ` Michał Górny
2012-09-22 17:11     ` Alex Alexander
2012-09-22 17:25       ` Michał Górny
2012-09-22 18:11         ` Alex Alexander
2012-09-22 19:52           ` Luca Barbato
2012-09-22 19:51         ` Luca Barbato
2012-09-22 16:35   ` Ben de Groot
2012-09-22 16:39     ` Diego Elio Pettenò
2012-09-22 17:05 ` Brian Dolbec
2012-09-22 17:19   ` Michał Górny
2012-09-22 19:01     ` Brian Dolbec
2012-09-25 23:41     ` Brian Harring
2012-09-22 19:41 ` hasufell

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