Re: Fwd: [gentoo-dev] More general interface to use flags

2007-11-03 Thread Mike Frysinger
On Saturday 03 November 2007, Alec Warner wrote: > Since portage currently > uses bash and to my knowledge is not moving to POSIX shell in the near > term, I think bash is appropriate in the implementation. AKA, > everyone stop arguing about which is better. there it is, thanks -mike signature.

Fwd: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Alec Warner
I hate gmail -- Forwarded message -- From: Alec Warner <[EMAIL PROTECTED]> Date: Nov 2, 2007 10:25 PM Subject: Re: [gentoo-dev] More general interface to use flags To: gentoo-dev@lists.gentoo.org On 11/2/07, Roy Marples <[EMAIL PROTECTED]> wrote: > > On Fri, 2

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Roy Marples
On Fri, 2007-11-02 at 18:17 +0100, Bo Ørsted Andresen wrote: > On Friday 02 November 2007 17:52:13 Roy Marples wrote: > > On Fri, 2007-11-02 at 17:30 +0100, Bo Ørsted Andresen wrote: > > > Please explain why you hijack this thread to discuss POSIX vs. bash when > > > it's supposed to be about the

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Bo Ørsted Andresen
On Friday 02 November 2007 17:52:13 Roy Marples wrote: > On Fri, 2007-11-02 at 17:30 +0100, Bo Ørsted Andresen wrote: > > Please explain why you hijack this thread to discuss POSIX vs. bash when > > it's supposed to be about the API for ebuilds. > > I dislike the gratuitous use of bash for no good

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Roy Marples
On Fri, 2007-11-02 at 17:30 +0100, Bo Ørsted Andresen wrote: > Please explain why you hijack this thread to discuss POSIX vs. bash when it's > supposed to be about the API for ebuilds. I dislike the gratuitous use of bash for no good reason - and in the code he gave there is no good reason for us

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Bo Ørsted Andresen
On Friday 02 November 2007 17:10:29 Roy Marples wrote: > > and the answer is still the same. POSIX conversions are irrelevant until > > you can propose solutions for the things bash can do but POSIX cannot. > > you can only provide workarounds or hacks, so any further attempt on the > > topic is

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Roy Marples
On Fri, 2007-11-02 at 11:58 -0400, Mike Frysinger wrote: > and the answer is still the same. POSIX conversions are irrelevant until you > can propose solutions for the things bash can do but POSIX cannot. you can > only provide workarounds or hacks, so any further attempt on the topic is > hal

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Mike Frysinger
On Friday 02 November 2007, Roy Marples wrote: > On Fri, 2007-11-02 at 11:38 -0400, Mike Frysinger wrote: > > wrong. the point of the discussion on the gentoo dev mailing list is to > > go over the exported API for *ebuilds*, not for the implementation. the > > implementation is already baked and

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Roy Marples
On Fri, 2007-11-02 at 11:38 -0400, Mike Frysinger wrote: > wrong. the point of the discussion on the gentoo dev mailing list is to go > over the exported API for *ebuilds*, not for the implementation. the > implementation is already baked and really, Marijn shouldnt have sent it to > the gento

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Mike Frysinger
On Friday 02 November 2007, Roy Marples wrote: > On Fri, 2007-11-02 at 10:59 -0400, Mike Frysinger wrote: > > On Friday 02 November 2007, Roy Marples wrote: > > > On Fri, 2007-11-02 at 14:44 +0100, Marijn Schouten (hkBst) wrote: > > > > [[ ${flag} = !* ]] && { success=1 ; flag=${flag:1} } > > > > >

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Roy Marples
On Fri, 2007-11-02 at 10:59 -0400, Mike Frysinger wrote: > On Friday 02 November 2007, Roy Marples wrote: > > On Fri, 2007-11-02 at 14:44 +0100, Marijn Schouten (hkBst) wrote: > > > [[ ${flag} = !* ]] && { success=1 ; flag=${flag:1} } > > > > Could be written as > > irrelevant, thanks My mail was

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Mike Frysinger
On Friday 02 November 2007, Roy Marples wrote: > On Fri, 2007-11-02 at 14:44 +0100, Marijn Schouten (hkBst) wrote: > > [[ ${flag} = !* ]] && { success=1 ; flag=${flag:1} } > > Could be written as irrelevant, thanks -mike signature.asc Description: This is a digitally signed message part.

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Marijn Schouten (hkBst)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel Drake wrote: > Marijn Schouten (hkBst) wrote: >> use_mime() { >> local WORD=$(ifv "$2" "$2" "$1") >> >> ifuse "$1" "${WORD};" >> } >> >> for generating a string of ';'-separated mime-types based on use flags. >> >> The explanation of thi

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Roy Marples
On Fri, 2007-11-02 at 15:27 +0100, Marijn Schouten (hkBst) wrote: > > ifz() { > [[ $1 = 0 ]] && echo $2 || echo $3 > } And that could be written as [ "$1" = 0 ] && echo "$2" || echo "$3" Thanks Roy -- [EMAIL PROTECTED] mailing list

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Marijn Schouten (hkBst)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel Drake wrote: > Marijn Schouten (hkBst) wrote: >> use_mime() { >> local WORD=$(ifv "$2" "$2" "$1") >> >> ifuse "$1" "${WORD};" >> } >> >> for generating a string of ';'-separated mime-types based on use flags. >> >> The explanation of thi

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Marijn Schouten (hkBst)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roy Marples wrote: > On Fri, 2007-11-02 at 14:44 +0100, Marijn Schouten (hkBst) wrote: >> [[ ${flag} = !* ]] && { success=1 ; flag=${flag:1} } > > Could be written as > [ "${flag#!}" != "${flag}" ] && { success=1; flag=${flag#!}; } > >> string=$( ((

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Daniel Drake
Marijn Schouten (hkBst) wrote: Hi list, the current interface to use flags, useq, usev, use_with, use_enable, as defined in /usr/lib/portage/bin/ebuild.sh lacks generality. The common thing is testing a use flag and possibly echoing a string, but there is no function that implements this common

Re: [gentoo-dev] More general interface to use flags

2007-11-02 Thread Roy Marples
On Fri, 2007-11-02 at 14:44 +0100, Marijn Schouten (hkBst) wrote: > [[ ${flag} = !* ]] && { success=1 ; flag=${flag:1} } Could be written as [ "${flag#!}" != "${flag}" ] && { success=1; flag=${flag#!}; } > string=$( (( ${success} == 0 )) && echo ${string_success} || echo > ${string_failure} ) >

[gentoo-dev] More general interface to use flags

2007-11-02 Thread Marijn Schouten (hkBst)
Hi list, the current interface to use flags, useq, usev, use_with, use_enable, as defined in /usr/lib/portage/bin/ebuild.sh lacks generality. The common thing is testing a use flag and possibly echoing a string, but there is no function that implements this common behaviour. I propose that we add