From owner-svn-src-vendor@freebsd.org Fri Jul 10 11:00:43 2020 Return-Path: Delivered-To: svn-src-vendor@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E213F3662D0; Fri, 10 Jul 2020 11:00:43 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B397b5jTXz4SWN; Fri, 10 Jul 2020 11:00:43 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CC7D21008; Fri, 10 Jul 2020 11:00:43 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06AB0hPL068056; Fri, 10 Jul 2020 11:00:43 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06AB0f8s068046; Fri, 10 Jul 2020 11:00:41 GMT (envelope-from se@FreeBSD.org) Message-Id: <202007101100.06AB0f8s068046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 10 Jul 2020 11:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363074 - in vendor/bc/dist: . include manuals src tests tests/bc X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . include manuals src tests tests/bc X-SVN-Commit-Revision: 363074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 11:00:43 -0000 Author: se Date: Fri Jul 10 11:00:40 2020 New Revision: 363074 URL: https://svnweb.freebsd.org/changeset/base/363074 Log: Upgrade to version 3.1.3 This version fixes an incompatibility with GNU bc. Modified: vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/configure.sh vendor/bc/dist/include/vm.h vendor/bc/dist/locale_install.sh vendor/bc/dist/locale_uninstall.sh vendor/bc/dist/manuals/build.md vendor/bc/dist/src/vm.c vendor/bc/dist/tests/bc/stdin.txt vendor/bc/dist/tests/bc/stdin_results.txt vendor/bc/dist/tests/stdin.sh Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/Makefile.in Fri Jul 10 11:00:40 2020 (r363074) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.1 +VERSION = 3.1.3 SRC = %%SRC%% OBJ = %%OBJ%% @@ -335,7 +335,7 @@ clean_tests: clean clean_config clean_coverage @$(RM) -f bc.old install_locales: - $(LOCALE_INSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) + %%INSTALL_LOCALES%% install_bc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME) Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/NEWS.md Fri Jul 10 11:00:40 2020 (r363074) @@ -1,5 +1,25 @@ # News +## 3.1.3 + +This is a production release that fixes one minor bug: if `bc` was invoked like +the following, it would error: + +``` +echo "if (1 < 3) 1" | bc +``` + +Unless users run into this bug, they do not need to upgrade, but it is suggested +that they do. + +## 3.1.2 + +This is a production release that adds a way to install *all* locales. Users do +***NOT*** need to upgrade. + +For package maintainers wishing to make use of the change, just pass `-l` to +`configure.sh`. + ## 3.1.1 This is a production release that adds two Spanish locales. Users do ***NOT*** Modified: vendor/bc/dist/configure.sh ============================================================================== --- vendor/bc/dist/configure.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/configure.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -47,12 +47,12 @@ usage() { printf 'usage: %s -h\n' "$script" printf ' %s --help\n' "$script" - printf ' %s [-bD|-dB|-c] [-EfgGHMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" printf ' %s \\\n' "$script" printf ' [--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n' printf ' [--debug --disable-extra-math --disable-generated-tests] \\\n' printf ' [--disable-history --disable-man-pages --disable-nls] \\\n' - printf ' [--disable-prompt --disable-strip] \\\n' + printf ' [--disable-prompt --disable-strip] [--install-all-locales] \\\n' printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n' printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n' printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n' @@ -98,6 +98,10 @@ usage() { printf ' -k KARATSUBA_LEN, --karatsuba-len KARATSUBA_LEN\n' printf ' Set the karatsuba length to KARATSUBA_LEN (default is 64).\n' printf ' It is an error if KARATSUBA_LEN is not a number or is less than 16.\n' + printf ' -l, --install-all-locales\n' + printf ' Installs all locales, regardless of how many are on the system. This\n' + printf ' option is useful for package maintainers who want to make sure that\n' + printf ' a package contains all of the locales that end users might need.\n' printf ' -M, --disable-man-pages\n' printf ' Disable installing manpages.\n' printf ' -N, --disable-nls\n' @@ -319,8 +323,9 @@ nls=1 prompt=1 force=0 strip_bin=1 +all_locales=0 -while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do +while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do case "$opt" in b) bc_only=1 ;; @@ -335,6 +340,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do h) usage ;; H) hist=0 ;; k) karatsuba_len="$OPTARG" ;; + l) all_locales=1 ;; M) install_manpages=0 ;; N) nls=0 ;; O) optimization="$OPTARG" ;; @@ -423,6 +429,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do disable-nls) nls=0 ;; disable-prompt) prompt=0 ;; disable-strip) strip_bin=0 ;; + install-all-locales) all_locales=1 ;; help* | bc-only* | dc-only* | coverage* | debug*) usage "No arg allowed for --$arg option" ;; disable-bc* | disable-dc* | disable-extra-math*) @@ -431,6 +438,8 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do usage "No arg allowed for --$arg option" ;; disable-man-pages* | disable-nls* | disable-strip*) usage "No arg allowed for --$arg option" ;; + install-all-locales*) + usage "No arg allowed for --$arg option" ;; '') break ;; # "--" terminates argument processing * ) usage "Invalid option $LONG_OPTARG" ;; esac @@ -751,8 +760,15 @@ if [ "$nls" -ne 0 ]; then else install_locales_prereqs="" uninstall_locales_prereqs="" + all_locales=0 fi +if [ "$nls" -ne 0 ] && [ "$all_locales" -ne 0 ]; then + install_locales="\$(LOCALE_INSTALL) -l \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)" +else + install_locales="\$(LOCALE_INSTALL) \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)" +fi + if [ "$hist" -eq 1 ]; then set +e @@ -911,6 +927,7 @@ contents=$(replace "$contents" "HOSTCC" "$HOSTCC") contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT") contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS") contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs") +contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales") contents=$(replace "$contents" "INSTALL_LOCALES_PREREQS" "$install_locales_prereqs") contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs") contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs") Modified: vendor/bc/dist/include/vm.h ============================================================================== --- vendor/bc/dist/include/vm.h Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/include/vm.h Fri Jul 10 11:00:40 2020 (r363074) @@ -112,10 +112,10 @@ #if BC_ENABLED -#define BC_S (BC_ENABLED && (vm.flags & BC_FLAG_S)) -#define BC_W (BC_ENABLED && (vm.flags & BC_FLAG_W)) -#define BC_L (BC_ENABLED && (vm.flags & BC_FLAG_L)) -#define BC_G (BC_ENABLED && (vm.flags & BC_FLAG_G)) +#define BC_S (vm.flags & BC_FLAG_S) +#define BC_W (vm.flags & BC_FLAG_W) +#define BC_L (vm.flags & BC_FLAG_L) +#define BC_G (vm.flags & BC_FLAG_G) #endif // BC_ENABLED Modified: vendor/bc/dist/locale_install.sh ============================================================================== --- vendor/bc/dist/locale_install.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/locale_install.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -28,6 +28,9 @@ # usage() { + if [ $# -eq 1 ]; then + printf '%s\n' "$1" + fi printf "usage: %s NLSPATH main_exec [DESTDIR]\n" "$0" 1>&2 exit 1 } @@ -150,6 +153,17 @@ scriptdir=$(dirname "$script") . "$scriptdir/functions.sh" +all_locales=0 + +while getopts "l" opt; do + + case "$opt" in + l) all_locales=1 ; shift ;; + ?) usage "Invalid option $opt" ;; + esac + +done + test "$#" -ge 2 || usage nlspath="$1" @@ -180,19 +194,23 @@ fi for file in $locales_dir/*.msg; do locale=$(basename "$file" ".msg") - loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") - localeexists "$locales" "$locale" "$destdir" - err="$?" + if [ "$all_locales" -eq 0 ]; then - if [ "$err" -eq 0 ]; then - continue + localeexists "$locales" "$locale" "$destdir" + err="$?" + + if [ "$err" -eq 0 ]; then + continue + fi fi if [ -L "$file" ]; then continue fi + loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") + gencatfile "$loc" "$file" done @@ -200,14 +218,18 @@ done for file in $locales_dir/*.msg; do locale=$(basename "$file" ".msg") - loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") - localeexists "$locales" "$locale" "$destdir" - err="$?" + if [ "$all_locales" -eq 0 ]; then - if [ "$err" -eq 0 ]; then - continue + localeexists "$locales" "$locale" "$destdir" + err="$?" + + if [ "$err" -eq 0 ]; then + continue + fi fi + + loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec") mkdir -p $(dirname "$loc") Modified: vendor/bc/dist/locale_uninstall.sh ============================================================================== --- vendor/bc/dist/locale_uninstall.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/locale_uninstall.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -59,6 +59,7 @@ fi # This way, we can delete catalogs for locales that we had to install # because they are symlinks. locales=$(gen_nlspath "$destdir/$nlspath" "*" "$main_exec") +locales=$(ls $locales 2> /dev/null) for l in $locales; do rm -f "$l" Modified: vendor/bc/dist/manuals/build.md ============================================================================== --- vendor/bc/dist/manuals/build.md Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/manuals/build.md Fri Jul 10 11:00:40 2020 (r363074) @@ -366,18 +366,18 @@ can be disabled permanently in the build by passing th Both commands are equivalent. -### Long Options +### Locales -By default, `bc` and `dc` support long options like `--mathlib` and -`--interactive`. However, support for these options requires `getopt_long()` -which is not in the POSIX standard. For those platforms that do *not* have -`getopt_long()` it will be disabled automatically, or if you wish to disable -them regardless, you can pass the `-L` flag or the `--disable-long-options` -option to `configure.sh`, as follows: +By default, `bc` and `dc` do not install all locales, but only the enabled +locales. If `DESTDIR` exists and is not empty, then they will install all of +the locales that exist on the system. The `-l` flag or `--install-all-locales` +option skips all of that and just installs all of the locales that `bc` and `dc` +have, regardless. To enable that behavior, you can pass the `-l` flag or the +`--install-all-locales` option to `configure.sh`, as follows: ``` -./configure.sh -L -./configure.sh --disable-long-options +./configure.sh -l +./configure.sh --install-all-locales ``` Both commands are equivalent. Modified: vendor/bc/dist/src/vm.c ============================================================================== --- vendor/bc/dist/src/vm.c Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/src/vm.c Fri Jul 10 11:00:40 2020 (r363074) @@ -602,8 +602,21 @@ restart: else if (BC_ERR(string)) bc_parse_err(&vm.prs, BC_ERROR_PARSE_STRING); #if BC_ENABLED - else if (BC_IS_BC && BC_ERR(BC_PARSE_NO_EXEC(&vm.prs))) - bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK); + else if (BC_IS_BC && BC_ERR(BC_PARSE_NO_EXEC(&vm.prs))) { + + size_t i; + bool good = true; + + for (i = 0; good && i < vm.prs.flags.len; ++i) { + uint16_t flag = *((uint16_t*) bc_vec_item(&vm.prs.flags, i)); + good = ((flag & BC_PARSE_FLAG_BRACE) != BC_PARSE_FLAG_BRACE); + } + + if (good) { + while (BC_PARSE_IF_END(&vm.prs)) bc_vm_process("else {}", true); + } + else bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK); + } #endif // BC_ENABLED } Modified: vendor/bc/dist/tests/bc/stdin.txt ============================================================================== --- vendor/bc/dist/tests/bc/stdin.txt Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/tests/bc/stdin.txt Fri Jul 10 11:00:40 2020 (r363074) @@ -13,3 +13,4 @@ i = 4 read() i *= 5 +if (1 < 3) 1 Modified: vendor/bc/dist/tests/bc/stdin_results.txt ============================================================================== --- vendor/bc/dist/tests/bc/stdin_results.txt Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/tests/bc/stdin_results.txt Fri Jul 10 11:00:40 2020 (r363074) @@ -4,3 +4,4 @@ String /* with partial commentString /* with full comm 7 String with a # hash comment3 20 +1 Modified: vendor/bc/dist/tests/stdin.sh ============================================================================== --- vendor/bc/dist/tests/stdin.sh Fri Jul 10 09:34:47 2020 (r363073) +++ vendor/bc/dist/tests/stdin.sh Fri Jul 10 11:00:40 2020 (r363074) @@ -65,8 +65,16 @@ rm -f "$out" printf 'Running %s stdin tests...' "$d" cat "$testdir/$d/stdin.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null - diff "$testdir/$d/stdin_results.txt" "$out" + +if [ "$d" = "bc" ]; then + + cat "$testdir/$d/stdin1.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null + diff "$testdir/$d/stdin1_results.txt" "$out" + + cat "$testdir/$d/stdin2.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null + diff "$testdir/$d/stdin2_results.txt" "$out" +fi rm -f "$out1"