mk-sbuild-lv: updates to fix for bug 342154 (actually create directories)

This commit is contained in:
Kees Cook 2009-03-30 11:52:00 -07:00
parent 7105552708
commit a0f1b047a7

View File

@ -78,6 +78,14 @@ if [ ! -w /var/lib/sbuild ]; then
1;
EOM
sensible-editor ~/.sbuildrc
# Create target directories, if needed
eval $(egrep '^\$(build|log)_dir[ ]*=' ~/.sbuildrc | cut -c2-)
if [ -n "$log_dir" ]; then
mkdir -p "$log_dir"
fi
if [ -n "$build_dir" ]; then
mkdir -p "$build_dir"
fi
else
echo "Your ~/.sbuildrc already exists -- leaving it as-is."
fi
@ -210,18 +218,6 @@ if [ $DEBIAN ] && [ ! -x /usr/bin/cdebootstrap ]; then
exit 1
fi
if [ ! -d $build_dir ]; then
echo "Build directory $build_dir does not exist."
echo "Please create it or change the setting in ~/.sbuildrc ."
exit 1
fi
if [ ! -d $log_dir ]; then
echo "Log directory $log_dir does not exist."
echo "Please create it or change the setting in ~/.sbuildrc ."
exit 1
fi
# Does the specified VG exist? (vgdisplay doesn't set error codes...)
if [ `sudo vgdisplay -c "$VG" | wc -l` -eq 0 ]; then
exit 1