From a55073448873b1d406465789072a3c95d6a234e9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 9 Jul 2012 18:20:39 +0000 Subject: [PATCH] * Slight improvements to the conversion script. git-svn-id: https://nixos.org/repos/nix/release/trunk/channels@34584 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb --- convert-to-binary-channel.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/convert-to-binary-channel.pl b/convert-to-binary-channel.pl index 966323e..e066ad3 100644 --- a/convert-to-binary-channel.pl +++ b/convert-to-binary-channel.pl @@ -1,3 +1,5 @@ +#! /var/run/current-system/sw/bin/perl -w + use strict; use Nix::Manifest; 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`; 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"); foreach my $manifest (@manifests) { - print STDERR "processing $manifest...\n"; my %narFiles; my %patches; - next if readManifest($manifest, \%narFiles, \%patches, 1) < 3; - print STDERR " ", scalar(keys(%narFiles)), " paths\n"; + if (readManifest($manifest, \%narFiles, \%patches, 1) < 3) { + print STDERR "warning: skipping old manifest $manifest\n"; + next; + } + print STDERR "processing $manifest (", scalar(keys(%narFiles)), " paths)...\n"; while (my ($storePath, $nars) = each %narFiles) { - print STDERR " $storePath\n"; my $pathHash = substr(basename($storePath), 0, 32); my $dst = "$cacheDir/$pathHash.narinfo"; foreach my $nar (@{$nars}) { if (! -e $dst) { + print STDERR " $storePath\n"; #print STDERR " $nar->{url} -> $dst\n"; my $fileName = "/data/releases/nars/" . basename $nar->{url};