[packagekit] yum backend offline handling is not correct

muayyad.alsadi at ojuba.org muayyad.alsadi at ojuba.org
Thu Sep 3 04:13:28 PDT 2009


hello, 
please search for offline in backends/yum/yumBackend.py
http://cgit.freedesktop.org/packagekit/tree/backends/yum/yumBackend.py

and you would notice that it does not handle local repos (file://) or
media repos correctly

        # we are working offline
        if not self.has_network:
            self.error(ERROR_NO_NETWORK, "cannot refresh cache when
offline", exit=False)
            return
...

the check should be put in side the loop
for repo in self.yumbase.repos.listEnabled():

and it could be something like this

if repo.mirrorlist.startswith('http') or repo.mirrorlist.startswith('ftp')
or repo.baseurl.startswith('http') or repo.baseurl.startswith('ftp'): 

or even better just replace the line
if repo.mediaid:

into

if repo.mediaid or repo.mirrorlist.startswith('file') or
repo.baseurl.startswith('file'):
    continue

something like this should be put in replacement for all offline code




More information about the PackageKit mailing list