/[smeserver]/builds_bin/functions
ViewVC logotype

Diff of /builds_bin/functions

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

Revision 1.1 by slords, Tue Jul 8 13:58:19 2008 UTC Revision 1.5 by slords, Thu Mar 5 19:32:51 2009 UTC
# Line 3  Line 3 
3  diffmv() {  diffmv() {
4      if [ ! -z "$1" -a ! -z "$2" ]      if [ ! -z "$1" -a ! -z "$2" ]
5      then      then
6          if [ "${1%%.tm}" == "$1" ]          if [ -f "$2" ]
7          then          then
8              if diff -u "$2" "$1"              if [ "${1%%.tm}" == "$1" ]
9              then              then
10                  /bin/rm -f "$1"                  if diff -u "$2" "$1"
11              else                  then
12                  /bin/mv -f "$1" "$2"                      /bin/rm -f "$1"
13              fi                  else
14          else                      /bin/mv -f "$1" "$2"
15              if diff -q "$2" "$1" > /dev/null                  fi
16              then              else
17                  /bin/rm -f "$1"                  if diff -q "$2" "$1" > /dev/null
18              else                  then
19                  /bin/mv -f "$1" "$2"                      /bin/rm -f "$1"
20              fi                  else
21          fi                      /bin/mv -f "$1" "$2"
22                    fi
23                fi
24            else
25                /bin/mv -f "$1" "$2"
26            fi
27      fi      fi
28  }  }
29    
30  diffcp() {  diffcp() {
31      if [ ! -z "$1" -a ! -z "$2" ]      if [ ! -z "$1" -a ! -z "$2" ]
32      then      then
33          if [ "${1%%.tm}" == "$1" ]          if [ -f "$2" ]
34          then          then
35              if ! diff -u "$2" "$1"              if [ "${1%%.tm}" == "$1" ]
36              then              then
37                  /bin/cp -a "$1" "$2"                  if ! diff -u "$2" "$1"
38              fi                  then
39          else                      /bin/cp -a "$1" "$2"
40              if ! diff -q "$2" "$1" > /dev/null                  fi
41              then              else
42                  /bin/cp -a "$1" "$2"                  if ! diff -q "$2" "$1" > /dev/null
43              fi                  then
44          fi                      /bin/cp -a "$1" "$2"
45                    fi
46                fi
47            else
48                /bin/cp -a "$1" "$2"
49            fi
50      fi      fi
51  }  }
52    
53  potempl() {  potempl() {
54      xgettext -L perl -o - $@ \      xgettext --from-code UTF-8 -L perl -o - $@ \
55      | sed 's@charset=CHARSET@charset=UTF-8@;s@[^ ]*/root/@root/@g;s@Project-Id-Version.*\\n@Project-Id-Version: SME Console\\n@' \      | sed 's@charset=CHARSET@charset=UTF-8@;s@[^ ]*/root/@root/@g;s@Project-Id-Version.*\\n@Project-Id-Version: SME Console\\n@' \
56      | sed '/Report-Msgid-Bugs-To/d;/POT-Creation-Date/d;/PO-Revision-Date/d;/Language-Team/d;/X-Generator/d;0,/^msgid/{/^#/d}' \      | sed '/Report-Msgid-Bugs-To/d;/POT-Creation-Date/d;/PO-Revision-Date/d;/Language-Team/d;/X-Generator/d;0,/^msgid/{/^#/d}' \
57      | msgcat -F -t UTF-8 -      | msgcat -F -t UTF-8 -
# Line 117  xmlgen() { Line 127  xmlgen() {
127      else      else
128          #lang=$(basename $(dirname $1))          #lang=$(basename $(dirname $1))
129          msgcat -F $1 \          msgcat -F $1 \
130          | perl -pe 's@<@_{_@g;s@>@_}_@g;s@&@_AMP_@g;s@\(n _}_ (\d+)\)@(n > $1)@' \          | perl -pe 's@<@_{_@g;s@>@_}_@g;s@&@_AMP_@g' \
131            | sed '/#,/d' | sed '1,/X-Generator/{;s,_{_,<,g;s,_}_,>,g;s,_AMP_,\&,g;}' \
132          | sed '/#,/d' \          | sed '/#,/d' \
133          | xml2po -m sme -p - /etc/pootle/templates/$(basename $1 | sed 's@\.pot\?$@@') \          | xml2po -m sme -p - /etc/pootle/templates/$(basename $1 | sed 's@\.pot\?$@@') \
134          | sed '1d' \          | sed '1d' \


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed