Fix createPot script to allow automated translation processing
authorMichael Andres <ma@suse.de>
Wed, 8 Jun 2011 12:34:39 +0000 (14:34 +0200)
committerMichael Andres <ma@suse.de>
Wed, 8 Jun 2011 12:34:39 +0000 (14:34 +0200)
po/POTFILES.in [deleted file]
po/createPot

diff --git a/po/POTFILES.in b/po/POTFILES.in
deleted file mode 100644 (file)
index acc06e5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# list of files containing translatable texts
-# find ../src \( -name '*.cc' -o -name '*.h' \) -exec grep -Pl '(\_\()|(\_PL\()' {} \; > tmp
-# cat tmp | sort > POTFILES.in.new
-../src/callbacks/keyring.h
-../src/callbacks/locks.h
-../src/callbacks/media.cc
-../src/callbacks/media.h
-../src/callbacks/repo.h
-../src/callbacks/rpm.h
-../src/Command.cc
-../src/Config.cc
-../src/info.cc
-../src/locks.cc
-../src/main.cc
-../src/main.h
-../src/misc.cc
-../src/output/OutNormal.cc
-../src/PackageArgs.cc
-../src/repos.cc
-../src/RequestFeedback.cc
-../src/search.cc
-../src/solve-commit.cc
-../src/SolverRequester.cc
-../src/SolverRequester.h
-../src/Summary.cc
-../src/update.cc
-../src/utils/Augeas.cc
-../src/utils/getopt.cc
-../src/utils/messages.cc
-../src/utils/misc.cc
-../src/utils/pager.cc
-../src/utils/prompt.cc
-../src/utils/prompt.h
-../src/Zypper.cc
index 70b5bbf..c5b318c 100755 (executable)
@@ -1,7 +1,15 @@
 #!/bin/bash
+SOURCE_DIR="${1:-..}"
+POTFILE="${2:-po/zypper.pot}"
 
 # search for sourcecode-files
-SRCFILES=$(cat POTFILES.in | grep -v -P '#.+')
+cd "$SOURCE_DIR"
+SRCFILES=`find src \
+                           -type f -name "*.h" \
+                                -o -name "*.pm"  \
+                                -o -name "*.c"   \
+                                -o -name "*.cc"  \
+                                -o -name "*.cpp"`
 
 #calling xgettext with the sourcefiles
-xgettext --no-wrap --add-comments --add-location --keyword=_ --keyword=_:1,2 --keyword=__ --keyword=N_ --keyword=_PL:1,2 --foreign-user --copyright-holder="SuSE Linux Products GmbH, Nuernberg" --default-domain=zypper --output=zypper.pot $SRCFILES
+xgettext --no-wrap --add-comments --add-location --keyword=_ --keyword=_:1,2 --keyword=__ --keyword=N_ --keyword=_PL:1,2 --foreign-user --copyright-holder="SuSE Linux Products GmbH, Nuernberg" --default-domain=zypper --output="$POTFILE" $SRCFILES