aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2015-01-22 16:25:41 -0600
committerPeter Seebach <peter.seebach@windriver.com>2015-01-22 16:26:14 -0600
commitd8d7088e9fe21d734c170eb7054def6106e4c831 (patch)
tree472681b35fcb8b12c005d215763b72a1b0b53f5f
parent01fed630e636337cfb11bea72c21d45d80a2c10e (diff)
downloadpseudo-d8d7088e9fe21d734c170eb7054def6106e4c831.tar.gz
pseudo-d8d7088e9fe21d734c170eb7054def6106e4c831.tar.bz2
pseudo-d8d7088e9fe21d734c170eb7054def6106e4c831.zip
configure: handle nonexistent prefix
The (cd $prefix; pwd) only works when the prefix already exists. Check for prefix existing before doing that.
-rw-r--r--ChangeLog.txt3
-rwxr-xr-xconfigure7
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index e3f19ab..7a23485 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2015-01-22:
+ * (seebs) work when --prefix doesn't exist yet
+
2015-01-15:
* (seebs) Rework PSEUDO_PASSWD path allocation for clarity,
I hope.
diff --git a/configure b/configure
index 11bbee1..23ffe43 100755
--- a/configure
+++ b/configure
@@ -69,7 +69,12 @@ do
--) shift; break ;;
--prefix=*)
opt_prefix=${arg#--prefix=}
- if [ "$(cd "$opt_prefix"; pwd)" == "$(pwd)" ]; then
+ if [ -d "$opt_prefix" ]; then
+ maybe_prefix=$(cd "$opt_prefix"; pwd)
+ else
+ maybe_prefix=$opt_prefix
+ fi
+ if [ "$maybe_prefix" == "$(pwd)" ]; then
echo >&2 "ERROR: Prefix is current directory. That doesn't work."
exit 1
fi