In movefile() timestamp preservation code, use another loop to search for
authorZac Medico <zmedico@gentoo.org>
Sun, 13 Dec 2009 03:51:26 +0000 (03:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 13 Dec 2009 03:51:26 +0000 (03:51 -0000)
another digit of precision. (trunk r15037)

svn path=/main/branches/2.1.7/; revision=15071

pym/portage/__init__.py

index bd31e447f32b7bffdcd88c59cff4a4aa29021788..b83d535172d898928b78cce173658ae52c5f0650 100644 (file)
@@ -7682,6 +7682,15 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None,
                                                        mtime_str = mtime_str[:-1]
                                                        newmtime = float(mtime_str)
                                                        if int_mtime == long(newmtime):
+                                                               another_digit = None
+                                                               for i in range(1, 9):
+                                                                       i_str = str(i)
+                                                                       if int_mtime != long(float(mtime_str + i_str)):
+                                                                               break
+                                                                       else:
+                                                                               another_digit = i_str
+                                                               if another_digit is not None:
+                                                                       mtime_str += another_digit
                                                                break
                                                        elif len(mtime_str) <= min_len:
                                                                # This shouldn't happen, but let's make sure