summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-12-05 21:41:56 +0000
committerJonas Smedegaard <dr@jones.dk>2002-12-05 21:41:56 +0000
commit17ddb3288fa163eed002afa56f92d4476afd7467 (patch)
tree9040b25a344f195b6f8983305fd878ecfa7e50a8
parentc47658f3c48dcd569339da11066cee72c0cad2c0 (diff)
Rename dirs first, then non-dirs - and make sure /xxx/ matches all dirs.
-rwxr-xr-xlocalezmangle7
1 files changed, 5 insertions, 2 deletions
diff --git a/localezmangle b/localezmangle
index 3ec9e20..613e030 100755
--- a/localezmangle
+++ b/localezmangle
@@ -3,7 +3,7 @@
# /usr/local/bin/localezmangle
# Copyright 2001-2002 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localezmangle,v 1.7 2002-12-05 20:56:10 jonas Exp $
+# $Id: localezmangle,v 1.8 2002-12-05 21:41:56 jonas Exp $
#
# Extract, rename and auto-mangle eZ Publish 2.2.x templates and languages
#
@@ -68,7 +68,10 @@ else
fi
# rename origname to targetname (ignored on multiple runs)
-for x in `cd $targetdir && find * | grep "$origname"`; do
+for x in `cd $targetdir && find * -type d | sed 's!$!/!' | grep "$origname"`; do
+ mv $targetdir/$x $targetdir/`echo $x | sed -e "s $origname $targetname g" -e 's!/$!!'`
+done
+for x in `cd $targetdir && find * -not -type d | grep "$origname"`; do
mv $targetdir/$x $targetdir/`echo $x | sed "s $origname $targetname g"`
done