Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mirror-branch: Bails when failing to run nix-instantiate #30

Merged
merged 1 commit into from Jan 3, 2020

Conversation

@samueldr
Copy link
Member

@samueldr samueldr commented Jan 3, 2020

A more durable solution would likely be to make a generic function that
wraps backticks and fails when $? is non-zero, rather than doing it
in-situ. There are other backtick uses that may be problematic

@@ -76,6 +76,14 @@ sub fetch {
my @curReleaseUrl = split(/\//, read_file("$channelsDir/$channelName", err_mode => 'quiet') // "");
my $curRelease = pop @curReleaseUrl;
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");

This comment has been minimized.

@gustavderdrache

gustavderdrache Jan 3, 2020

It's probably worth putting $! in the error message to get at the underlying errno cause.

This comment has been minimized.

@samueldr

samueldr Jan 3, 2020
Author Member

Thanks, good to have someone that actually knows perl looking :)

A more durable solution would likely be to make a generic function that
wraps backticks and fails when $? is non-zero, rather than doing it
in-situ. There are other backtick uses that may be problematic
@samueldr samueldr force-pushed the samueldr:fix/2020-01-02-mirror-issue branch from 1f45a0b to cac10f5 Jan 3, 2020
Copy link

@gustavderdrache gustavderdrache left a comment

:shipit:

@grahamc grahamc merged commit 5146d2c into NixOS:master Jan 3, 2020
@samueldr samueldr deleted the samueldr:fix/2020-01-02-mirror-issue branch Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.