pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/bootstrap bootstrap/bootstrap: allow the working direc...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/13eaf9129c5d
branches:  trunk
changeset: 397749:13eaf9129c5d
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Jul 02 16:27:04 2019 +0000

description:
bootstrap/bootstrap: allow the working directory to be a symlink

The working directory is only needed for bootstrapping pkgsrc, therefore
there aren't too many packages that can fail.

Loosening this check is needed for macOS, where /etc, /tmp and /var are
symlinks to /private, and using /tmp as the workdir for bootstrapping is
a sane choice.

diffstat:

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

diffs (30 lines):

diff -r 91da201b5cee -r 13eaf9129c5d bootstrap/bootstrap
--- a/bootstrap/bootstrap       Tue Jul 02 15:46:54 2019 +0000
+++ b/bootstrap/bootstrap       Tue Jul 02 16:27:04 2019 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.266 2019/06/20 09:11:26 jperkin Exp $
+# $NetBSD: bootstrap,v 1.267 2019/07/02 16:27:04 rillig Exp $
 #
 # Copyright (c) 2001-2011 Alistair Crooks <agc%NetBSD.org@localhost>
 # All rights reserved.
@@ -353,7 +353,8 @@
        */)     die "ERROR: The argument to $2 must not end in /." ;;
        *//* | */. | */./* | */.. | */../*)
                die "ERROR: The path $1 (from $2) must be canonical." ;;
-       /*)     checkarg_no_symlink_path "$1" "$2" ;;
+       /*)     [ "${3-}" = "may-be-symlink" ] \
+               || checkarg_no_symlink_path "$1" "$2" ;;
        *)      die "ERROR: The argument to $2 must be an absolute path." ;;
        esac
 }
@@ -505,7 +506,7 @@
 checkarg_sane_absolute_path "$varbase" "--varbase"
 checkarg_sane_relative_path "$pkginfodir" "--pkginfodir"
 checkarg_sane_relative_path "$pkgmandir" "--pkgmandir"
-checkarg_sane_absolute_path "$wrkdir" "--workdir"
+checkarg_sane_absolute_path "$wrkdir" "--workdir" may-be-symlink
 
 # set defaults for system locations if not already set by the user
 wrkobjdir=${wrkdir}/pkgsrc



Home | Main Index | Thread Index | Old Index