Author: esr
Date: Wed May  2 13:38:34 2007
New Revision: 17268

URL: http://svn.gna.org/viewcvs/wesnoth?rev=17268&view=rev
Log:
change_textdomain gets a --dryrun option like upconvert.

Modified:
    trunk/utils/change_textdomain

Modified: trunk/utils/change_textdomain
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/change_textdomain?rev=17268&r1=17267&r2=17268&view=diff
==============================================================================
--- trunk/utils/change_textdomain (original)
+++ trunk/utils/change_textdomain Wed May  2 13:38:34 2007
@@ -59,7 +59,8 @@
     cat <<EOF
 Usage: change_textdomain {-h | campaign-name oldtextdomain newtextdomain}
 Options:
-    -h, --help                   Emit this help message and quit
+    -h, --help                   Emit this help message and quit.
+    -d, --dryrun                 Echo shell actions without performing them.
 Requires as first argument a campaign name.
 Requires as second and third arguments old and new text domain names. 
 Call from the top-level directory of mainline.
@@ -123,33 +124,36 @@
 then
     usage
     exit 1
+elif [ "$1" = "-d" -o "$1" = "--dryrun" ]
+then
+    do=echo
+fi
+
+campaign=$2
+old=$3
+new=$4
+if [ $campaign = "" ]
+then
+    usage
+    die "a campaign name is required."
+elif [ ${old} = "" ]
+then
+    usage
+    die "an old textdomain name is required."
+elif [ ${new} = "" ]
+then
+    usage
+    die "a new textdomain name is required."
 else
-    campaign=$2
-    old=$3
-    new=$4
-    if [ $campaign == "" ]
-    then
-       usage
-       die "a campaign name is required."
-    elif [ $old = "" ]
-    then
-       usage
-       die "an old textdomain name is required."
-    elif [ $new = "" ]
-    then
-       usage
-       die "a new textdomain name is required."
-    else
-       # First, hack scenario and autoconf files
-       replace wesnoth-${old} wesnoth-${new} \
-           configure.ac \
-           po/Makefile.am \
-           po/wesnoth-${old}/Makevars \
-           data/${campaign}.cfg \
-           `find data/${campaign} -name "*.cfg" -print`
+    # First, hack scenario and autoconf files
+    ${do} replace ${old} ${new} \
+       configure.ac \
+       po/Makefile.am \
+       po/${old}/Makevars \
+       data/${campaign}.cfg \
+       `find data/campaigns/${campaign} -name "*.cfg" -print`
 
-       # Then do the .pot and folder moves
-       svnmove po/wesnoth-${old}/${old}.pot po/wesnoth-${old}/${new}.pot
-       svnmove po/wesnoth-${old} po/wesnoth-${new}
-    fi
+    # Then do the .pot and folder moves
+    ${do} svnmove po/${old}/${old}.pot po/${old}/${new}.pot
+    ${do} svnmove po/${old} po/${new}
 fi


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to