about summary refs log tree commit diff
path: root/scripts/nix-push.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/nix-push.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/nix-push.in')
-rw-r--r--scripts/nix-push.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/nix-push.in b/scripts/nix-push.in
index 7b9d521617d5..2d43031a47ff 100644
--- a/scripts/nix-push.in
+++ b/scripts/nix-push.in
@@ -2,6 +2,7 @@
 
 use strict;
 use File::Temp qw(tempdir);
+use File::stat;
 use NixManifest;
 
 my $hashAlgo = "sha256";
@@ -178,7 +179,7 @@ for (my $n = 0; $n < scalar @storePaths; $n++) {
     (-f $narFile) or die "narfile for $storePath not found";
     push @narArchives, $narFile;
 
-    my $narbz2Size = (stat $narFile)[7];
+    my $narbz2Size = stat($narFile)->size;
 
     my $references = `$binDir/nix-store --query --references '$storePath'`;
     die "cannot query references for `$storePath'" if $? != 0;