public inbox for util-linux@vger.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 19:51:07 +0200	[thread overview]
Message-ID: <201406101951.07829.sweet_f_a@gmx.de> (raw)
In-Reply-To: <201406101725.22039.sweet_f_a@gmx.de>

On Tuesday 10 June 2014, Ruediger Meier wrote:
> On Tuesday 10 June 2014, Pdraig Brady wrote:
> >
> > You seem to be relying on coreutils here, using sort -V and tail -n
>

> Another possibility would be just to hardcode these few allowed
> alternative versions:
> [...]
> Very short and portable but to be maintained when version is updated
> in configure.ac

Ok, now I've choosed this compromise, see the full function below or 
patch here
https://github.com/karelzak/util-linux/pull/97

------------
# provide simple gettext backward compatibility
autopoint_fun ()
{
	# check against this hardcoded set of alternative gettext versions
	gt_ver=`gettext --version |\
		sed -n -e 's/.* \(0\.18\|0\.18\.[1-2]\)$/\1/p'`

	if [ -n "$gt_ver" ]; then
		echo "warning, force autopoint to use old gettext $gt_ver"
		rm -f configure.ac.autogenbak
		sed -i.autogenbak configure.ac \
			-e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$gt_ver])/"
	fi

	autopoint "$@" || ret=$?
	ret=$?

	if [ -n "$gt_ver" ]; then
		mv configure.ac.autogenbak configure.ac
	fi

	return $ret
}
---------

Note, sed -i is also not portable but we are using it already at another 
place.

Also note that my first more generic solution with "sort --version-sort" 
was almost useless anyway because autopoint itself can also only deal 
with a few hardcoded versions, and it would not work for rc or beta 
versions, see

$ grep -A12 "Check whether the version" /usr/bin/autopoint
# Check whether the version number is supported.
case "$ver" in
  0.10.35 | 0.10.36 | 0.10.37 | 0.10.38 | 0.10.39 | 0.10.40 | \
  0.11 | 0.11.1 | 0.11.2 | 0.11.3 | 0.11.4 | 0.11.5 | \
  0.12 | 0.12.1 | \
  0.13 | 0.13.1 | \
  0.14 | 0.14.1 | 0.14.2 | 0.14.3 | 0.14.4 | 0.14.5 | 0.14.6 | \
  0.15 | \
  0.16 | 0.16.1 | \
  0.17 | \
  0.18 | 0.18.1 | 0.18.2 | 0.18.3 )
    ;;
  *)

For me this looks really stupid. By design it wouldn't be possible (or 
at least no sense) to release 0.18.4 now since 0.19 is out already...

IMO our autopoint_fun feature should be an option for autpoint if not 
even the default behavior.

cu,
Rudi

  reply	other threads:[~2014-06-10 17:51 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
2014-06-10 17:51       ` Ruediger Meier [this message]
     [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=201406101951.07829.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox