]> granicus.if.org Git - python/commitdiff
Tweaked output of 'copy_file()': if copying to a new name, show the whole
authorGreg Ward <gward@python.net>
Sat, 20 May 2000 16:05:34 +0000 (16:05 +0000)
committerGreg Ward <gward@python.net>
Sat, 20 May 2000 16:05:34 +0000 (16:05 +0000)
destination path, otherwise show just the directory.

Lib/distutils/file_util.py

index 32245109d533eeb82d4c2958808bd6f954667dd9..a73db42b54d0d135a29cc607e0918e0783bed5df 100644 (file)
@@ -90,7 +90,7 @@ def copy_file (src, dst,
        (os.symlink) instead of copying: set it to "hard" or "sym"; if it
        is None (the default), files are copied.  Don't set 'link' on
        systems that don't support it: 'copy_file()' doesn't check if
-       hard or symbolic linking is availalble.
+       hard or symbolic linking is available.
 
        Under Mac OS, uses the native file copy function in macostools;
        on other systems, uses '_copy_file_contents()' to copy file
@@ -131,8 +131,11 @@ def copy_file (src, dst,
         raise ValueError, \
               "invalid value '%s' for 'link' argument" % link
     if verbose:
-        print "%s %s -> %s" % (action, src, dir)
-
+        if os.path.basename(dst) == os.path.basename(src):
+            print "%s %s -> %s" % (action, src, dir)
+        else:
+            print "%s %s -> %s" % (action, src, dst)
+            
     if dry_run:
         return 1