From 218a4e5611bd235dbac65f472edde47e71d3f07a Mon Sep 17 00:00:00 2001 From: "jkeating@harpoon.lab.boston.redhat.com" <> Date: Fri, 17 Nov 2006 14:02:37 -0500 Subject: [PATCH] Support file:// repos in yum --- pypungi/gather.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pypungi/gather.py b/pypungi/gather.py index cfbdfd31..0372d1f4 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -14,6 +14,7 @@ import yum import os +import shutil class Gather(yum.YumBase): def __init__(self, opts, pkglist): @@ -128,7 +129,12 @@ class Gather(yum.YumBase): if not self.opts.quiet: self.logger.info('Downloading %s' % os.path.basename(remote)) pkg.localpath = local # Hack: to set the localpath to what we want. - repo.getPackage(pkg) + + # do a little dance for file:// repos... + path = repo.getPackage(pkg) + if not os.path.exists(local) or not os.path.samefile(path, local): + shutil.copy2(path, local) + os.link(local, os.path.join(pkgdir, os.path.basename(remote)))