All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: "Pádraig Brady" <P@draigbrady.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] build-sys: use gettext 0.18.3 if possible
Date: Tue, 10 Jun 2014 17:25:21 +0200	[thread overview]
Message-ID: <201406101725.22039.sweet_f_a@gmx.de> (raw)
In-Reply-To: <53970EAF.4010801@draigBrady.com>

On Tuesday 10 June 2014, Pádraig Brady wrote:
> On 06/10/2014 11:08 AM, Ruediger Meier wrote:
> > autopoint_fun ()
> > +{
> > +	# we have to deal with set -e ...
> > +	rm -f configure.ac.autogenbak
> > +	ret="0"
> > +	GT_VER_MIN="0.18"
> > +	GT_VER_DEF=$(sed -n 's/AM_GNU_GETTEXT_VERSION(\[\(.*\)\])/\1/p'
> > configure.ac) +	GT_VER_HAVE="$(gettext --version | head -n 1 | sed
> > 's/.* //g')" +
> > +	tmp=$(echo -e "$GT_VER_MIN\n$GT_VER_HAVE" | sort -V | tail -n1)
> > +	tmp=$(echo -e "$GT_VER_DEF\n$tmp" | sort -V | head -n1)
>
> You seem to be relying on coreutils here, using sort -V and tail -n

Yes, I've guessed it's hard to do it fully portable. It's IMO already 
not safely possible parse gettext --version.

To not write much more ugly shell code to handle all this I think about 
only touching configure.ac if all of these commands above succeed as 
expected.
In other words: If it's not easily possible to find an older but good 
gettext version then don't do anything - user has to edit configure.ac 
manually or update to 0.18.3.


Another possibility would be just to hardcode these few allowed 
alternative versions:
---
altver=$(gettext --version |\
	sed -n 's/.* \(0\.18\|0\.18\.[1-2]\)$/\1/p')
test -n "$altver" && # sed configure.ac ...
autopoint ...
---
Very short and portable but to be maintained when version is updated in 
configure.ac

BTW does anybody know what kind of version string you get when using 
gettext from git or beta releae?


> Note echo is exceptionally non portable. Better to use printf
> instead.
>
> thanks,
> Pádraig.
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



  reply	other threads:[~2014-06-10 15:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 10:08 [PATCH] next try to update gettext version Ruediger Meier
2014-06-10 10:08 ` [PATCH] build-sys: use gettext 0.18.3 if possible Ruediger Meier
2014-06-10 11:52   ` Karel Zak
2014-06-10 12:04     ` Ruediger Meier
2014-06-10 12:16       ` Karel Zak
2014-06-10 12:23       ` Karel Zak
2014-06-10 13:41         ` Ruediger Meier
2014-06-10 13:57   ` Pádraig Brady
2014-06-10 15:25     ` Ruediger Meier [this message]
2014-06-10 17:51       ` Ruediger Meier
     [not found] ` <53974319.7040608@gmail.com>
2014-06-11 22:18   ` [PATCH] next try to update gettext version Ruediger Meier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201406101725.22039.sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=P@draigbrady.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.