[haiku-commits] haiku: hrev47174 - /

  • From: jessica.l.hamilton@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 26 Apr 2014 18:35:03 +0200 (CEST)

hrev47174 adds 1 changeset to branch 'master'
old head: 333d4efe4f2356d9898e1749f49eef5c3931af11
new head: 39d444a339c3605e30d7d8afe671b48cb4365479
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=39d444a+%5E333d4ef

----------------------------------------------------------------------------

39d444a: Abort configure script if haikuports, haikuports cross and haikuporter 
directories do not exist.
  
  Signed-off-by: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>

                                    [ Arvind S Raj <sraj.arvind@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47174
Commit:      39d444a339c3605e30d7d8afe671b48cb4365479
URL:         http://cgit.haiku-os.org/haiku/commit/?id=39d444a
Author:      Arvind S Raj <sraj.arvind@xxxxxxxxx>
Date:        Sat Apr 26 15:25:25 2014 UTC
Committer:   Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Sat Apr 26 16:33:11 2014 UTC

----------------------------------------------------------------------------

1 file changed, 28 insertions(+)
configure | 28 ++++++++++++++++++++++++++++

----------------------------------------------------------------------------

diff --git a/configure b/configure
index 20f7e14..4dca26f 100755
--- a/configure
+++ b/configure
@@ -2,6 +2,9 @@
 #
 # configure [ <options> ]
 
+# set flag to exit script when exit command is executed
+set -e
+
 # usage
 #
 # Prints usage.
@@ -183,6 +186,19 @@ absolute_path()
        fi
 }
 
+# check_dir_exists
+#
+# check if a directory exists or not
+#
+check_dir_exists()
+{
+       if [ -d "$1" ]; then
+               return 0
+       else
+               return 1
+       fi
+}
+
 # real_path
 #
 # returns the realpath of a symbolic link.
@@ -570,6 +586,18 @@ while [ $# -gt 0 ] ; do
                        HOST_HAIKU_PORTER="`absolute_path $2`"
                        HAIKU_PORTS_CROSS="`absolute_path $3`"
                        HAIKU_PORTS="`absolute_path $4`"
+                       check_dir_exists "$HOST_HAIKU_PORTER" || (
+                               echo "Non-existent directory 
$HOST_HAIKU_PORTER" >&2
+                               exit 1
+                       )
+                       check_dir_exists "$HAIKU_PORTS" || (
+                               echo "Non-existent directory $HAIKU_PORTS" >&2
+                               exit 1
+                       )
+                       check_dir_exists "$HAIKU_PORTS_CROSS" || (
+                               echo "Non-existent directory 
$HAIKU_PORTS_CROSS" >&2
+                               exit 1
+                       )
                        shift 4
                        ;;
                --build-cross-tools)


Other related posts: