Allow an option to refresh cache before checking

Bug #258173 reported by Vadim Peretokin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apturl
Fix Released
Wishlist
Michael Vogt

Bug Description

Please add an option "?refresh=yes" to apturl, such that it refreshes the cache before checking if the package exists.

This scenario is necessary when the repository is frequently updated with new programs and the web interface relies on apt links for package installation.

Related branches

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)

Michael Vogt (mvo)
Changed in apturl:
assignee: nobody → mvo
importance: Undecided → Wishlist
status: New → Fix Committed
Changed in apturl:
status: Fix Committed → Fix Released
Revision history for this message
shilbert (sebastian-hilbert) wrote :

Has this bugfix made it into Jaunty through the regular updates or does one need to add some repository to pick this up ?

I have a Jaunty virtual machine with the latest updates I think. When installing the Jaunty version of GNUmed (0.3.9), adding the GNUmed PPA and trying to install GNUmed 0.6.0 from the PPA through

http://wiki.gnumed.de/bin/view/Gnumed/InstallerGuideHomeShort#ubuntu

it complains that gnumed-client is installed already.

Thanks,
Sebastian

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.