Bug 1830233 - mingw-find-requires.sh fails due to invalid (unquoted) args to tr
Summary: mingw-find-requires.sh fails due to invalid (unquoted) args to tr
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-filesystem
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-01 08:55 UTC by David Woodhouse
Modified: 2020-05-10 04:50 UTC (History)
6 users (show)

Fixed In Version: mingw-filesystem-111-1.fc32 mingw-filesystem-111-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-10 03:49:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
quote escape sequences (2.70 KB, patch)
2020-05-01 08:59 UTC, David Woodhouse
no flags Details | Diff

Description David Woodhouse 2020-05-01 08:55:25 UTC
$ echo /home/dwmw2/rpmbuild/BUILDROOT/mingw-openconnect-8.09.git.8.be129af-0.fc30.x86_64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/openconnect.exe | bash -x /usr/lib/rpm/mingw-find-requires.sh  mingw64 
+ '[' -z '' ']'
+ OBJDUMP=mingw-objdump
+ targets=mingw64
+ '[' -z mingw64 ']'
++ sed 's/['\''"]/\&/g'
+ filelist=/home/dwmw2/rpmbuild/BUILDROOT/mingw-openconnect-8.09.git.8.be129af-0.fc30.x86_64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/openconnect.exe
++ echo /home/dwmw2/rpmbuild/BUILDROOT/mingw-openconnect-8.09.git.8.be129af-0.fc30.x86_64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/openconnect.exe
++ grep -Ei '\.(dll|exe)$'
++ tr k '\n'
+ dlls=/home/dwmw2/rpmbuild/BUILDROOT/mingw-openconnect-8.09.git.8.be129af-0.fc30.x86_64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/openconnect.exe
++ echo /home/dwmw2/rpmbuild/BUILDROOT/mingw-openconnect-8.09.git.8.be129af-0.fc30.x86_64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/openconnect.exe
++ grep -Ei '\.(pc)$'
++ tr k '\n'
+ pkgconfig_files=
+ for target in $targets
+ dll_found=false
+ sort -u
++ rpm --eval '%{mingw64_target}'
+ host_triplet=x86_64-w64-mingw32
+ for f in $dlls
+ [[ /home/dwmw2/rpmbuild/BUILDROOT/mingw-openconnect-8.09.git.8.be129af-0.fc30.x86_64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/openconnect.exe =~ .*x86_64-w64-mingw32.* ]]
+ mingw-objdump -p /home/dwmw2/rpmbuild/BUILDROOT/mingw-openconnect-8.09.git.8.be129af-0.fc30.x86_64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/openconnect.exe
+ grep 'DLL Name'
+ grep -Eio '[-._\+[:alnum:]]+\.dll'
+ sed 's/\(.*\)/mingw64(\1)/'
+ tr e p e o w
tr: extra operand ‘e’
Try 'tr --help' for more information.
…

That tr invocation was actually meant to be 'tr [:upper:] [:lower:]' but the shell saw [:upper:] [:lower:] first. 

$ echo [:upper:] [:lower:]
e p e o w

OK, there's random crap lying around in my home directory from where I ran this for testing.. But it seems to have affected actual RPM builds too (e.g. git clone git://git.infradead.org/users/dwmw2/openconnect.git ; cd openconnect; make -f .copr/Makefile outdir=. spec=mingw-openconnect.git build')

For robustness, the scripts should quote those sequences so that tr gets to handle them, not the shell.

Comment 1 David Woodhouse 2020-05-01 08:59:42 UTC
Created attachment 1683632 [details]
quote escape sequences

Comment 2 David Woodhouse 2020-05-01 09:00:37 UTC
This is already committed in my local tree; let me know if you want me to just push it.

Comment 3 Sandro Mani 2020-05-01 12:41:19 UTC
Yes please push it, thanks!

Comment 4 David Woodhouse 2020-05-01 12:59:35 UTC
Hm, apparently not. Did something happen to my provenpackager status?

remote: Fall-through deny
remote: Denied push for ref 'refs/heads/master' for user 'dwmw2'
remote: All changes have been rejected
To ssh://pkgs.fedoraproject.org/rpms/mingw-filesystem
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://dwmw2.org/rpms/mingw-filesystem'

Comment 5 Sandro Mani 2020-05-01 13:01:58 UTC
Otherwise just file a PR and I'll merge it

Comment 7 Fedora Update System 2020-05-01 17:14:43 UTC
FEDORA-2020-8fa048f042 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-8fa048f042

Comment 8 Fedora Update System 2020-05-01 17:14:44 UTC
FEDORA-2020-19c7d10298 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-19c7d10298

Comment 9 Fedora Update System 2020-05-02 05:32:19 UTC
FEDORA-2020-19c7d10298 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-19c7d10298`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-19c7d10298

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2020-05-02 05:54:15 UTC
FEDORA-2020-8fa048f042 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-8fa048f042`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-8fa048f042

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-05-10 03:49:27 UTC
FEDORA-2020-8fa048f042 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2020-05-10 04:50:47 UTC
FEDORA-2020-19c7d10298 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.