pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/bootstrap bootstrap: fix endless when checking nonexis...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1406b291fd86
branches:  trunk
changeset: 323301:1406b291fd86
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue May 07 19:54:46 2019 +0000

description:
bootstrap: fix endless when checking nonexisting directory

./bootstrap --prefix=/nonexisting had run into an endless loop.

diffstat:

 bootstrap/bootstrap |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 04ac531b7ad0 -r 1406b291fd86 bootstrap/bootstrap
--- a/bootstrap/bootstrap       Tue May 07 19:36:43 2019 +0000
+++ b/bootstrap/bootstrap       Tue May 07 19:54:46 2019 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.264 2019/05/03 13:26:34 jperkin Exp $
+# $NetBSD: bootstrap,v 1.265 2019/05/07 19:54:46 rillig Exp $
 #
 # Copyright (c) 2001-2011 Alistair Crooks <agc%NetBSD.org@localhost>
 # All rights reserved.
@@ -363,6 +363,7 @@
        _dir=$1
        while [ ! -d "$_dir" ]; do
                _dir=${_dir%/*}
+               [ "$_dir" ] || _dir="/"
        done
 
        _realdir=`cd "$_dir" && exec pwd`



Home | Main Index | Thread Index | Old Index