pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/bootstrap Replaced the weird-looking and probably wron...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/74cabd7a3288
branches:  trunk
changeset: 393836:74cabd7a3288
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu May 28 20:25:35 2009 +0000

description:
Replaced the weird-looking and probably wrong code in mkdir_p_early with
much simpler code. This works around an endless recursion (and a
segmentation fault when using bash) when ./bootstrap is run in a
read-only directory.

diffstat:

 bootstrap/bootstrap |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (30 lines):

diff -r 690692b8e56e -r 74cabd7a3288 bootstrap/bootstrap
--- a/bootstrap/bootstrap       Thu May 28 20:25:25 2009 +0000
+++ b/bootstrap/bootstrap       Thu May 28 20:25:35 2009 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.144 2009/04/23 00:15:53 minskim Exp $
+# $NetBSD: bootstrap,v 1.145 2009/05/28 20:25:35 rillig Exp $
 #
 #
 # Copyright (c) 2001-2002 Alistair G. Crooks.  All rights reserved.
@@ -282,14 +282,10 @@
 
 mkdir_p_early()
 {
-       [ -d "$1" ] && return 0 
-       mkdir -p "$1" 2> /dev/null && return 0
-       mkdir_p_early `basename "$1"`
-       if [ ! -d "$1" ] && mkdir "$1"; then
-               echo_msg "mkdir $1 exited with status $?"
-               die "aborted."
-       fi
-       return 0
+       [ -d "$1" ] && return 0
+       mkdir -p "$1" && return 0
+       [ -d "$1" ] && return 0
+       die "aborted."
 }
 
 copy_src()



Home | Main Index | Thread Index | Old Index