Skip to content

Commit

Permalink
layers: fix checkout of deleted layer
Browse files Browse the repository at this point in the history
If a layer was checked out by bob and deleted by the user it was never
recreated.
  • Loading branch information
rhubert committed Oct 4, 2024
1 parent 462954f commit 0cc6ee5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pym/bob/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,19 @@ 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"]:
log("CHECKOUT: Layer " +
"'{}' 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"]))
Expand Down

0 comments on commit 0cc6ee5

Please sign in to comment.