Need to squash the error exit status of mktemp when testing whether
authorMarc Fiuczynski <mef@cs.princeton.edu>
Thu, 25 Oct 2007 04:01:57 +0000 (04:01 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Thu, 25 Oct 2007 04:01:57 +0000 (04:01 +0000)
/data is a readonly filesystem.  Instead need to check if the result
of mktemp is an empty string or not.

build.sh

index c150605..1e6aa52 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -107,8 +107,8 @@ echo "* Building images for $FULL_VERSION_STRING"
 # is available.
 BUILDTMP=/usr/tmp
 if [ -d /data ] ; then
-       isreadonly=$(mktemp /data/isreadonly.XXXXXX)
-       if [ $? -eq 0 ] ; then
+       isreadonly=$(mktemp /data/isreadonly.XXXXXX || /bin/true)
+       if [ -n "$isreadonly" ] ; then
                rm -f "$isreadonly"
                BUILDTMP=/data
        fi