setup-dchroot: create /srv/chroot
authorHéctor Orón Martínez <zumbi@debian.org>
Mon, 30 Jan 2017 10:51:07 +0000 (11:51 +0100)
committerHéctor Orón Martínez <zumbi@debian.org>
Mon, 30 Jan 2017 10:51:07 +0000 (11:51 +0100)
Usually when new buildd is setup it does not have a basedir (/srv/chroot)
which causes script setting up build chroots to fail.
This change creates basedir if directory does not exist, instead to error out.

Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
modules/schroot/files/setup-dchroot

index c1350cd..d6275b5 100755 (executable)
@@ -294,7 +294,7 @@ if [ -z "${builddir:-}" ]; then
     fi
   done
 fi
-[ -d "$basedir" ] || die "Error: $basedir does not exist (or is not a directory)."
+[ -d "$basedir" ] || mkdir -p "$basedir"
 [ -d "$builddir" ] || die "Error: $builddir does not exist (or is not a directory)."
 
 target="$basedir/$tuple.tar.gz"