From 85b66af5e765a32dbed7c793c6749f27cbe01400 Mon Sep 17 00:00:00 2001
From: Michele Tartara <mtartara@google.com>
Date: Fri, 10 May 2013 15:45:14 +0200
Subject: [PATCH] build_chroot: check whether the data dir exists

If the data directory is not in the expected place, the script complains
with an error message and stops, instead of giving obscure messages.

Partially fixes Issue 459.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 devel/build_chroot | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/devel/build_chroot b/devel/build_chroot
index d281c2015..926c74a0c 100755
--- a/devel/build_chroot
+++ b/devel/build_chroot
@@ -34,6 +34,16 @@ then
   exit
 fi
 
+if [ ! -d $DATA_DIR ]
+then
+  echo "The data directory"
+  echo "  $DATA_DIR"
+  echo "does not exist."
+  echo "Please, set the DATA_DIR environment variable so that it points to the"
+  echo "data directory."
+  exit
+fi
+
 set -e
 
 #Cleanup
-- 
GitLab