[PATCH 2/6] Make splits on demand rather than pre-create a hard set of splits.
Jesse Keating
jkeating at redhat.com
Mon May 18 22:40:53 UTC 2009
---
src/pypungi/splittree.py | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/src/pypungi/splittree.py b/src/pypungi/splittree.py
index 093c5b0..c873d88 100644
--- a/src/pypungi/splittree.py
+++ b/src/pypungi/splittree.py
@@ -365,21 +365,13 @@ self.reserve_size : Additional size needed to be reserved on the first disc.
# move to the next disc if true
if newsize > maxsize:
self.reportSizes(disc, firstpkg=firstpackage, lastpkg=lastpackage)
- # try it, if we are already on the last disc then complain loudly
- try:
- nextdisc=self.bin_list.index(disc+1)
- disc = self.bin_list[nextdisc]
- os.link("%s/%s/%s" % (self.dist_dir, pkgdir, file_name),
- "%s-disc%d/%s/%s" % (self.dist_dir, disc, pkgdir, file_name))
- packagenum = 1
- firstpackage = file_name
-
- except:
- # back down to the last RPM disc and complain about the overflow
- disc = disc - 1
- self.logfile.append("No more discs to put packages, overflowing on disc%d" % disc)
- continue
-
+ # Create a new split dir to copy into
+ self.createSplitDir()
+ disc = self.bin_list[-1]
+ os.link("%s/%s/%s" % (self.dist_dir, pkgdir, file_name),
+ "%s-disc%d/%s/%s" % (self.dist_dir, disc, pkgdir, file_name))
+ packagenum = 1
+ firstpackage = file_name
else:
os.link("%s/%s/%s" % (self.dist_dir, pkgdir, file_name),
"%s-disc%d/%s/%s" % (self.dist_dir, disc, pkgdir, file_name))
--
1.6.2.2
More information about the rel-eng
mailing list