Bug 2002038 - rpm doesn't handle names with caret (^)
Summary: rpm doesn't handle names with caret (^)
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: openqa
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-07 19:23 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2023-05-25 19:31 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-05-25 19:31:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm issues 2070 0 None open Query arguments with ^ not working 2022-05-13 07:19:34 UTC

Internal Links: 2129468

Description Zbigniew Jędrzejewski-Szmek 2021-09-07 19:23:15 UTC
Description of problem:
I noticed this when doing some listing of installed packages:

$ rpm -qa|grep '\^'
python3-jedi-0.17.2^20200805git209e271-2.fc34.noarch
pythran-0.9.8^post3-3.fc34.x86_64
$ rpm -q 'python3-jedi-0.17.2^20200805git209e271-2.fc34.noarch'
package python3-jedi-0.17.2^20200805git209e271-2.fc34.noarch is not installed
$ rpm -q 'pythran-0.9.8^post3-3.fc34.x86_64'                   
package pythran-0.9.8^post3-3.fc34.x86_64 is not installed

It seems like rpm does one layer of unexpected unescaping somewhere:
$ rpm -q 'python3-jedi-0.17.2\^20200805git209e271-2.fc34.noarch'
python3-jedi-0.17.2^20200805git209e271-2.fc34.noarch
$ rpm -q 'pythran-0.9.8\^post3-3.fc34.x86_64'
pythran-0.9.8^post3-3.fc34.x86_64

(Note that '^' is not special for the shell, so '\^' gets passed as two characters to rpm, a backslash and the caret.)

Version-Release number of selected component (if applicable):
rpm-4.16.1.3-1.fc34.x86_64

How reproducible:
Seems deterministic.

Comment 1 Zbigniew Jędrzejewski-Szmek 2021-09-07 19:27:29 UTC
Same with rpm-4.17.0-0.rc1.0.fc36.x86_64.

Comment 2 Adam Williamson 2022-02-25 21:00:42 UTC
I just ran into this. A check we do in openQA actually relies on this working, so it's kind of awkward that it's broken. I'll have to see if I can work around it somehow.

Comment 3 Adam Williamson 2022-02-25 21:01:27 UTC
oh, I see Zbigniew figured out the workaround already :D thanks.

Comment 4 Zbigniew Jędrzejewski-Szmek 2022-02-25 21:14:38 UTC
Heh, this is a few months old already. No answer from maintainers ;)

This is also an issue in F35:
$ rpm -q 'radamsa-0.6^20200531.g8121b78-2.fc35.x86_64' 
package radamsa-0.6^20200531.g8121b78-2.fc35.x86_64 is not installed
$ rpm -q 'radamsa-0.6\^20200531.g8121b78-2.fc35.x86_64'
radamsa-0.6^20200531.g8121b78-2.fc35.x86_64
$ rpm -q rpm                                           
rpm-4.17.0-4.fc35.x86_64

Comment 5 Adam Williamson 2022-02-25 21:35:26 UTC
And F36. That's where we hit it in openQA.

Comment 6 Adam Williamson 2022-02-26 02:14:02 UTC
Hah, working around this for openQA gets fairly comical. They call me Houdini because I'm all about escaping:

script_run 'for pkg in $(cat /var/log/updatepkgnames.txt); do rpm -q $pkg && rpm -q $pkg --last | head -1 | cut -d" " -f1 | sed -e \'s,\^,\\\\\\\\^,g\' | xargs rpm -q --qf "%{SOURCERPM} %{EPOCH} %{NAME}-%{VERSION}-%{RELEASE}\n" >> /tmp/installedupdatepkgs.txt; done';

yes, that's *eight* slashes. And it has to go inside single quotes for some goddamn reason. That's what you get when it goes through perl and bash before it gets to sed, I guess...

Comment 7 Ben Cotton 2022-05-12 16:22:12 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 8 Zbigniew Jędrzejewski-Szmek 2022-05-12 18:42:21 UTC
Reproduces with rpm-4.17.0-10.fc36.x86_64.

Comment 9 Panu Matilainen 2022-05-13 07:19:34 UTC
This is an upstream issue and as such, best tracked there.

Comment 10 Adam Williamson 2023-01-26 18:54:02 UTC
This is now fixed upstream and the fix is in F37 and Rawhide, but it isn't in F36. It would be nice if it could be backported to F36, as I can't remove the hideous workaround from openQA until it's fixed on all active branches.

I *think* this requires backporting two changes, one to add handling of the caret to the "Find no. of bytes needed for pattern." block, and one to add it to the "Copy pattern, escaping periods, prefixing splats with period." block.

Comment 11 Ben Cotton 2023-04-25 18:22:45 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 12 Ludek Smid 2023-05-25 19:31:00 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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