A first stab at downloading packages

This commit is contained in:
jkeating@localhost.localdomain 2006-10-10 23:52:50 -04:00 committed by Jesse Keating
parent f04c99fcbe
commit 151917685c

View File

@ -21,8 +21,16 @@ def create_yumobj(yumconf):
myYum = yum.yumBase() myYum = yum.yumBase()
myYum.doConfigSetup(fn=yumconf) myYum.doConfigSetup(fn=yumconf)
myYum.doRepoSetup() myYum.doRepoSetup()
myYum.doSackSetup()
return myYum return myYum
def download_packages(yumobj, pkglist):
pkgobjs = []
for pkg in pkglist:
pkgobjs.extend(yumobj.pkgSack.searchNevra(name=pkg))
for pkgobj in pkgobjs:
pkgobj.repo.getPackage(pkgobj)
def main(): def main():
# This is used for testing the module # This is used for testing the module
(opts, args) = get_arguments() (opts, args) = get_arguments()