Merge pull request #30 from samueldr/fix/2020-01-02-mirror-issue

mirror-branch: Bails when failing to run nix-instantiate
This commit is contained in:
Graham Christensen 2020-01-02 21:24:53 -05:00 committed by GitHub
commit 5146d2cb25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,6 +76,14 @@ print STDERR "release is $releaseName (build $releaseId), eval is $evalId,
my @curReleaseUrl = split(/\//, read_file("$channelsDir/$channelName", err_mode => 'quiet') // ""); my @curReleaseUrl = split(/\//, read_file("$channelsDir/$channelName", err_mode => 'quiet') // "");
my $curRelease = pop @curReleaseUrl; my $curRelease = pop @curReleaseUrl;
my $d = `NIX_PATH= nix-instantiate --eval -E "builtins.compareVersions (builtins.parseDrvName \\"$curRelease\\").version (builtins.parseDrvName \\"$releaseName\\").version"`; my $d = `NIX_PATH= nix-instantiate --eval -E "builtins.compareVersions (builtins.parseDrvName \\"$curRelease\\").version (builtins.parseDrvName \\"$releaseName\\").version"`;
if ($? == -1) {
warn("could not execute nix-instantiate ($!).\n");
exit 127;
}
if ($? > 0) {
warn("error while executing nix-instantiate ($?).\n");
exit $?;
}
chomp $d; chomp $d;
if ($d == 1) { if ($d == 1) {
warn("channel would go back in time from $curRelease to $releaseName, bailing out\n"); warn("channel would go back in time from $curRelease to $releaseName, bailing out\n");