Add a function ‘getVersion’ to get the version of a derivation

wip/yesman
Eelco Dolstra 12 years ago
parent 172abb4b26
commit e0be32f676
  1. 6
      pkgs/lib/strings.nix

@ -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…
Cancel
Save