Ticket #10790: 0001-Abort-configure-script-if-haikuports-haikuports-cros.patch

File 0001-Abort-configure-script-if-haikuports-haikuports-cros.patch, 1.4 KB (added by arvindsraj, 10 years ago)
  • configure

    From 4701b64abdd55d3383ab21e260662612e9a783ae Mon Sep 17 00:00:00 2001
    From: Arvind S Raj <sraj.arvind@gmail.com>
    Date: Sat, 26 Apr 2014 20:55:25 +0530
    Subject: [PATCH] Abort configure script if haikuports, haikuports cross and
     haikuporter directories do not exist.
    
    ---
     configure | 28 ++++++++++++++++++++++++++++
     1 file changed, 28 insertions(+)
    
    diff --git a/configure b/configure
    index 20f7e14..4dca26f 100755
    a b  
    22#
    33# configure [ <options> ]
    44
     5# set flag to exit script when exit command is executed
     6set -e
     7
    58# usage
    69#
    710# Prints usage.
    absolute_path()  
    183186    fi
    184187}
    185188
     189# check_dir_exists
     190#
     191# check if a directory exists or not
     192#
     193check_dir_exists()
     194{
     195    if [ -d "$1" ]; then
     196        return 0
     197    else
     198        return 1
     199    fi
     200}
     201
    186202# real_path
    187203#
    188204# returns the realpath of a symbolic link.
    while [ $# -gt 0 ] ; do  
    570586            HOST_HAIKU_PORTER="`absolute_path $2`"
    571587            HAIKU_PORTS_CROSS="`absolute_path $3`"
    572588            HAIKU_PORTS="`absolute_path $4`"
     589            check_dir_exists "$HOST_HAIKU_PORTER" || (
     590                echo "Non-existent directory $HOST_HAIKU_PORTER" >&2
     591                exit 1
     592            )
     593            check_dir_exists "$HAIKU_PORTS" || (
     594                echo "Non-existent directory $HAIKU_PORTS" >&2
     595                exit 1
     596            )
     597            check_dir_exists "$HAIKU_PORTS_CROSS" || (
     598                echo "Non-existent directory $HAIKU_PORTS_CROSS" >&2
     599                exit 1
     600            )
    573601            shift 4
    574602            ;;
    575603        --build-cross-tools)