about summary refs log tree commit diff
path: root/scripts/GeneratePatches.pm.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-04-11T08·21+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-04-11T08·21+0000
commit83252b4ca9cb9de45bf4a069b20d1c2d1412396e (patch)
treee4fefe1e9a4a5fe2147acb23f791226d180c39a7 /scripts/GeneratePatches.pm.in
parentb1882c3ef75afdaa7b0926cd146aa2857ba0d40a (diff)
* Subtle bug: if you import File::stat in one module, it affects other
  modules as well.  So use symbolic field names everywhere (which is
  nicer anyway).

Diffstat (limited to 'scripts/GeneratePatches.pm.in')
-rwxr-xr-xscripts/GeneratePatches.pm.in9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/GeneratePatches.pm.in b/scripts/GeneratePatches.pm.in
index 2d2653255e54..9d404e34001c 100755
--- a/scripts/GeneratePatches.pm.in
+++ b/scripts/GeneratePatches.pm.in
@@ -2,6 +2,7 @@
 
 use strict;
 use File::Temp qw(tempdir);
+use File::stat;
 
 
 # Some patch generations options.
@@ -205,7 +206,7 @@ sub generatePatches {
             system("@bunzip2@ < $srcNarBz2 > $tmpDir/A") == 0
                 or die "cannot unpack $srcNarBz2";
 
-            if ((stat "$tmpDir/A")[7] >= $maxNarSize) {
+            if (stat("$tmpDir/A")->size >= $maxNarSize) {
                 print "    skipping, source is too large\n";
                 next;
             }
@@ -213,7 +214,7 @@ sub generatePatches {
             system("@bunzip2@ < $dstNarBz2 > $tmpDir/B") == 0
                 or die "cannot unpack $dstNarBz2";
 
-            if ((stat "$tmpDir/B")[7] >= $maxNarSize) {
+            if (stat("$tmpDir/B")->size >= $maxNarSize) {
                 print "    skipping, destination is too large\n";
                 next;
             }
@@ -235,8 +236,8 @@ sub generatePatches {
             my $narDiffHash = `@bindir@/nix-hash --flat --type $hashAlgo --base32 $tmpDir/DIFF` or die;
             chomp $narDiffHash;
 
-            my $narDiffSize = (stat "$tmpDir/DIFF")[7];
-            my $dstNarBz2Size = (stat $dstNarBz2)[7];
+            my $narDiffSize = stat("$tmpDir/DIFF")->size;
+            my $dstNarBz2Size = stat($dstNarBz2)->size;
 
             print "    size $narDiffSize; full size $dstNarBz2Size; ", $time2 - $time1, " seconds\n";