bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib.pot versioning scheme


From: Bruno Haible
Subject: Re: gnulib.pot versioning scheme
Date: Thu, 26 Mar 2009 12:47:34 +0100
User-agent: KMail/1.9.9

Sergey Poznyakoff wrote:
> the TP robot assumes that version numbers are growing
> from version to version and relies on this for sorting. Given
> this, I'll continue using the old numbering scheme for potfiles
> (gnulib-major.minor.pot), but before submitting the potfile, I'll create
> a tag TP-major.minor, so we can keep track of which Git commit it
> corresponds to.

Tags like this show up prominently on 
http://git.savannah.gnu.org/cgit/gnulib.git/
therefore I would prefer not to create tags just for the POT file. A tag like
1.2, 1.3, etc. would make people ask "where are the tarballs?".

How about changing the versioning scheme to
  gnulib-1.1.2009.03.26
or
  gnulib-1.1.1836.86a37

The code to produce the first string would be (taken from gnulib-tool's
func_version):

===============================================================================
  gnulib_dir=.
  if test -d "$gnulib_dir"/.git \
     && (git --version) >/dev/null 2>/dev/null \
     && (date --version) >/dev/null 2>/dev/null; then
    # gnulib checked out from git.
    sed_extract_first_date='/^Date/{
s/^Date:[        ]*//p
q
}'
    date=`cd "$gnulib_dir" && git log ChangeLog | sed -n -e 
"$sed_extract_first_date"`
    # Turn "Fri Mar 21 07:16:51 2008 -0600" into "Mar 21 2008 07:16:51 -0600".
    sed_year_before_time='s/^[^ ]* \([^ ]*\) \([0-9]*\) \([0-9:]*\) \([0-9]*\) 
/\1 \2 \4 \3 /'
    date=`echo "$date" | sed -e "$sed_year_before_time"`
    # Use GNU date to compute the time in GMT.
    date=`date -d "$date" -u +"%Y-%m-%d %H:%M:%S"`
    echo gnulib-1.1."$date"
  else
    if test -d "$gnulib_dir"/CVS \
       && (cvs --version) >/dev/null 2>/dev/null; then
      # gnulib checked out from CVS.
      sed_extract_first_date='/^date: /{
s/^date: \([0-9][0-9][0-9][0-9]\).\([0-9][0-9]\).\([0-9][0-9]\) 
\([0-9][0-9]:[0-9][0-9]:[0-9][0-9]\).*/\1-\2-\3 \4/p
q
}'
      date=`cd "$gnulib_dir" && cvs log -N ChangeLog 2>/dev/null | sed -n -e 
"$sed_extract_first_date"`
    else
      # gnulib copy without versioning information.
      date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog`
    fi
    version=
  fi
  echo gnulib-1.1.`echo "$date" | sed -e 's, .*,,' -e 's,-,.,g'`
===============================================================================

The code to produce the second string is (also from gnulib-tool):

===============================================================================
  gnulib_dir=.
  if test -d "$gnulib_dir"/.git \
     && (git --version) >/dev/null 2>/dev/null \
     && (date --version) >/dev/null 2>/dev/null; then
    # gnulib checked out from git.
    version=`cd "$gnulib_dir" && ./build-aux/git-version-gen /dev/null | sed -e 
's/^0\.0\.//' -e 's/-dirty//' -e 's/-/./g'`
  else
    version=???
  fi
  echo gnulib-1.1."$version"
===============================================================================

Could you also generate and publish a source snapshot when you create a gnulib
POT file? Would be useful for translators who want to get some context.
(Kbabel, PO mode, and other translation tools can show the source code context
of extracted strings.)

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]