cpePatchVersionInUpdateWithVendor
lib.meta.cpePatchVersionInUpdateWithVendor
Docs pulled from | This Revision | 17 minutes ago
Generate CPE parts from inputs. Copies vendor to the result. When version matches X.Y.Z where all parts are numerical, sets version and update fields to X.Y and Z. Throws an error if the version doesn't match the expected template.
Inputs
vendor-
package's vendor
version-
package's version
Type
cpePatchVersionInUpdateWithVendor :: String -> String -> { update :: String; vendor :: String; version :: String; }
Examples
lib.meta.cpePatchVersionInUpdateWithVendor usage example
lib.meta.cpePatchVersionInUpdateWithVendor "gnu" "1.2.3"
=> {
vendor = "gnu";
version = "1.2";
update = "3";
}
lib.meta.cpePatchVersionInUpdateWithVendor usage in derivations
mkDerivation rec {
version = "1.2.3";
# ...
meta = {
# ...
identifiers.cpeParts = lib.meta.cpePatchVersionInUpdateWithVendor "gnu" version;
};
}
Noogle detected
Implementation
The following is the current implementation of this function.
cpePatchVersionInUpdateWithVendor =
vendor: version:
let
result = tryCPEPatchVersionInUpdateWithVendor vendor version;
in
if result.success then result.value else throw result.error;