* 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 done
# Remove old NixOS releases. # 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 if [ -e $rel/keep ]; then
echo "keeping NixOS release $rel" >&2 echo "keeping NixOS release $rel" >&2
continue continue
fi fi
echo "removing old NixOS release $rel" >&2 echo "removing old NixOS release $rel" >&2
mv $rel $trash/ dst=$trash/$(basename $(dirname $rel))
mkdir -p $dst
mv $rel $dst/
done done
# Remove old Nixpkgs releases. # Remove old Nixpkgs releases.

View file

@ -3,9 +3,14 @@
use strict; use strict;
use DBI; use DBI;
use DBD::SQLite; use DBD::SQLite;
use Nix::Manifest;
my $nixExprs = $ARGV[0] or die; my $nixExprs = $ARGV[0] or die;
my $dbPath = $ARGV[1] 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", "", "") my $dbh = DBI->connect("dbi:SQLite:dbname=$dbPath", "", "")
or die "cannot open database `$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) { foreach my $line (split "\n", $out) {
my ($name, $outPath) = split ' ', $line; my ($name, $outPath) = split ' ', $line;
die unless $name && $outPath; die unless $name && $outPath;
next unless defined $narFiles{$outPath};
next unless -d $outPath; next unless -d $outPath;
my $pkgname = $name; my $pkgname = $name;
$pkgname =~ s/-\d.*//; $pkgname =~ s/-\d.*//;

View file

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