diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-07-17 11:14:26 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-07-17 11:14:26 +0200 |
commit | 329a70500595e17729931781f411ec8a9964ee3d (patch) | |
tree | 77ba40788a1bf918fa93cdaf4e60e8548b89868e /pkgs/lib | |
parent | 9f347eba61b2fca5ae5ece21fa74af5d3024bfb3 (diff) |
nvidia-x11: Fix the library-only build
Also, introduce a function ‘versionAtLeast’ which is probably more natural than ‘versionOlder’.
Diffstat (limited to 'pkgs/lib')
-rw-r--r-- | pkgs/lib/strings.nix | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix index ed668e2b9270d..024a9ac7d7a27 100644 --- a/pkgs/lib/strings.nix +++ b/pkgs/lib/strings.nix @@ -163,6 +163,10 @@ rec { versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1; + # Return true iff string v1 denotes a version equal to or newer than v2. + versionAtLeast = v1: v2: !versionOlder v1 v2; + + # Get the version of the specified derivation, as specified in its # ‘name’ attribute. getVersion = drv: (builtins.parseDrvName drv.name).version; |