pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/bootstrap Fixed the infinite recursion as suggested in...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c3d4b5534c04
branches:  trunk
changeset: 393904:c3d4b5534c04
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri May 29 15:58:37 2009 +0000

description:
Fixed the infinite recursion as suggested in PR 41446. Thanks for the
patch.

diffstat:

 bootstrap/bootstrap |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 03eed8280f63 -r c3d4b5534c04 bootstrap/bootstrap
--- a/bootstrap/bootstrap       Fri May 29 15:51:34 2009 +0000
+++ b/bootstrap/bootstrap       Fri May 29 15:58:37 2009 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.145 2009/05/28 20:25:35 rillig Exp $
+# $NetBSD: bootstrap,v 1.146 2009/05/29 15:58:37 rillig Exp $
 #
 #
 # Copyright (c) 2001-2002 Alistair G. Crooks.  All rights reserved.
@@ -282,10 +282,15 @@
 
 mkdir_p_early()
 {
-       [ -d "$1" ] && return 0
-       mkdir -p "$1" && return 0
-       [ -d "$1" ] && return 0
-       die "aborted."
+       [ -d "$1" ] && return 0 
+       mkdir -p "$1" 2> /dev/null && return 0
+       parent=`dirname "$1"`
+       mkdir_p_early "$parent"
+       if [ ! -d "$1" ] && mkdir "$1"; then
+               echo_msg "mkdir $1 exited with status $?"
+               die "aborted."
+       fi
+       return 0
 }
 
 copy_src()



Home | Main Index | Thread Index | Old Index