dcavalca / rpms / dnf

Forked from rpms/dnf 2 years ago
Clone

Blame SOURCES/0010-Fix---setopt-and-repo-with-dots.patch

1f580a
From 5b83b191574d43299bb6d3212df06c6f20c818e7 Mon Sep 17 00:00:00 2001
1f580a
From: Jaroslav Rohel <jrohel@redhat.com>
1f580a
Date: Wed, 28 Aug 2019 09:52:40 +0200
1f580a
Subject: [PATCH] Fix: --setopt and repo with dots
1f580a
1f580a
The "--setopt" have had a problem with repositories with dots in id.
1f580a
Repository id may contain dots but option name can't. ->
1f580a
So, the last dot is delimiter and not the first one.
1f580a
1f580a
Example:
1f580a
"--setopt=re.po.option=value " was parsed as repo id "re" and option
1f580a
"po.option". Correct result would be repo id "re.po" and option
1f580a
"option".
1f580a
---
1f580a
 dnf/cli/option_parser.py | 2 +-
1f580a
 1 file changed, 1 insertion(+), 1 deletion(-)
1f580a
1f580a
diff --git a/dnf/cli/option_parser.py b/dnf/cli/option_parser.py
1f580a
index 4b6599c..76fcb95 100644
1f580a
--- a/dnf/cli/option_parser.py
1f580a
+++ b/dnf/cli/option_parser.py
1f580a
@@ -99,7 +99,7 @@ class OptionParser(argparse.ArgumentParser):
1f580a
                 logger.warning(_("Setopt argument has no value: %s"), values)
1f580a
                 return
1f580a
             k, v = vals
1f580a
-            period = k.find('.')
1f580a
+            period = k.rfind('.')
1f580a
             if period != -1:
1f580a
                 repo = k[:period]
1f580a
                 k = k[period+1:]
1f580a
--
1f580a
libgit2 0.28.2
1f580a