Allow an option to refresh cache before checking
Bug #258173 reported by
Vadim Peretokin
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
Changed in apturl: | |
assignee: | nobody → mvo |
importance: | Undecided → Wishlist |
status: | New → Fix Committed |
Changed in apturl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Here's a patch.
In Parser.py, change the AptUrl class to be:
class AptUrl(object):
self.package = None
self.keyfile = None
self.repo_ url = None
self.refresh = None
self.section = []
" a class that contains the parsed data from a apt url "
def __init__(self):
self.schema = None
self.minver = None
self.dist = '/'
And in apturl, change code starting from 266 to be:
# FIXME: ask before adding stuff to the sources.list section( apturl, cache)
error( _("Enabling '%s' failed") % ",".join( apturl. section) )
continue repo(apturl) :
run_update( dia)
# check if we need to fiddle with the sources.list
if apturl.section and apturl.repo_url is None:
ret = enable_
if ret != RESULT_OK:
cache = apt.Cache()
# FIXME2: this has security implications, not enabled
#elif apturl.repo_url is not None:
# if not enable_
# error(_("Enabling '%s' failed") % apturl.repo_url)
# continue
# run_update(dia)
elif apturl.refresh is not None: