[Python-checkins] CVS: distutils/distutils file_util.py,1.6,1.7
Greg Ward
python-dev@python.org
Sat, 30 Sep 2000 10:29:39 -0700
Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv26261
Modified Files:
file_util.py
Log Message:
Changed 'copy_file()' so it returns a tuple (dest_name, copied) -- hopefully,
this will please everyone (as if that's possible).
Index: file_util.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/file_util.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** file_util.py 2000/09/26 02:03:34 1.6
--- file_util.py 2000/09/30 17:29:35 1.7
***************
*** 96,101 ****
other systems, uses '_copy_file_contents()' to copy file contents.
! Return the name of the destination file, whether it was actually copied
! or not.
"""
# XXX if the destination file already exists, we clobber it if
--- 96,102 ----
other systems, uses '_copy_file_contents()' to copy file contents.
! Return a tuple (dest_name, copied): 'dest_name' is the actual name of
! the output file, and 'copied' is true if the file was copied (or would
! have been copied, if 'dry_run' true).
"""
# XXX if the destination file already exists, we clobber it if
***************
*** 122,126 ****
if verbose:
print "not copying %s (output up-to-date)" % src
! return dst
try:
--- 123,127 ----
if verbose:
print "not copying %s (output up-to-date)" % src
! return (dst, 0)
try:
***************
*** 136,142 ****
if dry_run:
! return dst
! # On a Mac, use the native file copy routine
if os.name == 'mac':
import macostools
--- 137,143 ----
if dry_run:
! return (dst, 1)
! # On Mac OS, use the native file copy routine
if os.name == 'mac':
import macostools
***************
*** 170,174 ****
os.chmod(dst, S_IMODE(st[ST_MODE]))
! return dst
# copy_file ()
--- 171,175 ----
os.chmod(dst, S_IMODE(st[ST_MODE]))
! return (dst, 1)
# copy_file ()