From 530cb500945309dff37ade10749224b6e56605d7 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 17 Mar 2008 09:30:57 +0000 Subject: Support additional options. --- localcowbuilder-create | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'localcowbuilder-create') 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 $@ -- cgit v1.2.3