Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] g++ 4.3.0

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Jaka Kranjc <smgl AT lynxlynx.info>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] g++ 4.3.0
  • Date: Thu, 10 Apr 2008 09:27:43 +0200

On Thursday 10 of April 2008 05:34:57 Ismael Luceno wrote:
> > There should be a function to compare versions, something like:
> >
> > sver() {
> > echo $(( `sed -e 's/\./ * 2048 + /g'` ))
> > }
> >
> > I guess 11bit padding is enough...
>
> Ouch, that's wrong. A friend suggested this:
>
> echo $((sed -e ':loop;s/\([^.-]*\)[.-]/(\1) * 2048 + /;tloop' ))
>
> Still, it has some problems:
> - it should not be sensible to changes like 1.9.2 to 1.9.2.1
> - it should support letters in the version
Luckily the version patterns don't change much with individual spells and
such
comparisons are not needed often, so approaching them individually is fine.
Writting a truly generic comparison function would be a waste of time.

LP

--
We cannot command nature except by obeying her. --Sir Francis Bacon
Have a sourcerous day! www.sourcemage.org

Attachment: signature.asc
Description: This is a digitally signed message part.




Archive powered by MHonArc 2.6.24.

Top of Page