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");
|
||||
vhostPatches = patchesFromDir (spectrum + "/pkgs/cloud-hypervisor/vhost");
|
||||
};
|
||||
previouslyPatched = oldAttrs ? spectrumPatches;
|
||||
patchPhases = !previouslyPatched;
|
||||
oldPatchesStruct = oldAttrs.passthru.spectrumPatches or { };
|
||||
missingPatchPhases = oldPatchesStruct != { };
|
||||
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;
|
||||
in
|
||||
optionalAttrs isNewer {
|
||||
|
|
@ -47,7 +47,7 @@ cloud-hypervisor.overrideAttrs (
|
|||
# Verbatim from spectrum
|
||||
postUnpack =
|
||||
oldAttrs.postUnpack or ""
|
||||
+ optionalString patchPhases ''
|
||||
+ optionalString missingPatchPhases ''
|
||||
unpackFile $vhost
|
||||
chmod -R +w vhost
|
||||
'';
|
||||
|
|
@ -58,7 +58,7 @@ cloud-hypervisor.overrideAttrs (
|
|||
# Verbatim copy from spectrum
|
||||
postPatch =
|
||||
oldAttrs.postPatch or ""
|
||||
+ optionalString patchPhases ''
|
||||
+ optionalString missingPatchPhases ''
|
||||
pushd ../vhost
|
||||
for patch in $vhostPatches; do
|
||||
echo applying patch $patch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue