Lines Matching +full:target +full:- +full:file
3 Utility functions for simple, timestamp-based dependency of files
11 def newer (source, target): argument
13 'target', or if 'source' exists and 'target' doesn't. Return false if
14 both exist and 'target' is the same age or younger than 'source'.
18 raise DistutilsFileError("file '%s' does not exist" %
20 if not os.path.exists(target):
25 mtime2 = os.stat(target)[ST_MTIME]
34 than its corresponding target. Return a pair of lists (sources,
35 targets) where source is newer than target, according to the semantics
54 def newer_group (sources, target, missing='error'): argument
55 """Return true if 'target' is out-of-date with respect to any file
56 listed in 'sources'. In other words, if 'target' exists and is newer
57 than every file in 'sources', return false; otherwise return true.
58 'missing' controls what we do when a source file is missing; the
61 "newer", any missing source files make us assume that 'target' is
62 out-of-date (this is handy in "dry-run" mode: it'll make you pretend to
67 # If the target doesn't even exist, then it's definitely out-of-date.
68 if not os.path.exists(target):
71 # Otherwise we have to find out the hard way: if *any* source file
72 # is more recent than 'target', then 'target' is out-of-date and
74 # of the loop, then 'target' is up-to-date and we return false.
76 target_mtime = os.stat(target)[ST_MTIME]
79 if missing == 'error': # blow up when we stat() the file
82 continue # target's dependency list
83 elif missing == 'newer': # missing source means target is
84 return 1 # out-of-date