From 6e9172720aaaf8e28ec414d59181e4addf5b197e Mon Sep 17 00:00:00 2001 From: "wwoods@test158.test.redhat.com" <> Date: Mon, 12 Feb 2007 15:57:58 -0500 Subject: [PATCH] avoid traceback after interrupted download --- pypungi/gather.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pypungi/gather.py b/pypungi/gather.py index 2d1c0dce..5b24c0c7 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -190,7 +190,9 @@ class Gather(yum.YumBase): if not self.config.has_option('default', 'quiet'): self.logger.info("%s already exists and appears to be complete" % local) - os.link(local, os.path.join(pkgdir, os.path.basename(remote))) + target=os.path.join(pkgdir, os.path.basename(remote)) + os.remove(target) # avoid traceback after interrupted download + os.link(local, target) continue # Disable cache otherwise things won't download