about summary refs log tree commit diff
path: root/scripts/generate-patches.pl.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-06-18T14·20+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-06-18T14·20+0000
commit928a7c06dc830455c246e1ccb8fd980c882b1637 (patch)
tree1eb94e7a72cc5bbab1f6b479420f72ca7c344e30 /scripts/generate-patches.pl.in
parent040140dd1c3c11e3aa1ca486c3f3596cbe99c008 (diff)
* Don't create patches for archives >= 150 MB because bsdiff can't
  handle it.  It crashed on the 234 MB tetex archive.  Probably we
  will never be able to handle archives of that size on 32-bit
  machines (because bsdiff does everything in memory requiring
  max(17*n,9*n+m)+O(1) bytes, so the address space simply isn't
  there).

Diffstat (limited to 'scripts/generate-patches.pl.in')
-rwxr-xr-xscripts/generate-patches.pl.in14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/generate-patches.pl.in b/scripts/generate-patches.pl.in
index b27181da49a6..5dfacd896811 100755
--- a/scripts/generate-patches.pl.in
+++ b/scripts/generate-patches.pl.in
@@ -277,13 +277,25 @@ foreach my $p (keys %dstOutPaths) {
         
         my $srcNarBz2 = getNarBz2 \%srcNarFiles, $closest;
         my $dstNarBz2 = getNarBz2 \%dstNarFiles, $p;
-        
+
+        my $maxNarSize = 150 * 1024 * 1024;
+
         system("@bunzip2@ < $srcNarBz2 > $tmpdir/A") == 0
             or die "cannot unpack $srcNarBz2";
 
+        if ((stat "$tmpdir/A")[7] >= $maxNarSize) {
+            print "    skipping, source is too large\n";
+            next;
+        }
+        
         system("@bunzip2@ < $dstNarBz2 > $tmpdir/B") == 0
             or die "cannot unpack $dstNarBz2";
 
+        if ((stat "$tmpdir/B")[7] >= $maxNarSize) {
+            print "    skipping, destination is too large\n";
+            next;
+        }
+        
         system("@libexecdir@/bsdiff $tmpdir/A $tmpdir/B $tmpdir/DIFF") == 0
             or die "cannot compute binary diff";