[Debburn-changes] r475 - cdrkit/trunk/3rd-party/dirsplit

Eduard Bloch blade at alioth.debian.org
Sat Nov 25 17:01:14 CET 2006


Author: blade
Date: 2006-11-25 17:01:14 +0100 (Sat, 25 Nov 2006)
New Revision: 475

Modified:
   cdrkit/trunk/3rd-party/dirsplit/dirsplit
Log:
Wrong control flow, sometimes oversized bins with dirsplit -S

Modified: cdrkit/trunk/3rd-party/dirsplit/dirsplit
===================================================================
--- cdrkit/trunk/3rd-party/dirsplit/dirsplit	2006-11-25 15:48:13 UTC (rev 474)
+++ cdrkit/trunk/3rd-party/dirsplit/dirsplit	2006-11-25 16:01:14 UTC (rev 475)
@@ -118,7 +118,7 @@
 # check for pointless requests
 my $testsize=0;
 for(@sizes) {
-   die "Too large object(s) ($_) for the given max size: @{$names{$_}}\n" if($_>$max);
+   die "Too large object(s) ($_) for the given max size: @{$names{$_}} (maybe coalesced in arrays, check manually)\n" if($_>$max);
 
    $testsize+=$_;
 }
@@ -224,6 +224,42 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 # recursive function
 # parameter: directory
 # mode 1: descend as far as possible and index all non-directories
@@ -346,13 +382,11 @@
    if($opt_simple) {
       # now the simplest method to fill the bins, just take a new one when the
       # object-to-be-added no longer fits
-      if($simpleBinSizes[$simplePos]+$size < $max) {
-         $simpleBinSizes[$simplePos]+=$size;
-      }
-      else { 
+      if($simpleBinSizes[$simplePos]+$size > $max) {
          $globwaste += ( $max-$simpleBinSizes[$simplePos] );
          $simplePos++;
       };
+      $simpleBinSizes[$simplePos]+=$size;
       push( @{$result[$simplePos]}, $object);
    }
    




More information about the Debburn-changes mailing list