tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Bootstrap check
On Thu, Apr 09, 2009 at 09:17:52AM -0500, Larson, Timothy E. wrote:
> > attached is a patch to check that the work directory doesn't exist for
> > the bootstrap. Is this too aggressive?
>
> IIRC-I haven't looked at it since last November-this would break
> bootstrap on A/UX. (Not that I've gotten it completely working yet
> anyway...) Due to its lack of mkdir -p, it takes several attempts just
> to set up the initial directory structure before it really kicks off.
Can you try the attached patch? It also includes compat improvements for
Solaris.
Joerg
Index: bootstrap
===================================================================
RCS file: /home/joerg/repo/netbsd/pkgsrc/bootstrap/bootstrap,v
retrieving revision 1.142
diff -u -p -r1.142 bootstrap
--- bootstrap 6 Apr 2009 14:21:05 -0000 1.142
+++ bootstrap 9 Apr 2009 14:30:16 -0000
@@ -282,14 +282,14 @@ mkdir_p()
mkdir_p_early()
{
- if [ ! -d "$1" ]; then
- if mkdir -p "$1"; then
- :
- else
- echo_msg "mkdir $1 exited with status $?"
- die "aborted."
- fi
+ [ -d "$1" ] && return 0
+ mkdir -p "$1" 2> /dev/null && return 0
+ mkdir_p_early `basename "$1"` || return 1
+ if [ ! -d "$1" ] && mkdir "$1"; then
+ echo_msg "mkdir $1 exited with status $?"
+ die "aborted."
fi
+ return 0
}
copy_src()
@@ -692,6 +692,11 @@ check_prog sedprog sed
check_prog shprog sh
check_prog whoamiprog whoami
+if [ -d "${wrkdir}" ] || [ -f "${wrkdir}"; then
+ echo "\"${wrkdir}\" already exists, please remove it or use --workdir.";
+ exit 1
+fi
+
mkdir_p_early ${wrkdir}
if touch ${wrkdir}/.writeable; then
:
Home |
Main Index |
Thread Index |
Old Index