Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layers: fix checkout of deleted layer #588

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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