summaryrefslogtreecommitdiff
path: root/localcowbuilder-create
diff options
context:
space:
mode:
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" \