/[d-i]/trunk/manual/scripts/update_pot
ViewVC logotype

Diff of /trunk/manual/scripts/update_pot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/installer/doc/manual/scripts/update_pot revision 26062 by fjpop-guest, Fri Mar 4 13:59:10 2005 UTC trunk/manual/scripts/update_pot revision 32665 by fjp, Sat Dec 3 10:34:24 2005 UTC
# Line 10  if [ "$1" = "--help" ] ; then Line 10  if [ "$1" = "--help" ] ; then
10      exit 0      exit 0
11  fi  fi
12    
13    if [ -z "`which xml2pot 2>/dev/null`"  ] ; then
14       echo "ERR: xml2pot not found, please install the poxml package"
15       exit 1
16    fi
17    
18  BUILDDIR="./build"  BUILDDIR="./build"
19  if [ -z "$PO_USEBUILD" ] ; then  if [ -z "$PO_USEBUILD" ] ; then
20      WORKDIR="./integrated"      WORKDIR="./integrated"
# Line 24  RET=0 Line 29  RET=0
29  [ -d $SOURCE ] || exit 1  [ -d $SOURCE ] || exit 1
30  mkdir -p $PODIR/pot  mkdir -p $PODIR/pot
31    
 # This check is broken!  
 if [ -n "$(find $PODIR/pot/ -name *.pot 2>/dev/null)" ] ; then  
     echo "Deleting old POT files..."  
     rm $PODIR/pot/*.pot  
 fi  
   
32  for XML in `find $SOURCEDIR -name "*.xml"` ; do  for XML in `find $SOURCEDIR -name "*.xml"` ; do
33      echo "Creating new POT file for $XML"      echo "Creating new POT file for $XML"
34      POT=$(basename $XML .xml).pot      POT=$(basename $XML .xml).pot
35    
36      xml2pot $XML >$PODIR/pot/$POT      # Let's also set a proper POT-Creation-Date
37        xml2pot $XML | \
38            sed "s/^.*POT-Creation-Date:.*$/\"POT-Creation-Date: $(date -u "+%F %R%z")\\\n\"/" \
39            >$PODIR/pot/$POT.new
40      RC=$?      RC=$?
41      if [ $RC -ne 0 ] ; then      if [ $RC -ne 0 ] ; then
42          RET=$RC          RET=$RC
43          echo "Error: error $RC while executing xml2pot"          echo "Error: error $RC while executing xml2pot"
44      fi      fi
45    
46        # Revert changes if the only thing changed is the POT-Creation-Date
47        if diff $PODIR/pot/$POT $PODIR/pot/$POT.new | grep "^>" | grep -qv "POT-Creation-Date: " ; then
48            mv $PODIR/pot/$POT.new $PODIR/pot/$POT
49        else
50            rm $PODIR/pot/$POT.new
51        fi
52  done  done
53    
54  exit $RET  exit $RET

Legend:
Removed from v.26062  
changed lines
  Added in v.32665

  ViewVC Help
Powered by ViewVC 1.1.5