cloud-hypervisor: clean up the short-circuiting logic
This commit is contained in:
parent
42180096af
commit
f0fe4db61c
1 changed files with 5 additions and 5 deletions
|
|
@ -34,10 +34,10 @@ cloud-hypervisor.overrideAttrs (
|
||||||
patches = patchesFromDir (spectrum + "/pkgs/cloud-hypervisor");
|
patches = patchesFromDir (spectrum + "/pkgs/cloud-hypervisor");
|
||||||
vhostPatches = patchesFromDir (spectrum + "/pkgs/cloud-hypervisor/vhost");
|
vhostPatches = patchesFromDir (spectrum + "/pkgs/cloud-hypervisor/vhost");
|
||||||
};
|
};
|
||||||
previouslyPatched = oldAttrs ? spectrumPatches;
|
oldPatchesStruct = oldAttrs.passthru.spectrumPatches or { };
|
||||||
patchPhases = !previouslyPatched;
|
missingPatchPhases = oldPatchesStruct != { };
|
||||||
isNewer = lib.versionOlder oldAttrs.spectrumPatches.version or "2000-00-00" spectrumPatches.version;
|
isNewer = lib.versionOlder oldAttrs.spectrumPatches.version or "2000-00-00" spectrumPatches.version;
|
||||||
oldPatches = oldAttrs.spectrumPatches.patches or [ ];
|
oldPatches = oldPatchesStruct.patches or [ ];
|
||||||
removeAll = removeElts: lst: builtins.filter (x: !(builtins.elem x removeElts)) lst;
|
removeAll = removeElts: lst: builtins.filter (x: !(builtins.elem x removeElts)) lst;
|
||||||
in
|
in
|
||||||
optionalAttrs isNewer {
|
optionalAttrs isNewer {
|
||||||
|
|
@ -47,7 +47,7 @@ cloud-hypervisor.overrideAttrs (
|
||||||
# Verbatim from spectrum
|
# Verbatim from spectrum
|
||||||
postUnpack =
|
postUnpack =
|
||||||
oldAttrs.postUnpack or ""
|
oldAttrs.postUnpack or ""
|
||||||
+ optionalString patchPhases ''
|
+ optionalString missingPatchPhases ''
|
||||||
unpackFile $vhost
|
unpackFile $vhost
|
||||||
chmod -R +w vhost
|
chmod -R +w vhost
|
||||||
'';
|
'';
|
||||||
|
|
@ -58,7 +58,7 @@ cloud-hypervisor.overrideAttrs (
|
||||||
# Verbatim copy from spectrum
|
# Verbatim copy from spectrum
|
||||||
postPatch =
|
postPatch =
|
||||||
oldAttrs.postPatch or ""
|
oldAttrs.postPatch or ""
|
||||||
+ optionalString patchPhases ''
|
+ optionalString missingPatchPhases ''
|
||||||
pushd ../vhost
|
pushd ../vhost
|
||||||
for patch in $vhostPatches; do
|
for patch in $vhostPatches; do
|
||||||
echo applying patch $patch
|
echo applying patch $patch
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue