[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [kdesdk] cvs2dist skip single i18n languages
From:       Michael Buesch <mbuesch () freenet ! de>
Date:       2004-10-01 23:51:23
Message-ID: 200410020151.31282.mbuesch () freenet ! de
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi,

I hacked something together for the cvs2dist to skip individual
i18n languages for a package build. This is useful to skip
the "xx" or known broken/incomplete languages in the final
release package.

I'm not a good bash coder, but I tried my best.
Please review/comment.

Patch is attached.

Thanks.
-- 
Regards Michael Buesch  [ http://www.tuxsoft.de.vu ]


["cvs2dist.skiplang.patch" (text/x-diff)]

Index: scripts/cvs2dist
===================================================================
RCS file: /home/kde/kdesdk/scripts/cvs2dist,v
retrieving revision 1.10
diff -u -p -r1.10 cvs2dist
--- scripts/cvs2dist	7 May 2004 06:57:18 -0000	1.10
+++ scripts/cvs2dist	1 Oct 2004 23:47:11 -0000
@@ -24,7 +24,7 @@ test -e ~/.cvs2distrc && extraoptions=`c
 # --log has optional argument
 TEMP=`getopt \
 -o v:n:r:e:a:B:dhmbgol \
---long log::,version:,name:,required-header:,required-header-error-message:,make-unpa \
ckaged,help,no-bz2,no-bzip2,no-gzip,only-directory,remove-hidden,admin-dir:,branch:,no-i18n,cvs-root:,debug \
\ +--long log::,version:,name:,required-header:,required-header-error-message:,make-un \
packaged,help,no-bz2,no-bzip2,no-gzip,only-directory,remove-hidden,admin-dir:,branch:,no-i18n,no-i18n-lang:,cvs-root:,debug \
                \
 -n cvs2dist -- $extraoptions "$@"`
 
 if [ $? != 0 ]; then
@@ -37,6 +37,7 @@ eval set -- "$TEMP"
 log="/dev/null"
 calclog=0
 doi18n="yes"
+noi18nlang=""
 cvsroot=""
 debug=""
 
@@ -54,6 +55,7 @@ while true; do
 		--cvs-root) cvsroot="$2"; shift 2 ;;
 		-r|--required-header) requiredheader=$2; shift 2 ;;
 		--no-i18n) doi18n="no"; shift 1 ;;
+		--no-i18n-lang) noi18nlang="$2"; shift 2 ;;
 		-e|--required-header-error-message) requiredmsg=$2; shift 2 ;;
 		-m|--make-unpackaged) leavedir="non-empty"; shift 1 ;;
 		-h|--help) showhelp="non-empty"; shift 1 ;;
@@ -116,6 +118,9 @@ if [ ! -z $showhelp ] || [ -z $module ] 
 	echo "                    (symbolic links are OK.)"
 	echo "  -B --branch <branch> use branch for i18n checkouts."
 	echo "  --no-i18n  don't try to automatically checkout the translations from cvs."
+	echo "  --no-i18n-lang <languages> exclude all languages in the given comma"
+	echo "                             seperated list. example:"
+	echo "                             --no-i18n-lang xx,de,en_GB"
 	echo "  --log=<logfile> If logfile unspecified, default file is used."
 	echo "                  (The '=' is essential and may not be ommited"
 	echo "                  when specifying the logfile.)"
@@ -296,7 +301,23 @@ if [ $doi18n = "yes" ]; then
     pushd $temp_dir
     echo "cvs co kde-i18n/subdirs" >> $log
     cvs -z4 -q -d "$cvsroot" co $branch -P kde-i18n/subdirs > /dev/null 2>&1
-    i18nlangs="$(cat kde-i18n/subdirs)"
+    i18nlangs_tmp="$(cat kde-i18n/subdirs)"
+    skiplist="`echo $noi18nlang | sed -e 's/,/ /g'`"
+    if [ "$skiplist" ]; then
+        for lang in $i18nlangs_tmp; do
+	    must_skip="no"
+            for skip in $skiplist; do
+                if [ "$lang" = "$skip" ]; then
+                    must_skip="yes"
+                fi
+            done
+            if [ "$must_skip" = "no" ]; then
+                i18nlangs="$i18nlangs $lang"
+            fi
+        done
+    else
+       i18nlangs="$i18nlangs_tmp"
+    fi
     echo "available languages: $i18nlangs" >> $log
     popd
 fi


[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic