aboutsummaryrefslogtreecommitdiff
path: root/scripts/update-manifest.pl
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-10-10 21:11:08 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-10-10 21:11:08 +0000
commit6fcdbcac202e40e5de7147ff64b34d6aaad16249 (patch)
tree3a18b2cde295fd1551bedb279948660dccd22d60 /scripts/update-manifest.pl
parent659c427caa39e44e5861ff1345425e4c34c9ced3 (diff)
* Install NixManifest.pm, NixConfig.pm and GeneratePatches.pm under
the Nix:: namespace.
Diffstat (limited to 'scripts/update-manifest.pl')
-rwxr-xr-xscripts/update-manifest.pl52
1 files changed, 0 insertions, 52 deletions
diff --git a/scripts/update-manifest.pl b/scripts/update-manifest.pl
deleted file mode 100755
index 566f64673..000000000
--- a/scripts/update-manifest.pl
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /usr/bin/perl -w -I.
-
-use strict;
-use readmanifest;
-
-die unless scalar @ARGV == 2;
-
-my $cache = $ARGV[0];
-my $manifest = $ARGV[1];
-my %narFiles;
-my %patches;
-
-readManifest $manifest, \%narFiles, \%patches;
-
-foreach my $storePath (keys %narFiles) {
- my $narFileList = $narFiles{$storePath};
-
- foreach my $narFile (@{$narFileList}) {
- if (!defined $narFile->{size} or
- !defined $narFile->{narHash})
- {
- $narFile->{url} =~ /\/([^\/]+)$/;
- die unless defined $1;
- my $fn = "$cache/$1";
-
- my @info = stat $fn or die;
- $narFile->{size} = $info[7];
-
- my $narHash;
- my $hashFile = "$fn.NARHASH";
- if (-e $hashFile) {
- open HASH, "<$hashFile" or die;
- $narHash = <HASH>;
- close HASH;
- } else {
- print "$fn\n";
- $narHash = `bunzip2 < '$fn' | nix-hash --flat /dev/stdin` or die;
- open HASH, ">$hashFile" or die;
- print HASH $narHash;
- close HASH;
- }
- chomp $narHash;
- $narFile->{narHash} = $narHash;
- }
- }
-}
-
-if (! -e "$manifest.backup") {
- system "mv --reply=no '$manifest' '$manifest.backup'";
-}
-
-writeManifest $manifest, \%narFiles, \%patches;