docs-common/bin migrate-lang,NONE,1.1

Tommy Reynolds (jtr) fedora-docs-commits at redhat.com
Fri Feb 3 18:25:42 UTC 2006


Author: jtr

Update of /cvs/docs/docs-common/bin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25784

Added Files:
	migrate-lang 
Log Message:
Shell script to generate one-time migration into per-language files.



--- NEW FILE migrate-lang ---
#!/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




More information about the Fedora-docs-commits mailing list