* Clean up small releases.

git-svn-id: https://nixos.org/repos/nix/release/trunk/channels@34864 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb
This commit is contained in:
Eelco Dolstra 2014-12-09 12:42:06 +00:00
parent 22ff163cca
commit 140bb432ae
3 changed files with 24 additions and 9 deletions

View file

@ -12,13 +12,15 @@ find /data/releases/nixos/ /data/releases/nixpkgs/ -maxdepth 1 -name ".tmp*" -mt
done
# Remove old NixOS releases.
find /data/releases/nixos/unstable/ /data/releases/nixos/??.??/ -maxdepth 1 -name "nixos-*pre*" -mtime +7 | sort | while read rel; do
find /data/releases/nixos/unstable/ /data/releases/nixos/unstable-small/ /data/releases/nixos/??.??/ /data/releases/nixos/??.??-small/ -maxdepth 1 -name "nixos-*pre*" -mtime +7 | sort | while read rel; do
if [ -e $rel/keep ]; then
echo "keeping NixOS release $rel" >&2
continue
fi
echo "removing old NixOS release $rel" >&2
mv $rel $trash/
dst=$trash/$(basename $(dirname $rel))
mkdir -p $dst
mv $rel $dst/
done
# Remove old Nixpkgs releases.

View file

@ -3,9 +3,14 @@
use strict;
use DBI;
use DBD::SQLite;
use Nix::Manifest;
my $nixExprs = $ARGV[0] or die;
my $dbPath = $ARGV[1] or die;
my $manifestPath = $ARGV[2] or die;
my (%narFiles, %patches);
readManifest("$manifestPath", \%narFiles, \%patches);
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbPath", "", "")
or die "cannot open database `$dbPath'";
@ -46,6 +51,7 @@ for my $system ("x86_64-linux", "i686-linux") {
foreach my $line (split "\n", $out) {
my ($name, $outPath) = split ' ', $line;
die unless $name && $outPath;
next unless defined $narFiles{$outPath};
next unless -d $outPath;
my $pkgname = $name;
$pkgname =~ s/-\d.*//;

View file

@ -37,6 +37,8 @@ else
tmpDir="$(dirname $releaseDir)/.tmp-$release-$$"
mkdir -p $tmpDir
trap 'rm -rf -- "$tmpDir"' EXIT
echo $url > $tmpDir/src-url
# Copy the manual.
@ -47,30 +49,35 @@ else
ln -s manual.html $tmpDir/manual/index.html
fi
$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
$wget --directory=$tmpDir $url/job/nixos.iso_graphical.x86_64-linux/download
$wget --directory=$tmpDir $url/job/nixos.ova.i686-linux/download
$wget --directory=$tmpDir $url/job/nixos.ova.x86_64-linux/download
if ! [[ $branch =~ small ]]; then
$wget --directory=$tmpDir $url/job/nixos.iso_minimal.i686-linux/download
$wget --directory=$tmpDir $url/job/nixos.iso_graphical.x86_64-linux/download
$wget --directory=$tmpDir $url/job/nixos.iso_graphical.i686-linux/download
$wget --directory=$tmpDir $url/job/nixos.ova.x86_64-linux/download
$wget --directory=$tmpDir $url/job/nixos.ova.i686-linux/download
fi
shopt -s nullglob
for i in $tmpDir/*.iso $tmpDir/*.ova; do
nix-hash --type sha256 --flat $i > $i.sha256
done
shopt -u nullglob
perl -w ./mirror-channel.pl "$url/channel" "$tmpDir" \
nix-cache http://cache.nixos.org \
nix-cache https://cache.nixos.org \
"$url/job/nixos.channel/download/1"
# Generate the programs.sqlite database and put it in nixexprs.tar.xz.
mkdir $tmpDir/unpack
tar xfJ $tmpDir/nixexprs.tar.xz -C $tmpDir/unpack
exprDir=$(echo $tmpDir/unpack/*)
./generate-programs-index.pl "$exprDir" "$exprDir/programs.sqlite"
./generate-programs-index.pl "$exprDir" "$exprDir/programs.sqlite" "$tmpDir/MANIFEST"
tar cfJ $tmpDir/nixexprs.tar.xz -C $tmpDir/unpack "$(basename "$exprDir")"
rm -rf $tmpDir/unpack
mv $tmpDir $releaseDir
trap '' EXIT
fi
# Copy over to nixos.org.