On 24/11/2021 17:42, Warner Losh wrote:
On Wed, Nov 24, 2021 at 8:28 AM Mateusz Piotrowski <[email protected]> wrote:
URL:
https://cgit.FreeBSD.org/src/commit/?id=169e06fa7852810f4ced2cce7a3c14ca9443bf39
<https://cgit.FreeBSD.org/src/commit/?id=169e06fa7852810f4ced2cce7a3c14ca9443bf39>
[...]
os-release: Quote variables as documented in the manual
Variables must be quoted if they contain non-alphanumeric characters.
Warner noted in the review that the lack of quoting causing problems
here is rather an edge case. I believe that it's worth adding the quotes
here anyway because this is what the specification says and there is no
good reason not to follow it.
The only place it might be needed is for _version. Everything else can't
have troublesome characters. The manual does not say you have to
quote non-alphanumeric characters in variable assignment being my
main point. Certainly not the paths and URLs. That's just gratuitous
and not generally done in shell scripts (which I thought was a good
enough reason to not do it). I'd have preferred if that nuance had
been better reflected in the commit message since the change
itself won't break anything.
It is not about the troublesome characters. From the perspective of sh(1) all those assignments were
most likely fine as you said. This change is about the os-release(5) manual page. It says that:
• Variable assignments must be included inside of double quotes if they
contain characters outside of A-Z, a-z and 0-9
The goal of this change was to stay consistent with the format specification.
I'll make sure that my future commit messages for similar changes go through a review process as
well. Often it's too easy to miss vital details for simple changes.
Best,
Mateusz