From ed92520f7bdc7a1b4a7bb04f311a57a3cab97439 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 9 Nov 2012 12:40:10 +0000 Subject: [PATCH] * Move the NixOS/Nixpkgs channels to http://nixos.org/channels. git-svn-id: https://nixos.org/repos/nix/release/trunk/channels@34648 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb --- mirror-nixos.sh | 11 +++++++---- mirror-nixpkgs.sh | 11 +++++++---- remove-dead-files.sh | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mirror-nixos.sh b/mirror-nixos.sh index e172fb3..95d2a64 100755 --- a/mirror-nixos.sh +++ b/mirror-nixos.sh @@ -2,7 +2,8 @@ viewUrl=http://hydra.nixos.org/view/nixos/tested/latest-finished releasesDir=/data/releases/nixos -channelLink=/data/releases/nixos/channels/nixos-unstable +channelsDir=/data/releases/channels +channelName=nixos-unstable curl="curl --silent --show-error --fail" wget="wget --no-verbose --content-disposition" @@ -39,10 +40,12 @@ else mv $tmpDir $releaseDir fi -htaccess=$(dirname $channelLink)/.htaccess -echo "Redirect /releases/nixos/channels/nixos-unstable http://nixos.org/releases/nixos/$release" > $htaccess.tmp -ln -sfn $releaseDir $channelLink # dummy symlink +htaccess=$channelsDir/.htaccess-nixos +echo "Redirect /channels/$channelName http://nixos.org/releases/nixos/$release" > $htaccess.tmp +echo "Redirect /releases/nixos/channels/$channelName http://nixos.org/releases/nixos/$release" >> $htaccess.tmp +ln -sfn $releaseDir $channelsDir/$channelName # dummy symlink mv $htaccess.tmp $htaccess +flock -x $channelsDir/.htaccess.lock -c "cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess" # Generate a .htaccess with some symbolic redirects to the latest ISOs. htaccess=$releasesDir/.htaccess diff --git a/mirror-nixpkgs.sh b/mirror-nixpkgs.sh index 631df41..f584085 100755 --- a/mirror-nixpkgs.sh +++ b/mirror-nixpkgs.sh @@ -2,7 +2,8 @@ viewUrl=http://hydra.nixos.org/view/nixpkgs/unstable/latest-finished releasesDir=/data/releases/nixpkgs -channelLink=/data/releases/nixpkgs/channels/nixpkgs-unstable +channelsDir=/data/releases/channels +channelName=nixpkgs-unstable curl="curl --silent --show-error --fail" url=$($curl --head $viewUrl | sed 's/Location: \(.*\)\r/\1/; t; d') @@ -33,7 +34,9 @@ else mv $tmpDir $releaseDir fi -htaccess=$(dirname $channelLink)/.htaccess -echo "Redirect /releases/nixpkgs/channels/nixpkgs-unstable http://nixos.org/releases/nixpkgs/$release" > $htaccess.tmp -ln -sfn $releaseDir $channelLink # dummy symlink +htaccess=$channelsDir/.htaccess-nixpkgs +echo "Redirect /channels/$channelName http://nixos.org/releases/nixpkgs/$release" > $htaccess.tmp +echo "Redirect /releases/nixpkgs/channels/$channelName http://nixos.org/releases/nixpkgs/$release" >> $htaccess.tmp +ln -sfn $releaseDir $channelsDir/$channelName # dummy symlink mv $htaccess.tmp $htaccess +flock -x $channelsDir/.htaccess.lock -c "cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess" diff --git a/remove-dead-files.sh b/remove-dead-files.sh index c576d63..69e4a19 100644 --- a/remove-dead-files.sh +++ b/remove-dead-files.sh @@ -1,4 +1,4 @@ #! /bin/sh ./print-dead-files.pl /data/releases/patches/all-patches $(find /data/releases -name MANIFEST | grep -v '\.trash' | grep -v '\.tmp') | sort > /tmp/dead mkdir -p /data/releases/.trash/ -xargs -d '\n' sh -c 'find "$@" -mtime +100 -print' < /tmp/dead | xargs -d '\n' mv -v --target-directory=/data/releases/.trash/ +xargs -d '\n' sh -c 'find "$@" -mtime +50 -print' < /tmp/dead | xargs -d '\n' mv -v --target-directory=/data/releases/.trash/