blob: 7e608c5e1f19baa6a7dff2d6b910bf31dc672d8f [file] [log] [blame]
#!/bin/sh
die () {
echo "$*" >&2
exit 1
}
root=/
while test $# -gt 0
do
case "$1" in
--mingw)
root=/mingw
shift
;;
*)
break
esac
done
cd "$root" || die "$root does not exist?"
test $# -ne 1 && die "Usage: $0 <TARFILE>"
index=$(/share/msysGit/pre-install.sh) || die "Pre-install stage failed"
uncompress=
case "$1" in
*.lzma)
(cd /tmp && /share/7-Zip/7za x "$1")
set /tmp/"$(basename "$1" .lzma)"
;;
*.bz2)
uncompress=j
;;
*.gz|*.tgz)
uncompress=z
;;
esac
tar x${uncompress}mf "$1" || die "Could not untar $1"
/share/msysGit/post-install.sh $index Install "$(basename "$1")" ||
die "Post-install stage failed"