Fix NixOS 15.09 channel generation

This commit is contained in:
Eelco Dolstra 2016-03-07 10:51:46 +01:00
parent f46cb14bb7
commit 373d8b7b38

View file

@ -50,8 +50,9 @@ my $rev = $evalInfo->{jobsetevalinputs}->{nixpkgs}->{revision} or die;
print STDERR "release is $releaseName (build $releaseId), eval is $evalId, dir is $releaseDir, Git commit is $rev\n"; print STDERR "release is $releaseName (build $releaseId), eval is $evalId, dir is $releaseDir, Git commit is $rev\n";
# Guard against the channel going back in time. # Guard against the channel going back in time.
my $curRelease = basename(readlink "$channelsDir/$channelName"); my $curReleaseDir = readlink "$channelsDir/$channelName";
if (defined $curRelease) { if (defined $curReleaseDir) {
my $curRelease = basename($curReleaseDir);
my $d = `nix-instantiate --eval -E "builtins.compareVersions (builtins.parseDrvName \\"$curRelease\\").version (builtins.parseDrvName \\"$releaseName\\").version"`; my $d = `nix-instantiate --eval -E "builtins.compareVersions (builtins.parseDrvName \\"$curRelease\\").version (builtins.parseDrvName \\"$releaseName\\").version"`;
chomp $d; chomp $d;
die "channel would go back in time from $curRelease to $releaseName, bailing out\n" if $d == 1; die "channel would go back in time from $curRelease to $releaseName, bailing out\n" if $d == 1;