Ticket #63782: dep_util.py.patch
File dep_util.py.patch, 1.1 KB (added by jmroot (Joshua Root), 3 years ago) |
---|
-
Lib/distutils/dep_util.py
old new 6 6 7 7 import os 8 8 from distutils.errors import DistutilsFileError 9 from distutils import log 9 10 10 11 11 12 def newer (source, target): … … 75 76 from stat import ST_MTIME 76 77 target_mtime = os.stat(target)[ST_MTIME] 77 78 for source in sources: 79 log.info("checking dependency '%s'", source) 78 80 if not os.path.exists(source): 79 81 if missing == 'error': # blow up when we stat() the file 80 82 pass 81 83 elif missing == 'ignore': # missing source dropped from 82 84 continue # target's dependency list 83 85 elif missing == 'newer': # missing source means target is 86 log.info("dependency '%s' is missing", source) 84 87 return 1 # out-of-date 85 88 86 89 source_mtime = os.stat(source)[ST_MTIME] 87 90 if source_mtime > target_mtime: 91 log.info("dependency '%s' is newer than '%s'", source, target) 88 92 return 1 89 93 else: 90 94 return 0