Skip to content

Commit

Permalink
SingleUntar: touch self.target on update
Browse files Browse the repository at this point in the history
FC-40974

Consider the following use-case:

* `self.target` is an existing Git checkout at
  `/mnt/nfs/shared/{project_code}`
* prebuilt assets are unpacked into a given directory in `self.target`
  (the exact directory is encoded in the archive, so `self.target` is
  exactly the git checkout).

Now, using `SingleUntar` isn't convergent in this case because it tries
to unpack the assets on each deploy: this is because the mtime of
`self.target` isn't affected by the unpack since the files are unpacked
into a directory inside `self.target`.

The `self.touch` solves the issue by updating the mtime of the target.

This is not expected to affect the "traditional" use-case of
`SingleUntar` where a new unpack _creates_ a new directory called
`self.target`.
  • Loading branch information
Ma27 committed Sep 26, 2024
1 parent 1679d98 commit 90a3d1d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/batou_ext/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def verify(self):
def update(self):
if not self._only_marker_cleanup:
super().update()
self.touch(self.target)
self.touch(self._finish_marker)

for old_marker in self._markers_to_unlink:
Expand Down

0 comments on commit 90a3d1d

Please sign in to comment.