Thu Oct 29 22:12:04 2015 UTC ()
Make sure the pbulk user is created with /bin/sh as shell,
at least on NetBSD.  Trying to build with /bin/csh as login
shell leads to a rather cryptic "Illegal variable name" error
message for all bulk-built packages.


(he)
diff -r1.1 -r1.2 pkgsrc/mk/pbulk/pbulk.sh

cvs diff -r1.1 -r1.2 pkgsrc/mk/pbulk/pbulk.sh (expand / switch to unified diff)

--- pkgsrc/mk/pbulk/pbulk.sh 2014/07/15 21:29:38 1.1
+++ pkgsrc/mk/pbulk/pbulk.sh 2015/10/29 22:12:04 1.2
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1#!/bin/sh 1#!/bin/sh
2# $Id: pbulk.sh,v 1.1 2014/07/15 21:29:38 asau Exp $ 2# $Id: pbulk.sh,v 1.2 2015/10/29 22:12:04 he Exp $
3set -e 3set -e
4 4
5usage="usage: ${0##*/} [-lun] [-c mk.conf.fragment] [-d nodes]" 5usage="usage: ${0##*/} [-lun] [-c mk.conf.fragment] [-d nodes]"
6 6
7while getopts lunc:d: opt; do 7while getopts lunc:d: opt; do
8 case $opt in 8 case $opt in
9 l) limited=yes;; 9 l) limited=yes;;
10 u) unprivileged=yes;; 10 u) unprivileged=yes;;
11 n) native=yes;; 11 n) native=yes;;
12 c) mk_fragment="${OPTARG}";; 12 c) mk_fragment="${OPTARG}";;
13 d) nodes="${OPTARG}";; 13 d) nodes="${OPTARG}";;
14 \?) echo "$usage" 1>&2; exit 1;; 14 \?) echo "$usage" 1>&2; exit 1;;
15 esac 15 esac
@@ -34,27 +34,27 @@ fi @@ -34,27 +34,27 @@ fi
34: ${PBULKWORK:=${TMPDIR}/work-pbulk} 34: ${PBULKWORK:=${TMPDIR}/work-pbulk}
35 35
36: ${PACKAGES:=/mnt/packages} 36: ${PACKAGES:=/mnt/packages}
37: ${DISTDIR:=/mnt/distfiles} 37: ${DISTDIR:=/mnt/distfiles}
38: ${BULKLOG:=/mnt/bulklog} 38: ${BULKLOG:=/mnt/bulklog}
39 39
40# almost constant: 40# almost constant:
41: ${PKGSRCDIR:=/usr/pkgsrc} 41: ${PKGSRCDIR:=/usr/pkgsrc}
42 42
43# Do it early since adding it after it fails is problematic: 43# Do it early since adding it after it fails is problematic:
44if [ ! -n "$unprivileged" ]; then 44if [ ! -n "$unprivileged" ]; then
45case "$(uname)" in 45case "$(uname)" in
46NetBSD) 46NetBSD)
47if ! id pbulk; then user add -m -g users pbulk; fi 47if ! id pbulk; then user add -m -g users pbulk -s /bin/sh; fi
48;; 48;;
49FreeBSD) 49FreeBSD)
50if ! id pbulk; then 50if ! id pbulk; then
51 if ! pw groupshow users; then pw groupadd users; fi 51 if ! pw groupshow users; then pw groupadd users; fi
52 pw useradd pbulk -m -g users 52 pw useradd pbulk -m -g users
53fi 53fi
54;; 54;;
55*) 55*)
56if ! id pbulk; then echo "user \"pbulk\" is absent"; exit 1; fi 56if ! id pbulk; then echo "user \"pbulk\" is absent"; exit 1; fi
57;; 57;;
58esac 58esac
59fi 59fi
60 60