Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into faster-spawnveg
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnoKing committed Feb 21, 2024
2 parents 1f13248 + ad2cb4a commit f03cdbf
Show file tree
Hide file tree
Showing 43 changed files with 1,708 additions and 1,468 deletions.
3 changes: 2 additions & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ ksh 93u+m general copyright notice
# Lev Kujawski <int21h@mailbox.org> #
# Phi <phi.debian@gmail.com> #
# atheik <14833674+atheik@users.noreply.github.com> #
# Vincent Mihalkovic <vmihalko@redhat.com> #
# Ryan Schmidt <ryandesign@macports.org> #
# Harald van Dijk <harald@gigawatt.nl> #
# Chase <nicetrynsa@protonmail.ch> #
# rymrg <54061433+rymrg@users.noreply.github.com> #
# Vincent Mihalkovic <vmihalko@redhat.com> #
# hyousatsu <118750527+hyousatsu@users.noreply.github.com> #
# Trey Valenta <t@trey.net> #
# Sterling Jensen <5555776+sterlingjensen@users.noreply.github.com> #
# Marc Wilson <posguy99@gmail.com> #
Expand Down
33 changes: 33 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@ This documents significant changes in the dev branch of ksh 93u+m.
For full details, see the git log at: https://github.com/ksh93/ksh
Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library.

2024-02-11:

- Added SHOPT_PRINTF_LEGACY compile-time option for compatibility with
POSIX-ignorant external printf(1) commands that process a format operand
starting with '-' without the standard preceding '--' options terminator.
This is for backward compatibility with local system scripts. The
behaviour of the system's external printf(1) determines whether this is
compiled in or out by default. Normal ksh printf options keep working.

- Fixed a bug, introduced on 2023-06-02, that made it impossible within a
namespace to unset a function defined outside the namespace.

- Fixed: ksh didn't pass the exit status of the last command it executed to
the parent process on entering EOF (Ctrl+D) on a terminal.

2024-02-09:

- Fixed multiple inaccurate or missing values in the /opt/ast/bin/getconf
path-bound built-in command.

2024-02-08:

- Fixed an init-time crash that may occur if standard error is on a terminal,
but the path to its tty device can't be found (e.g., in a chroot situation).

- Fixed corrupted output of the 'time' keyword as formatted via TIMEFORMAT on
systems where sizeof(time_t) != sizeof(int). Bug introduced on 2020-07-13.

2024-02-06:

- Fixed a regression introduced on 2023-03-04 that caused ksh to lock up
after using the Arch Linux arch-chroot script.

2024-02-03:

- Fixed: the arithmetic representation of negative integers with a base other
Expand Down
44 changes: 40 additions & 4 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (eval "$min_posix") 2>/dev/null
then : good shell
else "$SHELL" -c "$min_posix" 2>/dev/null && exec "$SHELL" -- "$0" ${1+"$@"}
sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"}
DEFPATH=`getconf PATH` 2>/dev/null || DEFPATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin
DEFPATH=`getconf PATH 2>/dev/null` || DEFPATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin
PATH=$DEFPATH:$PATH
export PATH
sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"}
Expand Down Expand Up @@ -82,6 +82,42 @@ case $PWD in
exit 1 ;;
esac || exit

