1 # Copyright 2007, Red Hat, Inc
2 # James Bowes <jbowes@redhat.com>
4 # This software may be freely redistributed under the terms of the GNU
5 # general public license.
7 # You should have received a copy of the GNU General Public License
8 # along with this program; if not, write to the Free Software
9 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15 # XXX Use internal yum callback or write a useful one.
16 class DummyCallback(object):
18 def event(self
, state
, data
=None):
21 class Yum(func_module
.FuncModule
):
25 description
= "Package updates through yum."
28 # XXX support updating specific rpms
35 ayum
.buildTransaction()
36 ayum
.processTransaction(
37 callback
=DummyCallback())
43 def check_update(self
, repo
=None):
44 """Returns a list of packages due to be updated"""
49 ayum
.repos
.enableRepo(repo
)
50 return map(str, ayum
.doPackageLists('updates').updates
)