Merge lp:~sil2100/ubuntu-cdimage/checksum-mtime-only into lp:ubuntu-cdimage

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 2098
Proposed branch: lp:~sil2100/ubuntu-cdimage/checksum-mtime-only
Merge into: lp:ubuntu-cdimage
Diff against target: 11 lines (+1/-1)
1 file modified
lib/cdimage/checksums.py (+1/-1)
To merge this branch: bzr merge lp:~sil2100/ubuntu-cdimage/checksum-mtime-only
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+363051@code.launchpad.net

Commit message

Only use st.st_mtime as the entry time for checksum entries, allowing re-use of checksums for file copies and hard-links.

Description of the change

Only use st.st_mtime as the entry time for checksum entries, allowing re-use of checksums for file copies and hard-links.

More details on the attached bug. Quoting my comment there:
"I'd like to know if we're actually using the olddirs functionality right now, other than for removing old releases. Once we know that, I would propose using only st.st_mtime for the timestamp check. Checksums only care about the *contents* of the image, not the metadata. Move and link operations will only touch the st_ctime timestamp, so it would allow re-using the checksums in cases of image moves. Also, image moves and hard-links should be fairly safe."

In other words, I'd like to propose this change in case we don't really use the current olddirs anywhere else, as I wouldn't want to cause a regression somewhere unwillingly.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/cdimage/checksums.py'
2--- lib/cdimage/checksums.py 2015-10-26 11:06:11 +0000
3+++ lib/cdimage/checksums.py 2019-02-12 11:54:10 +0000
4@@ -83,7 +83,7 @@
5 def _entry_time(self, path, default):
6 try:
7 st = os.lstat(path)
8- return max(st.st_mtime, st.st_ctime)
9+ return st.st_mtime
10 except OSError:
11 return default
12

Subscribers

People subscribed via source and target branches