* Slight improvements to the conversion script.

git-svn-id: https://nixos.org/repos/nix/release/trunk/channels@34584 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb
This commit is contained in:
Eelco Dolstra 2012-07-09 18:20:39 +00:00
parent 50d69c15f0
commit a550734488

View file

@ -1,3 +1,5 @@
#! /var/run/current-system/sw/bin/perl -w
use strict; use strict;
use Nix::Manifest; use Nix::Manifest;
use File::Basename; use File::Basename;
@ -6,23 +8,25 @@ my $cacheDir = "/data/releases/binary-cache";
my @manifests = split " ", `find /data/releases/{nixos,nixpkgs,nix,patchelf} -name MANIFEST | grep -v '.tmp' | sort`; my @manifests = split " ", `find /data/releases/{nixos,nixpkgs,nix,patchelf} -name MANIFEST | grep -v '.tmp' | sort`;
die if $? != 0; die if $? != 0;
#my @manifests = ("/data/releases/nix/nix-0.11/MANIFEST"); #my @manifests = ("/data/releases/nixpkgs/nixpkgs-0.5/MANIFEST");
#my @manifests = ("/data/releases/nixpkgs/nixpkgs-1.0pre19955_f823b62/MANIFEST"); #my @manifests = ("/data/releases/nixpkgs/nixpkgs-1.0pre19955_f823b62/MANIFEST");
foreach my $manifest (@manifests) { foreach my $manifest (@manifests) {
print STDERR "processing $manifest...\n";
my %narFiles; my %narFiles;
my %patches; my %patches;
next if readManifest($manifest, \%narFiles, \%patches, 1) < 3; if (readManifest($manifest, \%narFiles, \%patches, 1) < 3) {
print STDERR " ", scalar(keys(%narFiles)), " paths\n"; print STDERR "warning: skipping old manifest $manifest\n";
next;
}
print STDERR "processing $manifest (", scalar(keys(%narFiles)), " paths)...\n";
while (my ($storePath, $nars) = each %narFiles) { while (my ($storePath, $nars) = each %narFiles) {
print STDERR " $storePath\n";
my $pathHash = substr(basename($storePath), 0, 32); my $pathHash = substr(basename($storePath), 0, 32);
my $dst = "$cacheDir/$pathHash.narinfo"; my $dst = "$cacheDir/$pathHash.narinfo";
foreach my $nar (@{$nars}) { foreach my $nar (@{$nars}) {
if (! -e $dst) { if (! -e $dst) {
print STDERR " $storePath\n";
#print STDERR " $nar->{url} -> $dst\n"; #print STDERR " $nar->{url} -> $dst\n";
my $fileName = "/data/releases/nars/" . basename $nar->{url}; my $fileName = "/data/releases/nars/" . basename $nar->{url};