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

Re: Translations and changelogs



On Sat, Jan 17, 2004 at 10:19:54PM +0100, Nikolai Prokoschenko wrote:

> Considering changelogs: according to the current documentation, it is
> necessary for the translator to update the package's changelog, being

Well, it seems that nobody really reacted to my post.Nevertheless, I have
the first version of the script implemnting the described behaviour
attached. It would be nice, if someone expresses his opinion about it, and
I would really appreciate it being used in the deploying of udebs (and
maybe other packages too).

The general usage is at the moment relatively simple: the script outputs,
which .po-files has been updated and this output could be fed to dch. For
example, I updated the current changelog of anna (of course, no commit has
been done) from debian-installer/anna directory with a single command:

../compare_changelogs . | while read line; do dch -a "$line"; done

(compare_changelogs's location can vary, of course).

The script is not perfect, but have fun with it anyway :)

-- 
Nikolai Prokoschenko 
nikolai@prokoschenko.de / Jabber: pronik@jabber.org
#!/bin/sh
# 
# A script to find out, which .po files has been updated since the last
# update, according to the PO-Revision flag and the Debian changelog
# 
# Copyright (c) 2004 Nikolai Prokoschenko (nikolai@prokoschenko.de)
#
# This script is available under the GNU Public License
# (http://www.gnu.org/licenses/gpl.txt) 

if [ "x$1" = "x" ]
then
  echo "Usage: $0 <package-directory>"
  exit
fi

P=$1;
PACKAGE=`echo $P | sed 's/\/$//g'` 

if [ ! -d $PACKAGE ]
then
  echo "Cannot access the directory $PACKAGE!"
  exit
fi


CHANGELOG="$PACKAGE/debian/changelog"
POS="$PACKAGE/debian/po"
RELEASE="unstable"

if [ ! -e $CHANGELOG ]
then
  echo "Cannot find the changelog file!"
  exit
fi

# Line number of the changelog's old date
LINE=`grep "; urgency=" "$CHANGELOG" | grep -n "$RELEASE" | head -n 1 | sed 's/:.*//g'`

# Date of the last release
DATE=`grep " --" "$CHANGELOG" | head -n $LINE | tail -n 1 | sed 's/.*>  //g'`
OLD_DATE=`date -d "$DATE" +%s`

for i in $POS/*.po
do
  if [ -e $i ]
  then
    DATE=`grep PO-Revision "$i" | cut -d ":" -f 2,3 | sed 's/^ //g' | cut -d '\' -f 1`
    if date --date "$DATE" 2>/dev/null 1>&2 
    then
	NEW_DATE=`date -d "$DATE" +%s`
	if [ $NEW_DATE -gt $OLD_DATE ]
	then
    	    echo "Updated `echo $i | sed 's/^.*\///g'` translation"
        fi
    fi
  fi
done

Reply to: