forked from mirrors/nixpkgs
Add a function ‘getVersion’ to get the version of a derivation
This commit is contained in:
parent
172abb4b26
commit
e0be32f676
|
@ -155,6 +155,12 @@ rec {
|
|||
# Return true iff string v1 denotes a version older than v2.
|
||||
versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1;
|
||||
|
||||
|
||||
# Get the version of the specified derivation, as specified in its
|
||||
# ‘name’ attribute.
|
||||
getVersion = drv: (builtins.parseDrvName drv.name).version;
|
||||
|
||||
|
||||
# Extract name with version from URL. Ask for separator which is
|
||||
# supposed to start extension
|
||||
nameFromURL = url: sep: let
|
||||
|
|
Loading…
Reference in a new issue