Making updates-testing more useful

Richard Hughes hughsient at gmail.com
Thu Dec 11 09:40:36 UTC 2008


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?

Richard.





More information about the fedora-devel-list mailing list