author Narcis Beleuzu <>
Fri, 15 Dec 2017 02:16:50 +0200
changeset 396515 d0d709880f192e88d1601b657cd562a6fe56d4aa
parent 142757 0e91dc91caf177531722ee33ef74da6ad1d664d2
child 419629 fba6f974041a3d3c22ef95c44f6e4262e8e5c52f
permissions -rw-r--r--
Backed out 7 changesets (bug 1377007) for web platform reftests failures on CSS2/borders. r=backout Backed out changeset c30bc5d5adbc (bug 1377007) Backed out changeset 33fdf9e531e2 (bug 1377007) Backed out changeset 267abdb38036 (bug 1377007) Backed out changeset 4a452c3ac115 (bug 1377007) Backed out changeset e9310960c9e6 (bug 1377007) Backed out changeset 8e5e61dfbbaf (bug 1377007) Backed out changeset 9ac83e79e656 (bug 1377007)

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

import os
import errno

def mtime(path):
        return os.stat(path).st_mtime
    except OSError as e:
        if e.errno == errno.ENOENT:
            return -1

def rebuild_check(args):
    target = args[0]
    deps = args[1:]
    t = mtime(target)
    if t < 0:
        print target

    newer = []
    removed = []
    for dep in deps:
        deptime = mtime(dep)
        if deptime < 0:
        elif mtime(dep) > t:

    if newer and removed:
        print 'Rebuilding %s because %s changed and %s was removed' % (target, ', '.join(newer), ', '.join(removed))
    elif newer:
        print 'Rebuilding %s because %s changed' % (target, ', '.join(newer))
    elif removed:
        print 'Rebuilding %s because %s was removed' % (target, ', '.join(removed))
        print 'Rebuilding %s for an unknown reason' % target

if __name__ == '__main__':
    import sys