File: xml-rename

package info (click to toggle)
installation-guide 20070319
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 29,356 kB
  • ctags: 53
  • sloc: xml: 184,383; sh: 1,023; perl: 403; awk: 200; makefile: 65
file content (26 lines) | stat: -rwxr-xr-x 500 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/bash

# This script can be used to rename an xml file or directory for all
# translations.
# (Script could be expanded to really move to another location.)

SOURCE="$1"
NEWNAME="$2"

[ "$SOURCE" ] || exit 1
[ "$NEWNAME" ] || exit 1


if [ ! -e "en/$SOURCE" ]; then
	echo "Source file does not exist"
	exit 1
fi
if echo "$NEWNAME" | grep -q "/"; then
	echo "New name may not contain a directory"
	exit 1
fi

for FILE in */$SOURCE; do
	FDIR="$(dirname $FILE)"
	svn mv $FILE $FDIR/$NEWNAME
done