From 930f0f2667696e03fbb417f8542df6365850e195 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Mon, 29 Oct 2007 16:26:42 -0400 Subject: [PATCH] Fix regets. --- Changelog | 4 ++++ pungi | 2 +- pungi.spec | 5 ++++- pypungi/gather.py | 7 +++++++ setup.py | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 393ec84b..0709b800 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +* Mon Oct 29 2007 Jesse Keating +- Check to see if the cached package is same size or larger and if so remove +it. Otherwise regets will freak out. + * Tue Oct 23 2007 Jesse Keating - Add java-development to the group set. diff --git a/pungi b/pungi index 031de83e..6a4af921 100755 --- a/pungi +++ b/pungi @@ -115,7 +115,7 @@ if __name__ == '__main__': today = time.strftime('%Y%m%d', time.localtime()) def get_arguments(config): - parser = OptionParser(version="%prog 1.1.8") + parser = OptionParser(version="%prog 1.1.9") def set_config(option, opt_str, value, parser, config): config.set('default', option.dest, value) diff --git a/pungi.spec b/pungi.spec index ae7f04cd..8dbd654f 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,7 +1,7 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: pungi -Version: 1.1.8 +Version: 1.1.9 Release: 1%{?dist} Summary: Distribution compose tool @@ -51,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Oct 29 2007 Jesse Keating - 1.1.9-1 +- Remove oversized cached packages (fixes reget problem) + * Sat Oct 27 2007 Jesse Keating - 1.1.8-1 - Add eclipse group. diff --git a/pypungi/gather.py b/pypungi/gather.py index 57439b3f..e8c709ee 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -330,12 +330,19 @@ class Gather(pypungi.PungiBase): local = os.path.join(self.config.get('default', 'cachedir'), basename) target = os.path.join(pkgdir, basename) + cursize = os.stat(local)[6] + totsize = long(po.size) + if os.path.exists(local) and self.verifyCachePkg(po, local): self.logger.debug("%s already exists and appears to be complete" % local) if os.path.exists(target): os.remove(target) # avoid traceback after interrupted download self._link(local, target) continue + else: + # Check to see if the file on disk is bigger, and if so, remove it + if cursize >= totsize: + os.unlink(local) # Disable cache otherwise things won't download repo.cache = 0 diff --git a/setup.py b/setup.py index b01acb00..8daec504 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup import glob setup(name='pungi', - version='1.1.8', + version='1.1.9', description='Distribution compose tool', author='Jesse Keating', author_email='jkeating@redhat.com',