Fixed #1276768: verbose option was not used in the code.
diff --git a/Lib/distutils/file_util.py b/Lib/distutils/file_util.py
index 3af6344..82a8b0a 100644
--- a/Lib/distutils/file_util.py
+++ b/Lib/distutils/file_util.py
@@ -76,7 +76,7 @@
preserve_times=1,
update=0,
link=None,
- verbose=0,
+ verbose=1,
dry_run=0):
"""Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is
@@ -123,7 +123,8 @@
dir = os.path.dirname(dst)
if update and not newer(src, dst):
- log.debug("not copying %s (output up-to-date)", src)
+ if verbose == 1:
+ log.debug("not copying %s (output up-to-date)", src)
return dst, 0
try:
@@ -131,10 +132,12 @@
except KeyError:
raise ValueError, \
"invalid value '%s' for 'link' argument" % link
- if os.path.basename(dst) == os.path.basename(src):
- log.info("%s %s -> %s", action, src, dir)
- else:
- log.info("%s %s -> %s", action, src, dst)
+
+ if verbose == 1:
+ if os.path.basename(dst) == os.path.basename(src):
+ log.info("%s %s -> %s", action, src, dir)
+ else:
+ log.info("%s %s -> %s", action, src, dst)
if dry_run:
return (dst, 1)
@@ -178,7 +181,7 @@
# XXX I suspect this is Unix-specific -- need porting help!
def move_file (src, dst,
- verbose=0,
+ verbose=1,
dry_run=0):
"""Move a file 'src' to 'dst'. If 'dst' is a directory, the file will
@@ -191,7 +194,8 @@
from os.path import exists, isfile, isdir, basename, dirname
import errno
- log.info("moving %s -> %s", src, dst)
+ if verbose == 1:
+ log.info("moving %s -> %s", src, dst)
if dry_run:
return dst
@@ -223,7 +227,7 @@
"couldn't move '%s' to '%s': %s" % (src, dst, msg)
if copy_it:
- copy_file(src, dst)
+ copy_file(src, dst, verbose=verbose)
try:
os.unlink(src)
except os.error, (num, msg):