diff --git a/mirror-channel.pl b/mirror-channel.pl index 9318e06..269877f 100644 --- a/mirror-channel.pl +++ b/mirror-channel.pl @@ -136,7 +136,7 @@ sub mirrorStorePath { my $ext; if (isValidPath($storePath) && queryPathHash16($storePath) eq $nar->{narHash}) { - print STDERR "copying $storePath instead of downloading $nar->{url}\n"; + print STDERR "copying $storePath\n"; # Verify that $storePath hasn't been corrupted and compress it at the same time. $ext = "xz"; diff --git a/mirror-nixos.sh b/mirror-nixos.sh index 1bc3497..5be8fa7 100755 --- a/mirror-nixos.sh +++ b/mirror-nixos.sh @@ -18,10 +18,10 @@ if [ -z "$release" ]; then echo "Failed to get release"; exit 1; fi url=$($curl --head http://hydra.nixos.org/build/$releaseId/eval | sed 's/Location: \(.*\)\r/\1/; t; d') if [ -z "$url" ]; then exit 1; fi -echo "release is ‘$release’ (build $releaseId), eval is ‘$url’" - releaseDir=$releasesDir/$release +echo "release is ‘$release’ (build $releaseId), eval is ‘$url’, dir is ‘$releaseDir’" + if [ -d $releaseDir ]; then echo "release already exists" else @@ -30,6 +30,14 @@ else echo $url > $tmpDir/src-url + # Copy the manual. + drvpath=$(curl -H 'Accept: application/json' -L $url/job/nixos.manual | json drvpath) + if [ -z "$drvpath" ]; then exit 1; fi + outpath=$(nix-store -r $drvpath) + cp -rd $outpath/share/doc/nixos $tmpDir/manual + chmod -R u+w $tmpDir/manual + ln -s manual.html $tmpDir/manual/index.html + $wget --directory=$tmpDir $url/job/nixos.iso_minimal.i686-linux/download $wget --directory=$tmpDir $url/job/nixos.iso_minimal.x86_64-linux/download $wget --directory=$tmpDir $url/job/nixos.iso_graphical.i686-linux/download diff --git a/mirror-nixpkgs.sh b/mirror-nixpkgs.sh index 4ef3122..4bbac28 100755 --- a/mirror-nixpkgs.sh +++ b/mirror-nixpkgs.sh @@ -17,10 +17,10 @@ if [ -z "$release" ]; then echo "Failed to get release"; exit 1; fi url=$($curl --head http://hydra.nixos.org/build/$releaseId/eval | sed 's/Location: \(.*\)\r/\1/; t; d') if [ -z "$url" ]; then exit 1; fi -echo "release is ‘$release’ (build $releaseId), eval is ‘$url’" - releaseDir=$releasesDir/$release +echo "release is ‘$release’ (build $releaseId), eval is ‘$url’, dir is ‘$releaseDir’" + if [ -d $releaseDir ]; then echo "release already exists" else @@ -33,6 +33,12 @@ else nix-cache http://cache.nixos.org \ /data/releases/patches/all-patches "$url/job/tarball/download/4" + # Extract the manual. + mkdir $tmpDir/manual + tar xf $tmpDir/nixexprs.tar.xz --strip-components=2 -C $tmpDir/manual \ + --wildcards '*/doc' --exclude '*.xml' --exclude '*.xsl' --exclude '*.txt' --exclude 'Makefile' + ln -s manual.html $tmpDir/manual/index.html + mv $tmpDir $releaseDir fi