summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-03-17 09:30:57 +0000
committerJonas Smedegaard <dr@jones.dk>2008-03-17 09:30:57 +0000
commit530cb500945309dff37ade10749224b6e56605d7 (patch)
tree410c1605f02125d9db0d2a1d312ca72412b148b6
parent16524ccde0e4950de011b6c2f3293b3198fa4085 (diff)
Support additional options.
-rwxr-xr-xlocalcowbuilder-create41
1 files changed, 38 insertions, 3 deletions
diff --git a/localcowbuilder-create b/localcowbuilder-create
index 14495d3..861433c 100755
--- a/localcowbuilder-create
+++ b/localcowbuilder-create
@@ -38,8 +38,42 @@ if [ $# -eq 0 ]; then
exit1 "not enough parameters"
fi
-pool=$1
-distro=${2:-$pool}
+pool=
+distro=
+while [ $# -gt 0 ]; do
+ case $1 in
+ -h|--help)
+ showhelp
+ exit 0
+ ;;
+ --arch|-a)
+ opts="$opts --debootstrapopts --arch --debootstrapopts $2"
+ shift 2
+ ;;
+ --*|-*)
+ opts="$opts $1"
+ shift
+ ;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ if [ -z "$pool" ]; then
+ pool="$1"
+ elif [ -z "$distro" ]; then
+ distro="$1"
+ else
+ othermirrors="$othermirrors --othermirror \"$1\""
+ fi
+ shift
+ ;;
+ esac
+done
+
+if [ -z "$distro" ]; then
+ distro="$pool"
+fi
basepath="/var/cache/pbuilder/cow-$pool"
aptcache="/var/cache/pbuilder/aptcache-$pool/"
@@ -73,4 +107,5 @@ sudo cowbuilder --create \
--distribution "$distro" \
--basepath "$basepath" \
--aptcache "$aptcache" \
- ${3:+--othermirror "$3"}
+ $othermirrors \
+ $opts $@