make upgrades work

Add a lib.version.so and when it's different, re-install.
This commit is contained in:
Joey Hess 2013-02-22 15:03:12 -04:00
parent 7315758d04
commit d868a785a2
2 changed files with 21 additions and 5 deletions

View file

@ -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 - 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 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 cd source/term && ant debug
build-utils: source build-utils: source

View file

@ -18,24 +18,34 @@ cd "$HOME"
setup () { setup () {
echo "Installation starting to $base" echo "Installation starting to $base"
cat "$base/lib/lib.version.so"
mkdir -p "$base/bin" mkdir -p "$base/bin"
for prog in busybox git-annex git-shell git-upload-pack git gpg rsync ssh ssh-keygen; do for prog in busybox git-annex git-shell git-upload-pack git gpg rsync ssh ssh-keygen; do
echo "installing $prog" 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 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 prog in git git-shell git-upload-pack; do
for link in $(cat $base/links/$prog); do for link in $(cat $base/links/$prog); do
echo "linking $link to $prog" echo "linking $link to $prog"
ln $base/bin/$prog $base/$link rm -f "$base/$link"
ln "$base/bin/$prog" "$base/$link"
done done
rm $base/links/$prog rm -f "$base/links/$prog"
done done
mkdir -p "$base/templates" mkdir -p "$base/templates"
mkdir -p "$base/tmp" mkdir -p "$base/tmp"
cp "$base/lib/lib.version.so" "$base/installed-version"
echo "Installation complete" 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" echo "Installation failed! Please report a bug and attach $HOME/git-annex-install.log"
sh sh
fi 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 fi
PATH="$base/bin:$PATH" PATH="$base/bin:$PATH"