On Thu, 11 Dec 2008, Richard Hughes wrote:
On Wed, 2008-12-10 at 17:43 +0000, Richard Hughes wrote:
Also, this would imply automatically turning on updates-testing,
downloading metadata, and disabling updates-testing all behind the
users back. A few people might get upset by this.
I've been prototyping something like this, but it doesn't seem to work:
repos = self.yumbase.repos.repos.values()
repos_enabled = []
repos_disabled = []
pkgs = []
yb._up = None
ygl = yb.doPackageLists(pkgnarrow='updates')
pkgs.extend(ygl.updates)
ygl = yb.doPackageLists(pkgnarrow='obsoletes')
pkgs.extend(ygl.obsoletes)
print pkgs
for repo in repos:
if repo.id.endswith('testing'):
if not repo.isEnabled():
repo.enablePersistent()
repos_enabled.append(repo)
else:
if repo.isEnabled():
repo.disablePersistent()
repos_disabled.append(repo)
pkgs = []
yb._up = None
ygl = yb.doPackageLists(pkgnarrow='updates')
pkgs.extend(ygl.updates)
ygl = yb.doPackageLists(pkgnarrow='obsoletes')
pkgs.extend(ygl.obsoletes)
print pkgs
for repo in repos_enabled:
repo.disablePersistent()
for repo in repos_disabled:
repo.enablePersistent()
I'm already clearing the update list by doing "yb._up = None", but I
can't seem to get the "testing" updates in the second pass. Any ideas?
two things:
1. yb.up has a property() setter so you can do yb.up = None
2. you need to do the doRepoSetup(thisrepo=repo) for the repo to get
picked up.
-sv
--
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list