From 6e9172720aaaf8e28ec414d59181e4addf5b197e Mon Sep 17 00:00:00 2001 From: wwoods@test158.test.redhat.com <> Date: Feb 12 2007 20:57:58 +0000 Subject: avoid traceback after interrupted download --- diff --git a/pypungi/gather.py b/pypungi/gather.py index 2d1c0dc..5b24c0c 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