Files
swift-mirror/utils/install-package-helper.sh
Joe Groff 1167ec1da3 Add smoke-test scripts for install packages.
Add a script that 'darwinup install'-s a package built by the buildbot and then does some simple checks that the REPL and compiler work as expected.

Swift SVN r4289
2013-03-05 23:39:10 +00:00

35 lines
667 B
Bash
Executable File

#!/bin/sh
# A helper script that only installs or uninstalls a Swift package built
# by the buildbot. The _jenkins bot should be allowed to sudo this.
# Must be root to install packages.
if [ "$(id -u)" != 0 ]; then
echo "Must install package as root!"
exit 1
fi
MODE="$1"
PACKAGE="$2"
if [ \! "$PACKAGE" ]; then
echo "No package name! Usage: $0 [install|uninstall] package.tar.gz"
exit 1
fi
case "$MODE" in
install)
darwinup install "$PACKAGE"
exit $?
;;
uninstall)
darwinup uninstall "$(basename "$PACKAGE")"
exit $?
;;
*)
echo "Mode must be install or uninstall!"
echo "Usage: $0 [install|uninstall] package.tar.gz"
exit 1
;;
esac