mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
35 lines
667 B
Bash
Executable File
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
|
|
|