tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fix subst SUBST_NOOP_OK?=yes fallout



On 23.06.2020 20:01, Jonathan Perkin wrote:
* On 2020-06-23 at 18:28 BST, Roland Illig wrote:

Can you run the following lines before and after the fix? Just to make
sure that the subst.mk test suite would have caught this pdksh bug.

cd regress/infra-unittests
sh subst.sh

Before the fix everything fails (44 "assertion failed in ...").

After the fix I still see some failures:

   $ pdksh subst.sh
   assertion failed in "brackets in filename patterns": file "*" has unexpected content:
   --- /tmp/infra-unittests-47062/expected
   +++ *
   @@ -1 +1 @@
   -after
   +before

   assertion failed in "brackets in filename patterns": file "[*]" has unexpected content:
   --- /tmp/infra-unittests-47062/expected
   +++ [*]
   @@ -1 +1 @@
   -before
   +after

Oh, that's funny. This means that your shell does not expand the square
brackets in this code:

pattern='[*]'
for filename in $pattern; do
  :
done

All of NetBSD-sh, shells/bash, shells/dash, shells/mksh, shells/pdksh,
shells/oksh do that, though.

Assuming that shells/pdksh is your "primary shell", what is the shell
used by bmake? It would be strange if pdksh behaved differently between
NetBSD and macOS.

   assertion failed in "unreadable file": file "/tmp/infra-unittests-47062/output" has unexpected content:
   --- /tmp/infra-unittests-47062/expected
   +++ /tmp/infra-unittests-47062/output
   @@ -1,7 +1 @@
    => Substituting "id" in unreadable-file
   -sh: cannot open unreadable-file: permission denied
   -sh: cannot open unreadable-file: permission denied
   -*** Error code 1
   -
   -Stop.
   -bmake: stopped in /tmp/infra-unittests-47062/work

Ah, I didn't think that someone would run the tests as root. Obviously
root doesn't care about the file mode.

Thanks for the feedback.


Home | Main Index | Thread Index | Old Index