From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BC81F138010 for ; Sat, 22 Sep 2012 19:43:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6D1EC21C025; Sat, 22 Sep 2012 19:42:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 64FCA21C008 for ; Sat, 22 Sep 2012 19:41:31 +0000 (UTC) Received: from [192.168.4.5] (blfd-4d086c64.pool.mediaWays.net [77.8.108.100]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: hasufell) by smtp.gentoo.org (Postfix) with ESMTPSA id 80C5B335E33 for ; Sat, 22 Sep 2012 19:41:30 +0000 (UTC) Message-ID: <505E1466.5000508@gentoo.org> Date: Sat, 22 Sep 2012 21:41:26 +0200 From: hasufell User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120908 Thunderbird/10.0.7 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] A more natural (human-friendly) syntax for dependencies References: <20120922095508.1f07dce5@pomiocik.lan> In-Reply-To: <20120922095508.1f07dce5@pomiocik.lan> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: f188e807-d7aa-484b-8725-f15358b8b483 X-Archives-Hash: 7a73107b0d01f663bf90305957be51c1 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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: > > > 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. > KISS is not just about simplicity of a system, but also about simplicity of changes and how big the gain is when the changes are not simple. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJQXhRmAAoJEFpvPKfnPDWzFJoH/jzjfVtHzbv3VUPJYl4WZSkq ztNaFp8SPSeMS10sM48Pt2l3JkHnOlN8hiXS4zq9Gy9VLKT3rkP94h8g3Gmh8biP pcHxGEpZOFV5ATuI2MNBDrF7LI8S0eVoOkutEQPAUwmI8NRzrj0DpEwYlmsUDxwE aD5vtMWLl02X6dnZfdLUN/zBo/T3jNWuLUyPmKWwB7qkIH+2W0y3ZxdBJmdA4VYl ImrIM7RAhUgBb3cPtmloPt7rfYH/AGoS1O2M6eEZo1N2TmeZ4YwwciOmYfZrHWkc AZzGs9yt0ElMkZrNNdHZlblyQhdZJ8xO2WhJrvmeG+HtwUJgtxDtYbowkkunLoM= =5PkR -----END PGP SIGNATURE-----