diff options
author | Joey Hess <joey@kitenet.net> | 2013-02-22 15:03:12 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-02-22 15:03:12 -0400 |
commit | 9bf5cb3bd84fe64c7c235156b851e275bf7006ee (patch) | |
tree | 6b59e764a7f8c9d537a52c110b94601f9224ca19 /standalone/android/runshell | |
parent | c995ec63547aa976cfcfd8890b23e461e0773f16 (diff) |
make upgrades work
Add a lib.version.so and when it's different, re-install.
Diffstat (limited to 'standalone/android/runshell')
-rwxr-xr-x | standalone/android/runshell | 24 |
1 files changed, 19 insertions, 5 deletions
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" |