build_chroot: check whether the data dir exists
authorMichele Tartara <mtartara@google.com>
Fri, 10 May 2013 13:45:14 +0000 (15:45 +0200)
committerMichele Tartara <mtartara@google.com>
Fri, 10 May 2013 15:50:16 +0000 (17:50 +0200)
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

index d281c20..926c74a 100755 (executable)
@@ -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