From 0cc6ee5d9fb4bb5b0d8df584c3fa61ecaf4ac259 Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Fri, 4 Oct 2024 11:44:33 +0200 Subject: [PATCH] layers: fix checkout of deleted layer If a layer was checked out by bob and deleted by the user it was never recreated. --- pym/bob/layers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pym/bob/layers.py b/pym/bob/layers.py index 47c29759..360f0c6c 100644 --- a/pym/bob/layers.py +++ b/pym/bob/layers.py @@ -65,12 +65,11 @@ async def __checkoutTask(self, verbose): if os.path.exists(self.__layerDir) and oldState is None: raise BuildError(f"New layer checkout '{self.getName()}' collides with existing layer '{self.__layerDir}'!") - created = False if not os.path.isdir(self.__layerDir): os.makedirs(self.__layerDir) self.__created = True - if not created \ + if not self.__created \ and self.__scm.isDeterministic() \ and oldState is not None \ and oldState["digest"] == newState["digest"]: @@ -78,7 +77,7 @@ async def __checkoutTask(self, verbose): "'{}' skipped (up to date)".format(self.getName()), SKIPPED, INFO) return - if not created and oldState is not None and \ + if not self.__created and oldState is not None and \ newState["digest"] != oldState["digest"]: canSwitch = self.__scm.canSwitch(getScm(oldState["prop"]))