Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Fabian Groffen
On 07-10-2007 16:37:21 -0600, Joe Peterson wrote: > >> 1) Limit tool options to those that are common to all tool variants > >> 2) Port a standard (i.e. GNU) set of tools to all platforms > >> 3) Force all gentoo ports to use GNU userland ... > > No, it is not. The problem IMHO is in the "user" us

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Joe Peterson
Mike Frysinger wrote: > Fabian has summed it up nicely, thanks. i could care less what your userland > is outside of the ebuild environment since it doesnt matter to ebuild > writers. you want a deficient runtime environment, more power to you, but > forcing that environment onto ebuild develo

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Mike Frysinger
On Sunday 07 October 2007, Fabian Groffen wrote: > On 07-10-2007 10:19:43 -0600, Joe Peterson wrote: > > So there are a couple of options, as I see it: > > > > 1) Limit tool options to those that are common to all tool variants > > 2) Port a standard (i.e. GNU) set of tools to all platforms > > 3)

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Mike Frysinger
On Sunday 07 October 2007, Roy Marples wrote: > On Sun, 2007-10-07 at 01:06 -0400, Mike Frysinger wrote: > > > You can also do some pattern matching like so > > > > > > foo="foo foobar" > > > > > > [ "${foo%foobar}" = "${foo}" ] || echo "ends with foobar" > > > [ "${foo#foobar}" = "${foo}" ] || ech

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Joe Peterson
Fabian Groffen wrote: > On 07-10-2007 10:19:43 -0600, Joe Peterson wrote: >> So there are a couple of options, as I see it: >> >> 1) Limit tool options to those that are common to all tool variants >> 2) Port a standard (i.e. GNU) set of tools to all platforms >> 3) Force all gentoo ports to use GN

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Fabian Groffen
On 07-10-2007 10:19:43 -0600, Joe Peterson wrote: > So there are a couple of options, as I see it: > > 1) Limit tool options to those that are common to all tool variants > 2) Port a standard (i.e. GNU) set of tools to all platforms > 3) Force all gentoo ports to use GNU userland > > I think we'd

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Roy Marples
On Sun, 2007-10-07 at 01:06 -0400, Mike Frysinger wrote: > > You can also do some pattern matching like so > > > > foo="foo foobar" > > > > [ "${foo%foobar}" = "${foo}" ] || echo "ends with foobar" > > [ "${foo#foobar}" = "${foo}" ] || echo "starts with foo" > > [ "${foo#* }" = "${foo}" ] || echo "

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-07 Thread Joe Peterson
Mike Frysinger wrote: > as mentioned, GNU is the main bread and butter of Gentoo. forcing the > majority of people to go pure POSIX in the face of GNU extensions that make > life easier is wrong. so the minority gets screwed, that's life. especially > considering it's trivial for the minority

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-06 Thread Mike Frysinger
On Wednesday 03 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 06:57 -0400, Mike Frysinger wrote: > > > Pattern matching can be done just as well with case. Infact, tend to > > > use [[ == ]] a lot when pattern matching when a case statement would be > > > more efficient and use less code

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-06 Thread Mike Frysinger
On Tuesday 02 October 2007, Joe Peterson wrote: > Mike Frysinger wrote: > > wrong. bash and GNU prevail because they provide useful extensions. it > > may be worthwhile to force `find` in the portage environment to be GNU > > find so we can stop wasting time trying to figure out how to rewrite >

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-03 Thread Roy Marples
On Tue, 2007-10-02 at 06:57 -0400, Mike Frysinger wrote: > > Pattern matching can be done just as well with case. Infact, tend to use > > [[ == ]] a lot when pattern matching when a case statement would be more > > efficient and use less code. Of course when you're just interested in > > matching o

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 17:02 -0600, Joe Peterson wrote: > Mike Frysinger wrote: > > wrong. bash and GNU prevail because they provide useful extensions. it > > may > > be worthwhile to force `find` in the portage environment to be GNU find so > > we > > can stop wasting time trying to figure ou

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Joe Peterson
Mike Frysinger wrote: > wrong. bash and GNU prevail because they provide useful extensions. it may > be worthwhile to force `find` in the portage environment to be GNU find so we > can stop wasting time trying to figure out how to rewrite expressions in > ebuilds (which can be done trivially w

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Richard Freeman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Natanael Copa wrote: > On Tue, 2007-10-02 at 05:39 -0700, Alec Warner wrote: > >> I don't think there is a technical reason to avoid using bash. > > Ofcourse there is. See first issue mentioned in BUGS section in bash > manpage. > Presumably these

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Natanael Copa
On Tue, 2007-10-02 at 09:26 -0400, Mike Frysinger wrote: > On Tuesday 02 October 2007, Luca Barbato wrote: > > Mike Frysinger wrote: > > > in the general case, dash will typically parse faster than bash. but is > > > this speed gain relevant ? if dash can parse an ebuild in 10% of the > > > time

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Natanael Copa
On Tue, 2007-10-02 at 05:39 -0700, Alec Warner wrote: > I don't think there is a technical reason to avoid using bash. Ofcourse there is. See first issue mentioned in BUGS section in bash manpage. -nc -- [EMAIL PROTECTED] mailing list

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Luca Barbato wrote: > Mike Frysinger wrote: > > in the general case, dash will typically parse faster than bash. but is > > this speed gain relevant ? if dash can parse an ebuild in 10% of the > > time that it takes bash, but bash can do it in a 1 second, do we care ?

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Luca Barbato
Mike Frysinger wrote: > in the general case, dash will typically parse faster than bash. but is this > speed gain relevant ? if dash can parse an ebuild in 10% of the time that it > takes bash, but bash can do it in a 1 second, do we care ? the majority of > ebuilds are going to take magnitud

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Alec Warner
On 10/2/07, Roy Marples <[EMAIL PROTECTED]> wrote: > On Tue, 2007-10-02 at 06:49 -0400, Mike Frysinger wrote: > > BSD is a second class citizen to GNU here. Gentoo started out as a project > > targetting a GNU userland under Linux and will continue for quite sometime > > (forever?) as the majority

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Luca Barbato wrote: > IFF your proposed changes lead to something that is simpler or as simple > to write, faster or as fast to parse, easier or as easy to > read/maintain; then you may have a solid stance. Otherwise it is a > pointless annoyance for everybody, you first

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 06:49 -0400, Mike Frysinger wrote: > > BSD is a second class citizen to GNU here. Gentoo started out as a > > project targetting a GNU userland under Linux and will continue for quite > > sometime (forever?) as the majority/cor

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 06:57 -0400, Mike Frysinger wrote: > > i am convinced by superior standards and by good things. forcing the > > standard from bash to POSIX is neither of these. i dont see that as a > > flaw in my logic. > > Forcing? I'm not a

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Luca Barbato
Roy Marples wrote: > Well, let me be the first to stand for equal rights then! Hm... > > I say that for the most part, there should be no technical reason why > ebuilds cannot be in posix shell whilst being readable and maintainable. Beside teaching us how to do that. > If portage or another p

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 06:49 -0400, Mike Frysinger wrote: > BSD is a second class citizen to GNU here. Gentoo started out as a project > targetting a GNU userland under Linux and will continue for quite sometime > (forever?) as the majority/core focus. forcing the project to limit itself > when

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 06:57 -0400, Mike Frysinger wrote: > i am convinced by superior standards and by good things. forcing the > standard > from bash to POSIX is neither of these. i dont see that as a flaw in my > logic. Forcing? I'm not asking for anything to be forced, I'm asking for it to

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Fabian Groffen
On 02-10-2007 12:00:12 +0100, Roy Marples wrote: > Infact, if we're not interested in portable code why bother with > Gentoo/ALT in the first place? Our code /IS/ portable, that's why you and me have a working Gentoo/Alt system at the moment. -- Fabian Groffen Gentoo on a different level -- [E

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 06:28 -0400, Mike Frysinger wrote: > > > project X says their code should be compiled with GCC, should we deny > > > the ICC users the ability to compile it? > > > > that is project X's decision and no one else's. dont pull a s

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 05:39 -0400, Mike Frysinger wrote: > > > > I personally like consistency. So if we use bash in ebuilds, then > > > > I'd like to use bash in eclasses too. I'm interested in your > > > > motivation to make this eclass "pure sh"

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 12:41 +0200, Fabian Groffen wrote: > On 02-10-2007 11:09:21 +0100, Roy Marples wrote: > > It also means that their code stands a better chance of working where > > bash is not available, but /bin/sh is a POSIX shell still. > > I prefer to define that ebuilds (and eclasses) ar

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 06:28 -0400, Mike Frysinger wrote: > > project X says their code should be compiled with GCC, should we deny > > the ICC users the ability to compile it? > > that is project X's decision and no one else's. dont pull a stallman on us > and force everyone to subscribe to your

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 06:10 -0400, Mike Frysinger wrote: > > On Tuesday 02 October 2007, Roy Marples wrote: > > > A common parlance on Slashdot when referring to Microsoft is that > > > monoculture is bad. Forcing bash and GNU tools down everyones th

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Fabian Groffen
On 02-10-2007 11:09:21 +0100, Roy Marples wrote: > It also means that their code stands a better chance of working where > bash is not available, but /bin/sh is a POSIX shell still. I prefer to define that ebuilds (and eclasses) are dealt by GNU bash, which is installed as part of the installation

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 06:10 -0400, Mike Frysinger wrote: > On Tuesday 02 October 2007, Roy Marples wrote: > > A common parlance on Slashdot when referring to Microsoft is that > > monoculture is bad. Forcing bash and GNU tools down everyones throat is > > no better - it's just replacing one monocul

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 11:49 +0200, Fabian Groffen wrote: > > Which doesn't seem to be an answer to the question at all to me. My > > question was basically about what the benefits are of changing the meta > > information interpretation definition.

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 05:39 -0400, Mike Frysinger wrote: > > The bonus is that it works on shells other than bash. > > which is irrelevant here I think otherwise. > > > > I personally like consistency. So if we use bash in ebuilds, then I'd > > > like to use bash in eclasses too. I'm intereste

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > A common parlance on Slashdot when referring to Microsoft is that > monoculture is bad. Forcing bash and GNU tools down everyones throat is > no better - it's just replacing one monoculture with another one. wrong. bash and GNU prevail because they

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 11:49 +0200, Fabian Groffen wrote: > Which doesn't seem to be an answer to the question at all to me. My > question was basically about what the benefits are of changing the meta > information interpretation definition. In other words, if project X > says their code should b

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Tue, 2007-10-02 at 09:29 +0200, Fabian Groffen wrote: > > On 01-10-2007 22:59:40 +0100, Roy Marples wrote: > > > I would like to propse a new versionator.eclass for consideration > > > (attached). > > > > > > This version, I believe, is more reada

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Fabian Groffen
On 02-10-2007 10:37:25 +0100, Roy Marples wrote: > > "vendor lock-in" is an interesting term to mention here, as bash is open > > source, and I think (I'm not a lawyer) free to use as long as you want, > > and modifyable if you like. > > Just because it's open source does not mean that it won't tr

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 11:22 +0200, Fabian Groffen wrote: > On 02-10-2007 09:48:06 +0100, Roy Marples wrote: > > > What is your rationale to say that "pure sh" is a "bonus"? Especially > > > given the environment this is used in as ferdy already pointed out? > > > > The bonus is that it works on s

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Mike Frysinger
On Tuesday 02 October 2007, Roy Marples wrote: > On Mon, 2007-10-01 at 20:22 -0400, Mike Frysinger wrote: > > i'd say that changing > > things from doing a case match against proper character classes to doing > > a printf against arbitrary character ranges (which btw are not locale > > safe, so i

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Fabian Groffen
On 02-10-2007 09:48:06 +0100, Roy Marples wrote: > > What is your rationale to say that "pure sh" is a "bonus"? Especially > > given the environment this is used in as ferdy already pointed out? > > The bonus is that it works on shells other than bash. I give you a big chance Solaris' or AIX' /b

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Natanael Copa
On Tue, 2007-10-02 at 09:29 +0200, Fabian Groffen wrote: > On 01-10-2007 22:59:40 +0100, Roy Marples wrote: > > I would like to propse a new versionator.eclass for consideration > > (attached). > > > > This version, I believe, is more readable and maintainable then the one > > currently in porta

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Roy Marples
On Tue, 2007-10-02 at 09:29 +0200, Fabian Groffen wrote: > On 01-10-2007 22:59:40 +0100, Roy Marples wrote: > > I would like to propse a new versionator.eclass for consideration > > (attached). > > > > This version, I believe, is more readable and maintainable then the one > > currently in porta

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-02 Thread Fabian Groffen
On 01-10-2007 22:59:40 +0100, Roy Marples wrote: > I would like to propse a new versionator.eclass for consideration (attached). > > This version, I believe, is more readable and maintainable then the one > currently in portage. It also uses a lot less code and has the bonus of being > pure sh.

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Roy Marples
On Tue, 2007-10-02 at 08:35 +0200, Natanael Copa wrote: > After a quick look I wonder how/if it deals with: > > 1.01 < 1.1 It treats them the same way [EMAIL PROTECTED] ~ $ bash -c '. /usr/portage/eclass/versionator.eclass; version_compare 1.01 1.1; echo $?' 2 [EMAIL PROTECTED] ~ $ bash -c '. ./

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Natanael Copa
On Mon, 2007-10-01 at 23:30 +0100, Roy Marples wrote: > On Monday 01 October 2007 22:59:40 Roy Marples wrote: > > This version, I believe, is more readable and maintainable then the one > > currently in portage. It also uses a lot less code and has the bonus of > > being pure sh. > > It should be

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Roy Marples
On Mon, 2007-10-01 at 20:22 -0400, Mike Frysinger wrote: > "better readability" is a pretty subjective claim ... Many things are subjective - one mans good is another mans bad. /me shrugs > i'd say that changing > things from doing a case match against proper character classes to doing a > pri

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Mike Frysinger
On Monday 01 October 2007, Roy Marples wrote: > On Monday 01 October 2007 23:41:36 Fernando J. Pereda wrote: > > I sure as hell am not going to proof read all that (mainly because I > > think not using bash features in an environment where bash is required > > is silly, instead of being an improvem

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Roy Marples
On Monday 01 October 2007 23:41:36 Fernando J. Pereda wrote: > I sure as hell am not going to proof read all that (mainly because I > think not using bash features in an environment where bash is required > is silly, instead of being an improvement) OK. Maybe I shouldn't have mentioned the "in sh"

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Fernando J. Pereda
On Mon, Oct 01, 2007 at 11:30:16PM +0100, Roy Marples wrote: > On Monday 01 October 2007 22:59:40 Roy Marples wrote: > > This version, I believe, is more readable and maintainable then the one > > currently in portage. It also uses a lot less code and has the bonus of > > being pure sh. > > It sho

Re: [gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Roy Marples
On Monday 01 October 2007 22:59:40 Roy Marples wrote: > This version, I believe, is more readable and maintainable then the one > currently in portage. It also uses a lot less code and has the bonus of > being pure sh. It should be noted that that first draft was developed on bash only. Attached i

[gentoo-dev] RFC: sh versionator.eclass

2007-10-01 Thread Roy Marples
I would like to propse a new versionator.eclass for consideration (attached). This version, I believe, is more readable and maintainable then the one currently in portage. It also uses a lot less code and has the bonus of being pure sh. It has not been tested in any ebuilds, but it does pass th