Skip to content

Commit

Permalink
Test for existing $prefix and $pkgdbdir and bail out early if they ex…
Browse files Browse the repository at this point in the history
…ist,

rather than failing with exotic errors later.
  • Loading branch information
jperkin committed Jan 10, 2017
1 parent bbf28c7 commit 96174b8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bootstrap/bootstrap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

# $NetBSD: bootstrap,v 1.236 2017/01/10 12:16:08 jperkin Exp $
# $NetBSD: bootstrap,v 1.237 2017/01/10 12:30:00 jperkin Exp $
#
# Copyright (c) 2001-2011 Alistair Crooks <[email protected]>
# All rights reserved.
Expand Down Expand Up @@ -933,6 +933,14 @@ if [ -d "${wrkdir}" ] || [ -f "${wrkdir}" ]; then
die "\"${wrkdir}\" already exists, please remove it or use --workdir"
fi

if [ -f "${prefix}/share/mk/sys.mk" ]; then
die "\"${prefix}\" already in use, remove it or use a different --prefix"
fi

if [ -d "${pkgdbdir}/bootstrap-mk-files-"* ]; then
die "\"${pkgdbdir}\" already in use, remove it or use a different --pkgdbdir"
fi

mkdir_p_early ${wrkdir}
if touch ${wrkdir}/.writeable; then
:
Expand Down

0 comments on commit 96174b8

Please sign in to comment.