mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
libguestfs-with-appliance: relax version check & use provided libguestfsCompatible
This commit is contained in:
parent
9600480a2f
commit
cc608b0240
1 changed files with 19 additions and 3 deletions
|
@ -4,9 +4,25 @@
|
||||||
libguestfs-appliance,
|
libguestfs-appliance,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
appliance = libguestfs-appliance;
|
||||||
|
# check explicit forward compatibility declaration:
|
||||||
|
# then do not warn if older appliance if known to work fine with newer libguestfs
|
||||||
|
libguestfsCompatible =
|
||||||
|
if lib.hasAttr "libguestfsCompatible" appliance then
|
||||||
|
appliance.libguestfsCompatible libguestfs
|
||||||
|
else
|
||||||
|
false;
|
||||||
|
in
|
||||||
# https://github.com/NixOS/nixpkgs/issues/280881
|
# https://github.com/NixOS/nixpkgs/issues/280881
|
||||||
lib.warnIf (builtins.compareVersions libguestfs.version libguestfs-appliance.version > 0)
|
lib.warnIf
|
||||||
"libguestfs has a higher version than libguestfs-appliance (${libguestfs.version} > ${libguestfs-appliance.version}), runtime errors may occur!"
|
(
|
||||||
|
builtins.compareVersions (lib.versions.majorMinor libguestfs.version) (
|
||||||
|
lib.versions.majorMinor appliance.version
|
||||||
|
) > 0
|
||||||
|
&& !libguestfsCompatible
|
||||||
|
)
|
||||||
|
"libguestfs has a different version than ${appliance.pname} (${libguestfs.version} > ${appliance.version}), runtime errors may occur!"
|
||||||
|
|
||||||
libguestfs.override
|
libguestfs.override
|
||||||
{ appliance = libguestfs-appliance; }
|
{ inherit appliance; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue