summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-22 15:03:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-22 15:03:12 -0400
commit9bf5cb3bd84fe64c7c235156b851e275bf7006ee (patch)
tree6b59e764a7f8c9d537a52c110b94601f9224ca19
parentc995ec63547aa976cfcfd8890b23e461e0773f16 (diff)
make upgrades work
Add a lib.version.so and when it's different, re-install.
-rw-r--r--standalone/android/Makefile2
-rwxr-xr-xstandalone/android/runshell24
2 files changed, 21 insertions, 5 deletions
diff --git a/standalone/android/Makefile b/standalone/android/Makefile
index e6ed1e992..0637dd293 100644
--- a/standalone/android/Makefile
+++ b/standalone/android/Makefile
@@ -59,6 +59,8 @@ build: source build-utils
cd $(GITTREE) && find -type f -not -samefile bin/git -not -samefile bin/git-shell -not -samefile bin/git-upload-pack|tar czf ../git.tar.gz -T -
cp source/git/git.tar.gz source/term/libs/armeabi/lib.git.tar.gz.so
+ git rev-parse HEAD > source/term/libs/armeabi/lib.version.so
+
cd source/term && ant debug
build-utils: source
diff --git a/standalone/android/runshell b/standalone/android/runshell
index 0a63dbc02..03d472d8c 100755
--- a/standalone/android/runshell
+++ b/standalone/android/runshell
@@ -18,24 +18,34 @@ cd "$HOME"
setup () {
echo "Installation starting to $base"
+ cat "$base/lib/lib.version.so"
+
mkdir -p "$base/bin"
for prog in busybox git-annex git-shell git-upload-pack git gpg rsync ssh ssh-keygen; do
echo "installing $prog"
- ln $base/lib/lib.$prog.so $base/bin/$prog
+ rm -f "$base/bin/$prog"
+ ln "$base/lib/lib.$prog.so" "$base/bin/$prog"
done
- $base/bin/busybox --install $base/bin
- $base/bin/tar zxf lib/lib.git.tar.gz.so
+ mkdir -p "$base/bin.new"
+ $base/bin/busybox --install $base/bin.new
+ mv $base/bin.new/* $base/bin
+ rmdir "$base/bin.new"
+
+ $base/bin/tar zxf lib/lib.git.tar.gz.so
for prog in git git-shell git-upload-pack; do
for link in $(cat $base/links/$prog); do
echo "linking $link to $prog"
- ln $base/bin/$prog $base/$link
+ rm -f "$base/$link"
+ ln "$base/bin/$prog" "$base/$link"
done
- rm $base/links/$prog
+ rm -f "$base/links/$prog"
done
mkdir -p "$base/templates"
mkdir -p "$base/tmp"
+
+ cp "$base/lib/lib.version.so" "$base/installed-version"
echo "Installation complete"
}
@@ -47,6 +57,10 @@ if [ ! -d "$base/bin" ]; then
echo "Installation failed! Please report a bug and attach $HOME/git-annex-install.log"
sh
fi
+elif [ ! -e "$base/installed-version" ] || ! cmp "$base/installed-version" "$base/lib/lib.version.so" >/dev/null; then
+ if ! setup > $HOME/git-annex-install.log 2>&1; then
+ echo "Upgrade failed! Please report a bug and attach $HOME/git-annex-install.log"
+ fi
fi
PATH="$base/bin:$PATH"