Re: [OS-BUILD PATCH 0/20] [redhat] All shell scripts: Fix syntax flagged by shellcheck

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

 



I'm sorry I did not clearly worded what I intended to say. Let me try
again.

On Thu, 19 Nov 2020 03:25:28 -0000, GitLab Bridge on behalf of Ben Crocker wrote:
> The warning actually comes from the text that is being cat'ed to
> the output file, so I think this is legitimate, if somewhat confusing.

I am objecting to the very idea of shellcheck warning on usage of
undeclared variables. Shell is designed to mix environment variables
and script variables. If a script wants to get input from the
environment it was run in, it just accesses the given environment
variable. Such variable will not be defined anywhere in the script.
Note this relies on unknown variable evaluating to an empty string.

In retrospective, it may not have been the best design decision of the
shell authors but here we are. Triggering a warning on such (common!)
usage is unhelpful.

> And no, rootfs is defined in this script; bootprefix will be set,
> ultimately, by whomever invokes bls.conf.

Exactly my point. Yet you are referencing
"/lib/modules/<kernel>/bls.conf" which comes from
"$rootfs/lib/modules/<kernel>/bls.conf". You should be referencing
"/vmlinuz-<kernel>" which comes from "$bootprefix/vmlinuz-<kernel>".

But as I said, I find the comment unnecessary.

 Jiri
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux