Bug 1753343 - Incorrect parsing of "--setopt" with repositories with dots
Summary: Incorrect parsing of "--setopt" with repositories with dots
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils
Version: 7.6
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-18 16:10 UTC by Brian J. Murrell
Modified: 2019-09-24 11:56 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1746349
Environment:
Last Closed: 2019-09-24 11:51:44 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Brian J. Murrell 2019-09-18 16:10:14 UTC
I think this needs a backport for EL7 as setting options for repos added with yum-config-manager by url don't work, presumably because they have dots in the fqdn portion of the url they were created from.

+++ This bug was initially created as a clone of Bug #1746349 +++

Description of problem:

The "--setopt" have a problem with repositories with dots in id. The option parser uses first dot as a delimiter.
Repository id may contain dots but option name can't. -> So, the last dot is delimiter and not the first one.
   
Example:
"--setopt=re.po.option=value " is parsed as repo id "re" and option "po.option". Correct result is repo id "re.po" and option "option".

--- Additional comment from Jaroslav Rohel on 2019-08-28 09:09:24 UTC ---

I made fix in upstream PR https://github.com/rpm-software-management/dnf/pull/1466 .

--- Additional comment from Jaroslav Rohel on 2019-08-28 09:11:53 UTC ---

The bug was catch during testing config-repo plugin https://bugzilla.redhat.com/show_bug.cgi?id=1702678 .

Comment 2 Eva Mrakova 2019-09-19 08:51:20 UTC
(In reply to Brian J. Murrell from comment #0)
> I think this needs a backport for EL7 as setting options for repos added
> with yum-config-manager by url don't work, presumably because they have dots
> in the fqdn portion of the url they were created from.

Brian, it's probably a different issue than in the bug 1746349.
yum-config-manager works OK with repos containing dots in their IDs/names
both on rhel7.7 - yum-utils-1.1.31-52.el7 and 7.6 - yum-utils-1.1.31-50.el7

# yum-config-manager --setopt='repo.with.dots.retries=5' --save
# cat /etc/yum.repos.d/repo.with.dots.repo 
[repo.with.dots]
name=repo.with.dots
baseurl=file:///tmp/testpath/repo.with.dots
enabled=0
gpgcheck=0
retries = 5
keepcache = 0

Could you please provide a reproducer for your issue?

Comment 3 Michal Domonkos 2019-09-24 11:51:44 UTC
Indeed, as Eva confirmed, yum *does* already parse such repoids correctly, see:
https://github.com/rpm-software-management/yum/blob/098cf29f8d0329ebbf6f215426d41808c5881960/cli.py#L214

That being said, I'm closing this one as NOTABUG.

Comment 4 Michal Domonkos 2019-09-24 11:56:30 UTC
Original Fedora bug, for reference:
https://bugzilla.redhat.com/show_bug.cgi?id=1023595


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