# Outputs sanitized system $PATH, eliminating duplicate and nonexistent dirs, '..', etc.
sanitize_PATH() (
set -fu +e
IFS=':'
unset -v CDPATH
sPATH=''
for dir in $1; do
# Sanitize this path, resolving symlinks,
# with special-casing of ksh's virtual built-ins directory
case $dir in
/opt/ast/bin)
test ! -d "$dir" && sdir=$dir ;;
*/* | [!+-]* | [+-]*[!0123456789]*)
sdir=$(cd -- $dir 2>/dev/null && pwd -P && echo X) ;;
*) sdir=$(cd ./$dir 2>/dev/null && pwd -P && echo X) ;;
esac || continue
sdir=${sdir%?X}
# Skip duplicates
case :$sPATH: in
*:"$sdir":*)
continue ;;
esac
# Found one, add it
sPATH=${sPATH:+$sPATH:}$sdir
done
printf '%s\n' "${sPATH#:}"
)

# Ensure a sane $PATH beginning with standard utilities.
# Find preferred 'getconf' on NixOS and Solaris/illumos.
DEFPATH=$(
PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH
getconf PATH 2>/dev/null
) || DEFPATH=/bin:/usr/bin:/sbin:/usr/sbin
PATH=$(sanitize_PATH "/opt/ast/bin:$DEFPATH:$PATH")

# shell checks
checksh()
{
Expand Down Expand Up @@ -115,7 +151,7 @@ command=${0##*/}
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$'
[-?
@(#)$Id: '$command$' (ksh 93u+m) 2024-01-22 $
@(#)$Id: '$command$' (ksh 93u+m) 2024-02-12 $
]
[-author?Glenn Fowler <gsf@research.att.com>]
[-author?Contributors to https://github.com/ksh93/ksh]
Expand Down Expand Up @@ -543,7 +579,7 @@ SEE ALSO
pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3)

IMPLEMENTATION
version package (ksh 93u+m) 2024-01-22
version package (ksh 93u+m) 2024-02-12
author Glenn Fowler <gsf@research.att.com>
author Contributors to https://github.com/ksh93/ksh
copyright (c) 1994-2012 AT&T Intellectual Property
Expand Down Expand Up @@ -3251,7 +3287,7 @@ results)set -- $target
case $filter in
errors) $exeg grep -E '^pax:|\*\*\*' $j
;;
*) $exec grep -E -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j |
*) $exec grep -E -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|read|probe|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j |
$exec grep :
;;
esac
Expand Down
74 changes: 37 additions & 37 deletions src/cmd/INIT/Mamfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,73 +20,73 @@ note *
make install virtual
make iffe
prev iffe.sh
exec - ${STDCP} iffe.sh iffe && ${STDCHMOD} u+w,+x iffe
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make mktest
prev mktest.sh
exec - ${STDCP} mktest.sh mktest && ${STDCHMOD} u+w,+x mktest
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make regress
prev regress.sh
exec - ${STDCP} regress.sh regress && ${STDCHMOD} u+w,+x regress
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make crossexec
prev crossexec.sh
exec - ${STDCP} crossexec.sh crossexec && ${STDCHMOD} u+w,+x crossexec
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make mkreq
prev mkreq.sh
exec - ${STDCP} mkreq.sh mkreq && ${STDCHMOD} u+w,+x mkreq
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make mkreq-maplib
prev mkreq-maplib.sh
exec - ${STDCP} mkreq-maplib.sh mkreq-maplib && ${STDCHMOD} u+w,+x mkreq-maplib
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make mprobe
prev mprobe.sh
exec - ${STDCP} mprobe.sh mprobe && ${STDCHMOD} u+w,+x mprobe
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make probe
make probe.sh
prev C+probe
prev make.probe
exec - ${STDCAT} C+probe make.probe > probe.sh
exec - cat ${^} > ${@}
done
exec - ${STDCP} probe.sh probe && ${STDCHMOD} u+w,+x probe
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
make ${INSTALLROOT}/bin
exec - mkdir -p ${INSTALLROOT}/bin
exec - mkdir -p ${@}
done
make ${INSTALLROOT}/bin/iffe
prev iffe
exec - ${STDCP} -f iffe ${INSTALLROOT}/bin/iffe
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/bin/mkreq
prev mkreq
exec - ${STDCP} -f mkreq ${INSTALLROOT}/bin/mkreq
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/bin/mktest
prev mktest
exec - ${STDCP} -f mktest ${INSTALLROOT}/bin/mktest
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/bin/regress
prev regress
exec - ${STDCP} -f regress ${INSTALLROOT}/bin/regress
exec - cp -f ${<} ${@}
done
make ${PACKAGEROOT}/bin
exec - mkdir -p ${PACKAGEROOT}/bin
done
make ${INSTALLROOT}/bin/crossexec
prev crossexec
exec - ${STDCP} -f crossexec ${INSTALLROOT}/bin/crossexec
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/bin/proto
note *
note * proto(1) has been removed, but install a backward compatibility stub
note * that allows old Mamfiles containing proto commands to keep working.
note *
prev proto.sh
exec - ${STDCP} proto.sh ${INSTALLROOT}/bin/proto && ${STDCHMOD} u+w,+x ${INSTALLROOT}/bin/proto
exec - cp ${<} ${@} && chmod u+w,+x ${@}
done
note *
note * ksh93 function search on PATH
Expand Down Expand Up @@ -134,7 +134,7 @@ make install virtual
exec - *PLUGIN_LIB=*)
exec - p=$x ;;
exec - *) case $u in
exec - ?* u=$u$N ;;
exec - ?*) u=$u$N ;;
exec - esac
exec - u=$u$x ;;
exec - esac
Expand Down Expand Up @@ -229,38 +229,38 @@ make install virtual
note * probe initialization
note *
make ${INSTALLROOT}/lib/probe/C
exec - mkdir -p ${INSTALLROOT}/lib/probe/C
exec - mkdir -p ${@}
done
make ${INSTALLROOT}/lib/probe/C/probe
prev C+probe
exec - ${STDCP} -f C+probe ${INSTALLROOT}/lib/probe/C/probe
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/lib/probe/C/make
exec - mkdir -p ${INSTALLROOT}/lib/probe/C/make
exec - mkdir -p ${@}
done
make ${INSTALLROOT}/lib/probe/C/pp
exec - mkdir -p ${INSTALLROOT}/lib/probe/C/pp
exec - mkdir -p ${@}
done
make ${INSTALLROOT}/lib/probe/C/mam
exec - mkdir -p ${INSTALLROOT}/lib/probe/C/mam
exec - mkdir -p ${@}
done
make ${INSTALLROOT}/lib/probe/C/mam/probe
prev mprobe
exec - ${STDCP} -f mprobe ${INSTALLROOT}/lib/probe/C/mam/probe
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/lib/probe/C/mam/mprobe
prev mprobe
exec - ${STDCP} -f mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/lib/probe/C/make/probe
prev probe
exec - ${STDCP} -f probe ${INSTALLROOT}/lib/probe/C/make/probe
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/include/ast
exec - mkdir -p ${INSTALLROOT}/include/ast
exec - mkdir -p ${@}
done
make ${INSTALLROOT}/lib/lib
exec - mkdir -p ${INSTALLROOT}/lib/lib
exec - mkdir -p ${@}
done
note *
note * check if -ldl is required
Expand All @@ -277,7 +277,7 @@ make install virtual
prev mkreq-maplib
exec - mkreq-maplib ${CC} : dl : dl.c : dl
done
exec - ${STDCP} -f dl.req ${INSTALLROOT}/lib/lib/dl
exec - cp -f ${<} ${@}
done
note *
note * requiring these is a botch
Expand All @@ -288,7 +288,7 @@ make install virtual
prev mkreq-maplib
exec - mkreq-maplib ${CC} : iconv : iconv.c : iconv
done
exec - ${STDCP} -f iconv.req ${INSTALLROOT}/lib/lib/iconv
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/lib/lib/w
make w.req
Expand All @@ -297,7 +297,7 @@ make install virtual
prev mkreq-maplib
exec - mkreq-maplib ${CC} : w : w.c w2.c : w
done
exec - ${STDCP} -f w.req ${INSTALLROOT}/lib/lib/w
exec - cp -f ${<} ${@}
done
note *
note * miscellaneous -l* checks
Expand All @@ -308,7 +308,7 @@ make install virtual
prev mkreq-maplib
exec - mkreq-maplib ${CC} : intl : intl.c : intl
done
exec - ${STDCP} -f intl.req ${INSTALLROOT}/lib/lib/intl
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/lib/lib/m
make m.req
Expand All @@ -321,15 +321,15 @@ make install virtual
prev mkreq-maplib
exec - mkreq-maplib ${CC} : m : m.c m2.c m3.c m4.c m5.c m6.c : m
done
exec - ${STDCP} -f m.req ${INSTALLROOT}/lib/lib/m
exec - cp -f ${<} ${@}
done
make ${INSTALLROOT}/lib/lib/nsl
make nsl.req
prev nsl.c
prev mkreq-maplib
exec - mkreq-maplib ${CC} : nsl : nsl.c : nsl
done
exec - ${STDCP} -f nsl.req ${INSTALLROOT}/lib/lib/nsl
exec - cp -f ${<} ${@}
done
note *
note * what was sco smoking
Expand All @@ -344,7 +344,7 @@ make install virtual
prev mkreq-maplib
exec - mkreq-maplib ${CC} : socket : socket.c nsl.c : socket
done
exec - ${STDCP} -f socket.req ${INSTALLROOT}/lib/lib/socket
exec - cp -f ${<} ${@}
done
note *
note * more substance abuse
Expand All @@ -367,17 +367,17 @@ make install virtual
prev mkreq-maplib
exec - mkreq-maplib ${CC} : dbm : db.c gdbm.c gdbm1.c gdbm2.c : db gdbm_compat gdbm ndbm dbm
done
exec - ${STDCP} -f dbm.req ${INSTALLROOT}/lib/lib/dbm
exec - cp -f ${<} ${@}
done
done install
make test dontcare virtual
make test.iffe virtual
prev iffe.tst
exec - regress iffe.tst iffe
exec - regress ${<} iffe
done
make test.mamake virtual
prev mamake.tst
exec - : testing non-libast mamake at $PWD/mamake :
exec - regress mamake.tst mamake
exec - regress ${<} mamake
done
done test
Loading

0 comments on commit f03cdbf

Please sign in to comment.