summaryrefslogtreecommitdiffstats
path: root/scripts/makeworld
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makeworld')
-rwxr-xr-xscripts/makeworld57
1 files changed, 37 insertions, 20 deletions
diff --git a/scripts/makeworld b/scripts/makeworld
index 8b3ec177..448dbc49 100755
--- a/scripts/makeworld
+++ b/scripts/makeworld
@@ -1,35 +1,52 @@
#!/bin/bash
toplevel=`pwd`
-version="2.0"
+version="2.1"
-if [ $# -lt 2 -o "$1" = "--help" -o "$1" = "-h" ]; then
- echo "makeworld version $version"
+usage() {
+ echo "makeworld version $version"
echo "usage: $0 [options] <destdir> <category> [category] ..."
- echo "options:"
- echo " -c, --clean Clean up work files after build"
- echo " -i, --install Install package after successful build"
- echo " -h, --help This help"
- echo
- echo " where <category> is one or more of base, opt, contrib"
- echo " eg: makeworld /packages base opt"
+ echo "options:"
+ echo " -c, --clean Clean up work files after build"
+ echo " -i, --install Install package after successful build"
+ echo " -h, --help This help"
+ echo
+ echo " where <category> is one or more directory names under the ABS root"
+ echo " eg: makeworld -c /packages base lib editors"
echo
echo " this should be run from the toplevel directory of ABS (usually /usr/abs)"
+}
+
+if [ $# -lt 2 -o "$1" = "--help" -o "$1" = "-h" ]; then
+ usage
exit 1
fi
MAKEPKG_OPTS=
-if [ "$1" = "-c" -o "$1" = "--clean" ]; then
- shift
- MAKEPKG_OPTS="$MAKEPKG_OPTS -c"
-fi
-if [ "$1" = "-i" -o "$1" = "--install" ]; then
- shift
- MAKEPKG_OPTS="$MAKEPKG_OPTS -i"
-fi
+for arg in $*; do
+ case $arg in
+ -c|--clean)
+ MAKEPKG_OPTS="$MAKEPKG_OPTS -c"
+ ;;
+ -i|--install)
+ MAKEPKG_OPTS="$MAKEPKG_OPTS -i"
+ ;;
+ *)
+ dest=$arg
+ shift
+ break
+ ;;
+ esac
+ shift
+ if [ "$dest" != "" ]; then
+ break;
+ fi
+done
-dest=$1
-shift
+if [ "$dest" = "" ]; then
+ usage
+ exit 1
+fi
sd=`date +"[%b %d %H:%M]"`