From 3294d7cdbb26864e5eed4709502615e0b7a3f819 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 14 Jan 2008 19:12:07 +0000 Subject: Create missing dirs, after asking. --- localcowbuilder-create | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'localcowbuilder-create') 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" \ -- cgit v1.2.3