Sha256: 17e8899baff0127f40edf0134a5d05cdfef0040a08ce2100176f4fc7ebc9d6b1

Contents?: true

Size: 927 Bytes

Versions: 4

Compression:

Stored size: 927 Bytes

Contents

# Python helper script to query for the packages that have
# pending updates. Called by the yum package provider
#
# (C) 2007 Red Hat Inc.
# David Lutterkort <dlutter @redhat.com>

import yum
import sys

OVERRIDE_OPTS = {
    'debuglevel': 0,
    'errorlevel': 0,
    'logfile': '/dev/null'
}

def pkg_lists(my):
    my.doConfigSetup()

    for k in OVERRIDE_OPTS.keys():
        if hasattr(my.conf, k):
            setattr(my.conf, k, OVERRIDE_OPTS[k])
        else:
            my.conf.setConfigOption(k, OVERRIDE_OPTS[k])

    my.doTsSetup()
    my.doRpmDBSetup()
    return my.doPackageLists('updates')

try:
    try:
        my = yum.YumBase()
        ypl = pkg_lists(my)
        for pkg in ypl.updates:
            print "_pkg %s %s %s %s %s" % (pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch)
    finally:
        my.closeRpmDB()
except IOError, e:
    print "_err IOError %d %s" % (e.errno, e)
    sys.exit(1)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-0.24.3 lib/puppet/provider/package/yumhelper.py
puppet-0.24.4 lib/puppet/provider/package/yumhelper.py
puppet-0.24.2 lib/puppet/provider/package/yumhelper.py
puppet-0.24.5 lib/puppet/provider/package/yumhelper.py