/[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.8 by unnilennium, Tue Mar 14 22:24:56 2017 UTC Revision 1.9 by jpp, Sun Apr 28 18:53:34 2024 UTC
# Line 1  Line 1 
1  #!/usr/bash  #!/usr/bash
2    
 strippo() {  
     msgcat --sort-by-file --width 80 --to-code UTF-8 $1 \  
     | sed '/^"\(Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language\|Language-Team\|X-Generator\):/d;0,/^msgid/{/^#/d}'  
 }  
   
 podiff() {  
     src=$1  
     dst=${2:-$(echo $1 | sed 's,/tmp/,/po/,')}  
   
     if [ "${src%%.pot}" != "$src" -o "${src%%.po}" != "$src" ]  
     then  
         diff --unified --label "$src" <(strippo $src) --label "$dst" <(strippo $dst)  
     elif [ "${src%%.tm}" != "$src" ]  
     then  
         diff --brief $src $dst > /dev/null  
     else  
         diff --unified $src $dst  
     fi  
 }  
   
3  diffmv() {  diffmv() {
4      if [ ! -z "$1" -a ! -z "$2" ]      if [ ! -z "$1" -a ! -z "$2" ]
5      then      then
6          if [ -f "$2" ]          if [ -f "$2" ]
7          then          then
8              if podiff "$2" "$1"              if [ "${1%%.tm}" == "$1" ]
9              then              then
10                  /bin/rm -f "$1"                  if diff -u "$2" "$1"
11                    then
12                        /bin/rm -f "$1"
13                    else
14                        /bin/mv -f "$1" "$2"
15                    fi
16              else              else
17                  /bin/mv -f "$1" "$2"                  if diff -q "$2" "$1" > /dev/null
18                    then
19                        /bin/rm -f "$1"
20                    else
21                        /bin/mv -f "$1" "$2"
22                    fi
23              fi              fi
24          else          else
25              /bin/mv -f "$1" "$2"              /bin/mv -f "$1" "$2"
# Line 42  diffcp() { Line 32  diffcp() {
32      then      then
33          if [ -f "$2" ]          if [ -f "$2" ]
34          then          then
35              if ! podiff "$2" "$1"              if [ "${1%%.tm}" == "$1" ]
36              then              then
37                  /bin/cp -a "$1" "$2"                  if ! diff -u "$2" "$1"
38                    then
39                        /bin/cp -a "$1" "$2"
40                    fi
41                else
42                    if ! diff -q "$2" "$1" > /dev/null
43                    then
44                        /bin/cp -a "$1" "$2"
45                    fi
46              fi              fi
47          else          else
48              /bin/cp -a "$1" "$2"              /bin/cp -a "$1" "$2"
# Line 83  xmltempl() { Line 81  xmltempl() {
81  }  }
82    
83  anacondatmpl() {  anacondatmpl() {
     content=""  
     if [[ "$1" == "sme8" ]];then  
          content="/var/lib/pootle/cvs/smeserver/cdrom.image/$1/updates/*.py  /var/lib/pootle/cvs/smeserver/cdrom.image/$1/*/installclasses/*.py"  
     fi  
84      xgettext -L python \      xgettext -L python \
85               -k=_ \               -k=_ \
86               -k=N_ \               -k=N_ \
87               -o - \               -o - \
88               $(sed -n "/\.py/s@^\([^ \t]\+\)[ \t]\+\([^/]\+\)\(/.*\)\?@/var/lib/pootle/cvs/smeserver/\2/$1/\2-*\3/\1@p" \               $(sed -n "/\.py/s@^\([^ \t]\+\)[ \t]\+\([^/]\+\)\(/.*\)\?@/var/lib/pootle/cvs/smeserver/\2/$1/\2-*\3/\1@p" \
89                     /var/lib/pootle/cvs/smeserver/cdrom.image/$1/updates/README.txt) \                     /var/lib/pootle/cvs/smeserver/cdrom.image/$1/updates/README.txt) \
90                  $content \               /var/lib/pootle/cvs/smeserver/cdrom.image/$1/updates/*.py \
91      2> /dev/null \               /var/lib/pootle/cvs/smeserver/cdrom.image/$1/*/installclasses/*.py \
92      | sed 's@charset=CHARSET@charset=UTF-8@;s@Id-Version.*\\n@Id-Version: SME Template\\n@' \      | sed 's@charset=CHARSET@charset=UTF-8@;s@Id-Version.*\\n@Id-Version: SME Template\\n@' \
93      | sed 's@/var/lib/pootle/cvs/smeserver/[^/]\+/@@' \      | sed 's@/var/lib/pootle/cvs/smeserver/[^/]\+/@@' \
94      | msgcat -u \      | msgcat -u \


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