summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-01-14 19:19:01 +0000
committerJonas Smedegaard <dr@jones.dk>2008-01-14 19:19:01 +0000
commit65db6323b21b34fc4209d07e6b1e02a0a8c7f2de (patch)
treeda959c63192e624ab754fc4004ed76e10565027c
parent3294d7cdbb26864e5eed4709502615e0b7a3f819 (diff)
Add exit1 function. Drop unneeded (and not POSIX-compliant) function declaration. Fix creating dirs only when needed, and with parents too.
-rwxr-xr-xlocalcowbuilder-create16
1 files changed, 10 insertions, 6 deletions
diff --git a/localcowbuilder-create b/localcowbuilder-create
index 7222ae4..94264c0 100755
--- a/localcowbuilder-create
+++ b/localcowbuilder-create
@@ -4,7 +4,12 @@ set -e
PRG=$(basename "$0")
-function showhelp() {
+exit() {
+ echo "ERROR: $1"
+ exit 1
+}
+
+showhelp() {
cat <<EOF
Usage: $PRG POOL [ DISTRIBUTION [ OTHERMIRROR] ]
@@ -16,7 +21,7 @@ EOF
if [ $# -eq 0 ]; then
showhelp
- exit 1
+ exit1 "not enough parameters"
fi
pool=$1
@@ -46,10 +51,9 @@ if [ "$makepaths" = 'yes' ]; then
;;
esac
fi
-fi
-
-mkdir "$buildresult"
-sudo mkdir "$basepath" "$aptcache"
+ mkdir -p "$buildresult"
+ sudo mkdir -p "$basepath" "$aptcache"
+i
sudo cowbuilder --create \
--buildresult "$buildresult" \