diff --git a/mirror-nixos-branch.pl b/mirror-nixos-branch.pl index d28bcef..4e9aeed 100755 --- a/mirror-nixos-branch.pl +++ b/mirror-nixos-branch.pl @@ -8,6 +8,7 @@ use File::Path; use File::Slurp; use JSON::PP; use LWP::UserAgent; +use List::MoreUtils qw(uniq); my $branch = $ARGV[0]; my $jobset = $ARGV[1]; @@ -60,13 +61,18 @@ if (-d $releaseDir) { print STDERR "release already exists\n"; } else { my $tmpDir = dirname($releaseDir) . "/$releaseName-tmp"; - print STDERR "$tmpDir\n"; File::Path::make_path($tmpDir); write_file("$tmpDir/src-url", $evalUrl); write_file("$tmpDir/git-revision", $rev); write_file("$tmpDir/binary-cache-url", "https://cache.nixos.org"); + if (! -e "$tmpDir/store-paths.xz") { + my $storePaths = decode_json(fetch("$evalUrl/store-paths", 'application/json')); + write_file("$tmpDir/store-paths", join("\n", uniq(@{$storePaths})) . "\n"); + system("xz", "$tmpDir/store-paths") == 0 or die; + } + # Copy the manual. if (! -e "$tmpDir/manual") { my $manualInfo = decode_json(fetch("$evalUrl/job/nixos.manual.x86_64-linux", 'application/json'));