mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Fix timestamp verification in FileSpec on some file systems
This commit is contained in:
parent
69f15258e4
commit
e691a679d4
@ -31,7 +31,7 @@ class FileSpec:
|
||||
if st is None:
|
||||
st = os.stat(pathname.toOsSpecific())
|
||||
self.size = st.st_size
|
||||
self.timestamp = st.st_mtime
|
||||
self.timestamp = int(st.st_mtime)
|
||||
|
||||
self.readHash(pathname)
|
||||
|
||||
@ -122,7 +122,7 @@ class FileSpec:
|
||||
self.__correctHash(packageDir, pathname, st, notify)
|
||||
return False
|
||||
|
||||
if st.st_mtime == self.timestamp:
|
||||
if int(st.st_mtime) == self.timestamp:
|
||||
# If the size is right and the timestamp is right, the
|
||||
# file passes.
|
||||
if notify:
|
||||
@ -196,7 +196,7 @@ class FileSpec:
|
||||
# The hash is OK. If the timestamp is wrong, change it back
|
||||
# to what we expect it to be, so we can quick-verify it
|
||||
# successfully next time.
|
||||
if st.st_mtime != self.timestamp:
|
||||
if int(st.st_mtime) != self.timestamp:
|
||||
self.__updateTimestamp(pathname, st)
|
||||
|
||||
return True
|
||||
@ -217,7 +217,7 @@ class FileSpec:
|
||||
if notify:
|
||||
notify.info("Correcting timestamp of %s to %d (%s)" % (
|
||||
self.filename, st.st_mtime, time.asctime(time.localtime(st.st_mtime))))
|
||||
self.timestamp = st.st_mtime
|
||||
self.timestamp = int(st.st_mtime)
|
||||
|
||||
def checkHash(self, packageDir, pathname, st):
|
||||
""" Returns true if the file has the expected md5 hash, false
|
||||
|
Loading…
x
Reference in New Issue
Block a user