* 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
This commit is contained in:
Eelco Dolstra 2012-11-09 12:40:10 +00:00
parent 4f38e21136
commit ed92520f7b
3 changed files with 15 additions and 9 deletions

View file

@ -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

View file

@ -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"

View file

@ -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/