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.