Commit ae6b2254 authored by Greg Ward's avatar Greg Ward

Bastian Kleineidam: 'copy_file()' now returns the output filename, rather

than a boolean indicating whether it did the copy.
parent bed42c84
...@@ -96,9 +96,8 @@ def copy_file (src, dst, ...@@ -96,9 +96,8 @@ def copy_file (src, dst,
on other systems, uses '_copy_file_contents()' to copy file on other systems, uses '_copy_file_contents()' to copy file
contents. contents.
Return true if the file was copied (or would have been copied), Return the name of the destination file, whether it was actually
false otherwise (ie. 'update' was true and the destination is copied or not."""
up-to-date)."""
# XXX if the destination file already exists, we clobber it if # XXX if the destination file already exists, we clobber it if
# copying, but blow up if linking. Hmmm. And I don't know what # copying, but blow up if linking. Hmmm. And I don't know what
...@@ -123,7 +122,7 @@ def copy_file (src, dst, ...@@ -123,7 +122,7 @@ def copy_file (src, dst,
if update and not newer (src, dst): if update and not newer (src, dst):
if verbose: if verbose:
print "not copying %s (output up-to-date)" % src print "not copying %s (output up-to-date)" % src
return 0 return dst
try: try:
action = _copy_action[link] action = _copy_action[link]
...@@ -137,7 +136,7 @@ def copy_file (src, dst, ...@@ -137,7 +136,7 @@ def copy_file (src, dst,
print "%s %s -> %s" % (action, src, dst) print "%s %s -> %s" % (action, src, dst)
if dry_run: if dry_run:
return 1 return dst
# On a Mac, use the native file copy routine # On a Mac, use the native file copy routine
if os.name == 'mac': if os.name == 'mac':
...@@ -171,7 +170,7 @@ def copy_file (src, dst, ...@@ -171,7 +170,7 @@ def copy_file (src, dst,
if preserve_mode: if preserve_mode:
os.chmod (dst, S_IMODE (st[ST_MODE])) os.chmod (dst, S_IMODE (st[ST_MODE]))
return 1 return dst
# copy_file () # copy_file ()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment