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
|
|
2 | 2 | # |
3 | 3 | # configure [ <options> ] |
4 | 4 | |
| 5 | # set flag to exit script when exit command is executed |
| 6 | set -e |
| 7 | |
5 | 8 | # usage |
6 | 9 | # |
7 | 10 | # Prints usage. |
… |
… |
absolute_path()
|
183 | 186 | fi |
184 | 187 | } |
185 | 188 | |
| 189 | # check_dir_exists |
| 190 | # |
| 191 | # check if a directory exists or not |
| 192 | # |
| 193 | check_dir_exists() |
| 194 | { |
| 195 | if [ -d "$1" ]; then |
| 196 | return 0 |
| 197 | else |
| 198 | return 1 |
| 199 | fi |
| 200 | } |
| 201 | |
186 | 202 | # real_path |
187 | 203 | # |
188 | 204 | # returns the realpath of a symbolic link. |
… |
… |
while [ $# -gt 0 ] ; do
|
570 | 586 | HOST_HAIKU_PORTER="`absolute_path $2`" |
571 | 587 | HAIKU_PORTS_CROSS="`absolute_path $3`" |
572 | 588 | 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 | ) |
573 | 601 | shift 4 |
574 | 602 | ;; |
575 | 603 | --build-cross-tools) |