Comment # 11 on bug 980393 from
(In reply to D S from comment #10)
> A patch for this issue was submitted via a pull request on github.
> This is the link to the pull request:
> https://github.com/openSUSE/scout/pull/6
> 
> Is this the correct way to submit a patch?
> If not, could you please tell me how to correctly submit it?
> 
> What it does is, that it ignores the filename, and uses the section name as
> the name of the repo.
> In my testing it worked (openSUSE Leap 42.3, fully updated, upgraded from
> Leap 42.2).

Sorry for the very long delay��� I forgot this one.

I can confirm this patch fixes the case described in comment 4, thank you!

However, it won't work if several repos are in the same .repo file, like
suggested in comment 6.

For example, if you combine repo-oss and repo-non-oss in the same .repo file
like this:

[repo-non-oss]
name=repo-non-oss
enabled=1
autorefresh=1
baseurl=http://download.opensuse.org/tumbleweed/repo/non-oss
type=yast2
keeppackages=0
[repo-oss]
name=repo-oss
enabled=1
autorefresh=1
baseurl=http://download.opensuse.org/tumbleweed/repo/oss
path=/
type=yast2
keeppackages=0

'cnf bash' won't find bash. I guess it's because you only read the first
section of the .repo file.

I guess doing something like this should work though:

diff -up ./bin.py.orig ./bin.py
--- ./bin.py.orig    2018-01-01 17:00:13.940115706 +0100
+++ ./bin.py    2018-01-01 17:19:21.632163286 +0100
@@ -27,12 +27,12 @@ class SolvParser(object):
             try:
                 parser = SafeConfigParser()
                 parser.read( '%s/%s' % (self.etcpath, repofile) )
-                name = parser.sections()[0]
-                if parser.get(name, 'enabled') == '1':
-                    if not os.path.isfile(self.solvfile % name):
-                        os.system('zypper refresh')
-                    repo = self.pool.add_repo(name)
-                    repo.add_solv(self.solvfile % name)
+                for name in parser.sections():
+                    if parser.get(name, 'enabled') == '1':
+                        if not os.path.isfile(self.solvfile % name):
+                            os.system('zypper refresh')
+                        repo = self.pool.add_repo(name)
+                        repo.add_solv(self.solvfile % name)
             except:
                 pass
         if not list(self.pool.repos_iter()):

Could you update your pull request?


You are receiving this mail because: