From 7b27cd5c8b1939e4b04b03fd122f236125bd2f09 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Thu, 28 Feb 2008 16:29:46 -0500 Subject: [PATCH] Don't traceback when moving repodata out for split media. --- Changelog | 2 ++ src/pypungi/pungi.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Changelog b/Changelog index 60d099a5..90f3cd0e 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,8 @@ * Thu Feb 28 2008 Jesse Keating - Make sure we get fresh repomd.xml each time we run - Don't autoclean the repodata, some of it can be reused +- Clear out the repodata we copy out temporarily, so that we don't + traceback on --force runs. * Thu Feb 21 2008 Jesse Keating - Handle gzipped comps files. diff --git a/src/pypungi/pungi.py b/src/pypungi/pungi.py index cc240b41..133bbd86 100755 --- a/src/pypungi/pungi.py +++ b/src/pypungi/pungi.py @@ -418,6 +418,11 @@ cost=500 if not self.config.get('default', 'arch') == 'source': # move the main repodata out of the way to use the split repodata + if os.path.isdir(os.path.join(self.config.get('default', 'destdir'), + 'repodata-%s' % self.config.get('default', 'arch'))): + shutil.rmtree(os.path.join(self.config.get('default', 'destdir'), + 'repodata-%s' % self.config.get('default', 'arch'))) + shutil.move(os.path.join(self.topdir, 'repodata'), os.path.join(self.config.get('default', 'destdir'), 'repodata-%s' % self.config.get('default', 'arch'))) shutil.copytree('%s-disc1/repodata' % self.topdir, os.path.join(self.topdir, 'repodata'))