summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-02-03 18:25:35 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2006-02-03 18:25:35 +0000
commit2cf123d1619474f3337e20e56a24b0f6515ac14b (patch)
tree8fa8e7bfd41f5fdb58b135455c49b2d6a354c558 /bin
parent36f94e7f14e11036d03d9f2282de3aae9c918f12 (diff)
downloadfedora-doc-utils-2cf123d1619474f3337e20e56a24b0f6515ac14b.tar.gz
fedora-doc-utils-2cf123d1619474f3337e20e56a24b0f6515ac14b.tar.xz
fedora-doc-utils-2cf123d1619474f3337e20e56a24b0f6515ac14b.zip
Shell script to generate one-time migration into per-language files.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/migrate-lang40
1 files changed, 40 insertions, 0 deletions
diff --git a/bin/migrate-lang b/bin/migrate-lang
new file mode 100755
index 0000000..2ade27f
--- /dev/null
+++ b/bin/migrate-lang
@@ -0,0 +1,40 @@
+#!/bin/sh
+ME=`basename $0`
+USAGE="usage: ${ME} [lang ...] | sh"
+# By default, we use the languages declared in the Makefile
+LANGUAGES=`
+ make showvars |
+ fgrep LANGUAGES |
+ sed -e 's/^[^"]*"//' -e 's/".*$//'
+`
+# Allow language selections to be overridden via the command line
+if [ $# -gt 1 ]; then
+ LANGUAGES="$@"
+fi
+# Output the shell script that will show how to do the dirty work
+changes=''
+echo "#/bin/sh"
+for theLang in ${LANGUAGES}
+do
+ if [ ! -d "${theLang}" ]; then
+ echo "echo 'Creating the ${theLang}' subdirectory."
+ echo mkdir "${theLang}"
+ echo cvs add "${theLang}"
+ changes=yes
+ fi
+ echo "echo 'Trying to populate the ${theLang}' subdirectory."
+ ls *-${theLang}.xml 2>/dev/null |
+ while read x
+ do
+ echo "Considering ${x}"
+ if [ ! -f ${theLang}/${x} ]; then
+ echo "cp ${x} ${theLang}/${x}"
+ echo "cvs add ${theLang}/${x}"
+ changes=yes
+ fi
+ done
+done
+if [ "${changes}" ]; then
+ echo "echo 'Commit changes to make them permanent.'"
+ echo cvs commit
+fi