lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #36168 from ryantm/majorminor

a single version attribute for expressions previously using "majorVersion"

authored by

Jörg Thalheim and committed by
GitHub
73774ef8 75d4499e

+50 -5
+1 -1
lib/default.nix
··· 24 24 maintainers = import ./maintainers-list.nix; 25 25 meta = callLibs ./meta.nix; 26 26 sources = callLibs ./sources.nix; 27 - 27 + versions = callLibs ./versions.nix; 28 28 29 29 # module system 30 30 modules = callLibs ./modules.nix;
+47
lib/versions.nix
··· 1 + /* Version string functions. */ 2 + { lib }: 3 + 4 + let 5 + 6 + splitVersion = builtins.splitVersion or (lib.splitString "."); 7 + 8 + in 9 + 10 + rec { 11 + 12 + /* Get the major version string from a string. 13 + 14 + Example: 15 + major "1.2.3" 16 + => "1" 17 + */ 18 + major = v: builtins.elemAt (splitVersion v) 0; 19 + 20 + /* Get the minor version string from a string. 21 + 22 + Example: 23 + minor "1.2.3" 24 + => "2" 25 + */ 26 + minor = v: builtins.elemAt (splitVersion v) 1; 27 + 28 + /* Get the patch version string from a string. 29 + 30 + Example: 31 + patch "1.2.3" 32 + => "3" 33 + */ 34 + patch = v: builtins.elemAt (splitVersion v) 2; 35 + 36 + /* Get string of the first two parts (major and minor) 37 + of a version string. 38 + 39 + Example: 40 + majorMinor "1.2.3" 41 + => "1.2" 42 + */ 43 + majorMinor = v: 44 + builtins.concatStringsSep "." 45 + (lib.take 2 (splitVersion v)); 46 + 47 + }
+2 -4
pkgs/tools/networking/haproxy/default.nix
··· 9 9 10 10 stdenv.mkDerivation rec { 11 11 pname = "haproxy"; 12 - majorVersion = "1.7"; 13 - minorVersion = "9"; 14 - version = "${majorVersion}.${minorVersion}"; 12 + version = "1.7.9"; 15 13 name = "${pname}-${version}"; 16 14 17 15 src = fetchurl { 18 - url = "https://www.haproxy.org/download/${majorVersion}/src/${name}.tar.gz"; 16 + url = "https://www.haproxy.org/download/${stdenv.lib.versions.majorMinor version}/src/${name}.tar.gz"; 19 17 sha256 = "1072337e54fa188dc6e0cfe3ba4c2200b07082e321cbfe5a0882d85d54db068e"; 20 18 }; 21 19