Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
On Tue, Feb 18, 2020 at 06:44:25PM +0500, ??? wrote: > when specifying "shell" in vtc, can we require posix /bin/sh ? or is it by > chance ? I suspect it's by default /bin/sh since not specified. I'm also seeing the string /bin/sh appearing in the vtest binary. Willy
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
On Tue, Feb 18, 2020 at 06:44:25PM +0500, Илья Шипицин wrote: > when specifying "shell" in vtc, can we require posix /bin/sh ? or is it by > chance ? > > shell { > HOST=${h1_fe1_addr} > if [ "${h1_fe1_addr}" = "::1" ] ; then > HOST="\[::1\]" > fi > > md5=$(which md5 || which md5sum) > > /bin/sh can be a symlink to bash, dash or anything else. -- William Lallemand
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
On Tue, Feb 18, 2020 at 02:29:08PM +0100, Tim Düsterhus wrote: > command -v is looking good to me: OK now pushed, thanks! Willy
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
when specifying "shell" in vtc, can we require posix /bin/sh ? or is it by chance ? shell { HOST=${h1_fe1_addr} if [ "${h1_fe1_addr}" = "::1" ] ; then HOST="\[::1\]" fi md5=$(which md5 || which md5sum) вт, 18 февр. 2020 г. в 18:24, Willy Tarreau : > On Tue, Feb 18, 2020 at 02:15:18PM +0100, Tim Düsterhus wrote: > > Willy, > > > > Am 18.02.20 um 14:06 schrieb Willy Tarreau: > > > I haven't pushed yet Ilya's patch I've just merged, I'm fine with > > > applying a change if preferred. Just let me know. > > > > `type` is required to be a builtin by POSIX [1]. The `-p` parameter does > > not appear to be standardized, though. Nonetheless I expect it to work > > in any `bash`. > > OK thanks for the info. But sadly it fails in other shells such as dash: > > $ type -p curl > -p: not found > curl is /usr/local/bin/curl > > So we can only use "type" with no argument and adjust it. Or better, > we can use "command -v" which looks OK: > > bash$ command -v curl > /usr/local/bin/curl > dash$ command -v curl > /usr/local/bin/curl > ksh$ command -v curl > /usr/local/bin/curl > > And it's also in POSIX: >https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html > > Willy >
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
Willy, Am 18.02.20 um 14:24 schrieb Willy Tarreau: > So we can only use "type" with no argument and adjust it. Or better, > we can use "command -v" which looks OK: > > bash$ command -v curl > /usr/local/bin/curl > dash$ command -v curl > /usr/local/bin/curl > ksh$ command -v curl > /usr/local/bin/curl > > And it's also in POSIX: >https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html > command -v is looking good to me: > fish$ command -v md5 || command -v md5sum > /usr/bin/md5sum > bash$ command -v md5 || command -v md5sum > /usr/bin/md5sum Best regards Tim Düsterhus
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
On Tue, Feb 18, 2020 at 02:15:18PM +0100, Tim Düsterhus wrote: > Willy, > > Am 18.02.20 um 14:06 schrieb Willy Tarreau: > > I haven't pushed yet Ilya's patch I've just merged, I'm fine with > > applying a change if preferred. Just let me know. > > `type` is required to be a builtin by POSIX [1]. The `-p` parameter does > not appear to be standardized, though. Nonetheless I expect it to work > in any `bash`. OK thanks for the info. But sadly it fails in other shells such as dash: $ type -p curl -p: not found curl is /usr/local/bin/curl So we can only use "type" with no argument and adjust it. Or better, we can use "command -v" which looks OK: bash$ command -v curl /usr/local/bin/curl dash$ command -v curl /usr/local/bin/curl ksh$ command -v curl /usr/local/bin/curl And it's also in POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html Willy
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
Willy, Am 18.02.20 um 14:06 schrieb Willy Tarreau: > I haven't pushed yet Ilya's patch I've just merged, I'm fine with > applying a change if preferred. Just let me know. `type` is required to be a builtin by POSIX [1]. The `-p` parameter does not appear to be standardized, though. Nonetheless I expect it to work in any `bash`. Thus I prefer to change the test to use `type` instead of making it dependent on `which`. Best regards Tim Düsterhus [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/type.html
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
On Sun, Feb 16, 2020 at 11:34:28AM +0100, Ionel GARDAIS wrote: > It's here on osx 10.11.6 at least. > Looks like a sh builtin. I haven't pushed yet Ilya's patch I've just merged, I'm fine with applying a change if preferred. Just let me know. Willy
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
On Sun, Feb 16, 2020 at 12:38:46AM +0500, ??? wrote: > Hello, > > > that utility is not available by default in Fedora docker image. Not surprized, that's always the fun when relying on external tools. Now merged, thanks Ilya! Willy
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
It's here on osx 10.11.6 at least. Looks like a sh builtin. -- Ionel GARDAIS Tech'Advantage CIO - IT Team manager De: " ???" À: "Tim Düsterhus" Cc: "haproxy" Envoyé: Dimanche 16 Février 2020 10:13:17 Objet: Re: [PATCH] compression/lua_validation.vtc depends on "which" utility вс, 16 февр. 2020 г. в 01:55, Tim Düsterhus < [ mailto:t...@bastelstu.be | t...@bastelstu.be ] >: Ilya, Am 15.02.20 um 20:38 schrieb Илья Шипицин: > that utility is not available by default in Fedora docker image. I believe we can rewrite that test to use the `type` builtin instead of `which`: is it POSIX ? I've just checked on freebsd, it's there. What about osx, aix, ... ? BQ_BEGIN > $ type -p md5 > $ type -p md5sum > /usr/bin/md5sum > $ md5=$(type -p md5 || type -p md5sum) > $ echo $md5 > /usr/bin/md5sum Best regards Tim Düsterhus BQ_END -- 232 avenue Napoleon BONAPARTE 92500 RUEIL MALMAISON Capital EUR 219 300,00 - RCS Nanterre B 408 832 301 - TVA FR 09 408 832 301
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
вс, 16 февр. 2020 г. в 01:55, Tim Düsterhus : > Ilya, > > Am 15.02.20 um 20:38 schrieb Илья Шипицин: > > that utility is not available by default in Fedora docker image. > > I believe we can rewrite that test to use the `type` builtin instead of > `which`: > is it POSIX ? I've just checked on freebsd, it's there. What about osx, aix, ... ? > > > $ type -p md5 > > $ type -p md5sum > > /usr/bin/md5sum > > $ md5=$(type -p md5 || type -p md5sum) > > $ echo $md5 > > /usr/bin/md5sum > > Best regards > Tim Düsterhus >
Re: [PATCH] compression/lua_validation.vtc depends on "which" utility
Ilya, Am 15.02.20 um 20:38 schrieb Илья Шипицин: > that utility is not available by default in Fedora docker image. I believe we can rewrite that test to use the `type` builtin instead of `which`: > $ type -p md5 > $ type -p md5sum > /usr/bin/md5sum > $ md5=$(type -p md5 || type -p md5sum) > $ echo $md5 > /usr/bin/md5sum Best regards Tim Düsterhus
[PATCH] compression/lua_validation.vtc depends on "which" utility
Hello, that utility is not available by default in Fedora docker image. Cheers, Ilya Shipitcin From fd8045f2f6a3c455642dc797ae6ac838f66529a6 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Sun, 16 Feb 2020 00:34:10 +0500 Subject: [PATCH] REGTESTS: add dependency compression/lua_validation.vtc on "which" when running reg-tests on Fedora docker container, it turned out that "which" utility is not installed --- reg-tests/compression/lua_validation.vtc | 1 + 1 file changed, 1 insertion(+) diff --git a/reg-tests/compression/lua_validation.vtc b/reg-tests/compression/lua_validation.vtc index 6e8c1e879..7d0488624 100644 --- a/reg-tests/compression/lua_validation.vtc +++ b/reg-tests/compression/lua_validation.vtc @@ -4,6 +4,7 @@ varnishtest "Compression validation" #REQUIRE_VERSION=1.6 #REQUIRE_OPTIONS=ZLIB|SLZ,LUA #REGTEST_TYPE=slow +#REQUIRE_BINARIES=which feature ignore_unknown_macro -- 2.24.1