1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00

- use os.path.getmtime() instead of os.stat()

- use named stat members instead of their index number
This commit is contained in:
Dr. Peter Poeml 2006-06-16 12:19:02 +00:00
parent 96e4e0bbab
commit ae285de206

View File

@ -146,7 +146,7 @@ class Package:
def addfile(self, n):
st = os.stat(os.path.join(self.dir, n))
f = File(n, None, st[6], st[8])
f = File(n, None, st.st_size, st.st_mtime)
self.filelist.append(f)
self.filenamelist.append(n)
self.filenamelist_unvers.remove(n)
@ -787,12 +787,12 @@ def edit_meta(prj, pac):
f.write(''.join(m))
f.close()
timestamp = os.stat(filename).st_mtime
timestamp = os.path.getmtime(filename)
editor = os.getenv('EDITOR', default='vim')
os.system('%s %s' % (editor, filename))
if os.stat(filename).st_mtime == timestamp:
if os.path.getmtime(filename) == timestamp:
print 'File unchanged. Not saving.'
os.unlink(filename)