[Android] rename_package.sh: fix script
Rafaël Carré
git at videolan.org
Fri Jan 31 11:57:10 CET 2014
vlc-ports/android | branch: master | Rafaël Carré <funman at videolan.org> | Fri Jan 31 11:56:46 2014 +0100| [ef6195a85f05c40a6bcb37dc9ebde7856ae8af5b] | committer: Rafaël Carré
rename_package.sh: fix script
Remove file backups left by sed -i.orig
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=ef6195a85f05c40a6bcb37dc9ebde7856ae8af5b
---
rename_package.sh | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/rename_package.sh b/rename_package.sh
index c6ea9d9..437d671 100755
--- a/rename_package.sh
+++ b/rename_package.sh
@@ -9,17 +9,18 @@ NEW_NAME=org.videolan.vlc.$1
echo $NEW_NAME $2
-sed -i.orig -e "s/versionCode\(.*\)0\"/versionCode\1$2\"/" vlc-android/AndroidManifest.xml
-
OLD_PATH=$(echo $OLD_NAME |sed 's/\./\//g')
NEW_PATH=$(echo $NEW_NAME |sed 's/\./\//g')
-mv vlc-android/src/${OLD_PATH} vlc-android/src/tmp
-mkdir -p vlc-android/src/${OLD_PATH}
-mv vlc-android/src/tmp vlc-android/src/${NEW_PATH}
-
-find vlc-android \( -name "*.xml" -o -name "*.java" -o -name "*.cfg" -o -name "*.aidl" \) -print0 | xargs -0 sed -i.orig "s/${OLD_NAME}/${NEW_NAME}/g"
-find vlc-android \( -name "*.c" \) -print0 | xargs -0 sed -i.orig "s,${OLD_PATH},${NEW_PATH},g"
sed -i.orig "s,${OLD_PATH},${NEW_PATH},g" Makefile
-find vlc-android/jni -type f -print0 | xargs -0 sed -i.orig "s,$(echo $OLD_NAME |sed 's/\./_/g'),$(echo $NEW_NAME |sed 's/\./_/g'),g"
+cd vlc-android/
+
+sed -i.orig -e "s/versionCode\(.*\)0\"/versionCode\1$2\"/" AndroidManifest.xml
+
+(cd src/`dirname ${OLD_PATH}` && mv `basename ${OLD_PATH}` `basename ${OLD_PATH}/$1`)
+
+find . \( -name "*.xml" -o -name "*.java" -o -name "*.cfg" -o -name "*.aidl" \) -print0 | xargs -0 sed -i.orig "s/${OLD_NAME}/${NEW_NAME}/g"
+find . \( -name "*.c" \) -print0 | xargs -0 sed -i.orig "s,${OLD_PATH},${NEW_PATH},g"
+find jni -type f -print0 | xargs -0 sed -i.orig "s,$(echo $OLD_NAME |sed 's/\./_/g'),$(echo $NEW_NAME |sed 's/\./_/g'),g"
+find . -name \*.orig -exec rm -f {} \;
More information about the Android
mailing list