diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-04-14T19·05+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-04-14T19·05+0200 |
commit | 0b5107c016080e70d30ccba3afa0f9aa7a90a891 (patch) | |
tree | 176724458a501591ae129aed133c95d2ecea1e71 /scripts | |
parent | 1d0bafb74d17f14778005a633ee332ad0ad9ba9e (diff) |
If the (redirected) channel URL contains a version number, use it
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/nix-channel.in | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in index b3251975b52b..64e5aa01282b 100755 --- a/scripts/nix-channel.in +++ b/scripts/nix-channel.in @@ -108,7 +108,13 @@ sub update { die "cannot fetch `$fullURL'" if $? != 0; chomp $path; - $exprs .= "'f: f { name = \"$name\"; src = builtins.storePath \"$path\"; }' "; + # If the URL contains a version number, append it to the name + # attribute (so that "nix-env -q" on the channels profile + # shows something useful). + my $cname = $name; + $cname .= $1 if basename($url) =~ /(-\d.*)$/; + + $exprs .= "'f: f { name = \"$cname\"; channelName = \"$name\"; src = builtins.storePath \"$path\"; }' "; } # Unpack the channel tarballs into the Nix store and install them |