Skip to content

Commit

Permalink
build: restore compat with old NetBSD sh (re: 6eeafa1)
Browse files Browse the repository at this point in the history
I'd used expansions of the form ${foo-} for compatibility with a
possible future use of 'set -u'/'set -o nounset'. However, on older
NetBSD sh (as still in use on sdf.org and sdf-eu.org), if foo is
unset, then empty removal is not performed as it should and even an
unquoted ${foo-} yields an empty field. So, to be compatible with
NetBSD sh, we cannot use expansions of that form in contexts where
empty removal is expected.
  • Loading branch information
McDutchie committed Jul 10, 2024
1 parent 4d35de0 commit e4fcc3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ command=${0##*/}
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$'
[-?
@(#)$Id: '$command$' (ksh 93u+m) 2024-07-04 $
@(#)$Id: '$command$' (ksh 93u+m) 2024-07-10 $
]
[-author?Glenn Fowler <[email protected]>]
[-author?Contributors to https://github.com/ksh93/ksh]
Expand Down Expand Up @@ -548,7 +548,7 @@ SEE ALSO
pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3)

IMPLEMENTATION
version package (ksh 93u+m) 2024-07-04
version package (ksh 93u+m) 2024-07-10
author Glenn Fowler <[email protected]>
author Contributors to https://github.com/ksh93/ksh
copyright (c) 1994-2012 AT&T Intellectual Property
Expand Down Expand Up @@ -3187,7 +3187,7 @@ make|view)
case $target in
'') target="install" ;;
esac
eval capture \$\{MAMAKE_DEBUG_PREFIX-} mamake \$makeflags \$noexec \$target $assign
eval capture \$MAMAKE_DEBUG_PREFIX mamake \$makeflags \$noexec \$target $assign

case $HOSTTYPE in
darwin.*)
Expand Down Expand Up @@ -3376,7 +3376,7 @@ test) # run all available default regression tests, using our newly compiled she
set -f
set -- ${args:-src}
cd "$1" || exit
capture ${MAMAKE_DEBUG_PREFIX-} mamake test
capture $MAMAKE_DEBUG_PREFIX mamake test
;;

use) # finalize the environment
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/INIT/mamake.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* coded for portability
*/

#define RELEASE_DATE "2024-07-08"
#define RELEASE_DATE "2024-07-10"
static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";

#if _PACKAGE_ast
Expand Down Expand Up @@ -2229,7 +2229,7 @@ static int update(Rule_t *r)
}

/* do */
append(buf, "${MAMAKE_DEBUG_PREFIX-} ");
append(buf, "$MAMAKE_DEBUG_PREFIX ");
append(buf, getval(state.vars, "MAMAKE"));
append(buf, " -C ");
append(buf, r->name);
Expand Down

0 comments on commit e4fcc3d

Please sign in to comment.