Bug 707579, xpt.py shouldn't try to generate destination file if inputs are all older, r=khuey

This commit is contained in:
Mounir Lamouri 2012-04-30 15:18:58 +12:00
Родитель 2ddbd51d64
Коммит 77b7b2e6dc
1 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -1321,12 +1321,25 @@ def xpt_dump(file):
def xpt_link(dest, inputs):
"""
Link all of the xpt files in |inputs| together and write the
result ot |dest|.
result to |dest|.
"""
if not inputs:
print >>sys.stderr, "Usage: xpt_link <destination file> <input files>"
return
# Don't re-create dest if newer than the input files.
if os.path.exists(dest):
maxInputChange = 0;
for f in inputs:
s = os.stat(f).st_mtime
if s > maxInputChange:
maxInputChange = s
if maxInputChange < os.stat(dest).st_mtime:
print dest, " is already up-to-date."
return
t1 = Typelib.read(inputs[0])
for f in inputs[1:]:
t2 = Typelib.read(f)