summaryrefslogtreecommitdiff
path: root/localcowbuilder-create
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-01-14 19:12:07 +0000
committerJonas Smedegaard <dr@jones.dk>2008-01-14 19:12:07 +0000
commit3294d7cdbb26864e5eed4709502615e0b7a3f819 (patch)
tree1e9f8197f05e7d81bf04900e9cdbb6c2d6245a5a /localcowbuilder-create
parentacc385799f6603c3b85d263bdce1f92a73dfe8ac (diff)
Create missing dirs, after asking.
Diffstat (limited to 'localcowbuilder-create')
-rwxr-xr-xlocalcowbuilder-create25
1 files changed, 25 insertions, 0 deletions
diff --git a/localcowbuilder-create b/localcowbuilder-create
index 896447f..7222ae4 100755
--- a/localcowbuilder-create
+++ b/localcowbuilder-create
@@ -26,6 +26,31 @@ basepath="/var/cache/pbuilder/cow-$pool"
aptcache="/var/cache/pbuilder/aptcache-$pool/"
buildresult="$HOME/src/pbuild-$pool/"
+makepaths=''
+for path in "$basepath" "$aptcache" "$buildresult"; do
+ if [ ! -d "$path" ]; then
+ echo "W: path \"$path\" does not exist"
+ makepaths='yes'
+ fi
+done
+if [ "$makepaths" = 'yes' ]; then
+ if [ "$force" != 'yes' ]; then
+ echo -n 'Create the missing paths (y/N)? '
+ read response
+ case "$response" in
+ y|Y)
+ :
+ ;;
+ *)
+ exit1 "Cannot continue without those missing paths"
+ ;;
+ esac
+ fi
+fi
+
+mkdir "$buildresult"
+sudo mkdir "$basepath" "$aptcache"
+
sudo cowbuilder --create \
--buildresult "$buildresult" \
--distribution "$distro" \