https://bugzilla.redhat.com/show_bug.cgi?id=2277345
Bug ID: 2277345 Summary: NotoSansMono[wght].ttf file name causes scripts with failglob enabled to fail Product: Fedora Version: 40 Hardware: All OS: Linux Status: NEW Component: google-noto-fonts Severity: medium Assignee: tagoh@redhat.com Reporter: hartsjc@redhat.com QA Contact: extras-qa@fedoraproject.org CC: fonts-bugs@lists.fedoraproject.org, i18n-bugs@lists.fedoraproject.org, petersen@redhat.com, pwu@redhat.com, tagoh@redhat.com Target Milestone: --- Classification: Fedora
shopt failglob If set, patterns which fail to match filenames during pathname expansion result in an expansion error.
Using this feature is good practice in scripts as helps prevent scripting mistakes; however, having file name with square brackets causes failures. And with Fedora 40 upgrade seems google-noto-sans-mono-vf-fonts-20240301-2.fc40.noarch has added one with:
/usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf
Reproducible: Always
Steps to Reproduce: 1. Causes globs that don't expand to cause errors $ shopt -s failglob
2. Try use files from rpm as variable, and fail $ for file in $(rpm -q --list google-noto-sans-mono-vf-fonts) ; do [[ -f "/${file}" ]] || echo "${file}" done -bash: no match: /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf
3. Note the RC $ echo $? 1
4. Or even command line $ rpm -qf /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf -bash: no match: /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf
$ rpm -qf '/usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf' google-noto-sans-mono-vf-fonts-20240301-2.fc40.noarch
Actual Results: -bash: no match: /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf
Expected Results: no error accessing files with failglob shopt enabled
started fedora 40 upgrade, as daily script of mine fails because this file is included in initramfs too.
https://bugzilla.redhat.com/show_bug.cgi?id=2277345
--- Comment #1 from James Hartsock hartsjc@redhat.com --- FYI google-noto-sans-mono-vf-fonts is installed for me as a vlc dependency
https://bugzilla.redhat.com/show_bug.cgi?id=2277345
--- Comment #2 from Akira TAGOH tagoh@redhat.com --- There should be no limitations in characters to be used for filename. That sounds to me like a script bug. shouldn't they try to escape such characters?
FWIW this isn't new. it was there since f38.
https://bugzilla.redhat.com/show_bug.cgi?id=2277345
--- Comment #3 from James Hartsock hartsjc@redhat.com --- Sorry. And the RPM was on my system in F39. However, it must not have been getting included in initramfs until F40. My script is looking at lsinitrd -k output, and hitting this issue.
https://bugzilla.redhat.com/show_bug.cgi?id=2277345
--- Comment #4 from James Hartsock hartsjc@redhat.com --- Agree, can work around the issue. Not a problem. Wanted to report it, as could be other backup applications that could have issue.
Feel free to close not a bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2277345
--- Comment #5 from Jens Petersen petersen@redhat.com --- I think it would make sense to raise this with upstream: it is highly unusual to have brackets in system filenames. I always thought it looked strange too.
https://bugzilla.redhat.com/show_bug.cgi?id=2277345
Akira TAGOH tagoh@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|40 |42
i18n-bugs@lists.fedoraproject.org