Comment 1 for bug 258173

Revision history for this message
Vadim Peretokin (vperetokin) wrote :

Here's a patch.

In Parser.py, change the AptUrl class to be:

class AptUrl(object):
    " a class that contains the parsed data from a apt url "
    def __init__(self):
        self.package = None
        self.schema = None
        self.keyfile = None
        self.minver = None
        self.repo_url = None
        self.refresh = None
        self.dist = '/'
        self.section = []

And in apturl, change code starting from 266 to be:

        # FIXME: ask before adding stuff to the sources.list
        # check if we need to fiddle with the sources.list
        if apturl.section and apturl.repo_url is None:
            ret = enable_section(apturl, cache)
            if ret != RESULT_OK:
                error(_("Enabling '%s' failed") % ",".join(apturl.section))
                continue
            cache = apt.Cache()
        # FIXME2: this has security implications, not enabled
        #elif apturl.repo_url is not None:
        # if not enable_repo(apturl):
        # error(_("Enabling '%s' failed") % apturl.repo_url)
        # continue
        # run_update(dia)
        elif apturl.refresh is not None:
         run_update(dia)