1 |
On Wed, 25 Nov 2009 14:13:58 -0700 |
2 |
Denis Dupeyron <calchan@g.o> wrote: |
3 |
> A quick note to tell you that I have tried to look for examples of |
4 |
> breakage due to how mtime preservation is currently implemented in |
5 |
> portage. Unfortunately I didn't find anything, maybe because I'm not |
6 |
> knowledgeable enough or because I can't afford to spend any more time |
7 |
> on this. If any of you can provide an example then please do so. |
8 |
|
9 |
Portage uses two ways of merging a file: os.rename() and the manual |
10 |
way. |
11 |
|
12 |
os.rename() correctly preserves mtimes. |
13 |
|
14 |
Python's os.utime call, which is what Portage uses to preserve mtimes |
15 |
for files that it installs the hard way, and which is not a wrapper for |
16 |
the Unix utime call, uses an IEEE 754 double to handle timestamps. But |
17 |
a double only gives sixteen accurate decimal digits, and you've got ten |
18 |
to the left of the decimal point, leaving only six reliably preserved, |
19 |
with the remaining three digits being corrupted. |
20 |
|
21 |
Thus, packages can end up being installed with some files having |
22 |
accurately-preserved mtimes, and some having corrupted mtimes, which |
23 |
will lead to mtime comparisons giving incorrect results. |
24 |
|
25 |
-- |
26 |
Ciaran McCreesh |