From 044b7c15c9209bdd51710f04ab29ce136d9db202 Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Wed, 29 Mar 2000 03:27:45 +0000 Subject: [PATCH] Changed 'copy_tree()' so it returns the list of all files that were copied or might have been copied, regardless of the 'update' flag. --- Lib/distutils/util.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 8242e10fc1b..272961948e6 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -322,13 +322,14 @@ def copy_tree (src, dst, """Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a - directory, raise DistutilsFileError. If 'dst' does not exist, it - is created with 'mkpath()'. The end result of the copy is that - every file in 'src' is copied to 'dst', and directories under - 'src' are recursively copied to 'dst'. Return the list of files - copied (under their output names) -- note that if 'update' is true, - this might be less than the list of files considered. Return - value is not affected by 'dry_run'. + directory, raise DistutilsFileError. If 'dst' does not exist, it is + created with 'mkpath()'. The end result of the copy is that every + file in 'src' is copied to 'dst', and directories under 'src' are + recursively copied to 'dst'. Return the list of files that were + copied or might have been copied, using their output name. The + return value is unaffected by 'update' or 'dry_run': it is simply + the list of all files under 'src', with the names changed to be + under 'dst'. 'preserve_mode' and 'preserve_times' are the same as for 'copy_file'; note that they only apply to regular files, not to @@ -372,10 +373,10 @@ def copy_tree (src, dst, preserve_mode, preserve_times, preserve_symlinks, update, verbose, dry_run)) else: - if (copy_file (src_name, dst_name, - preserve_mode, preserve_times, - update, verbose, dry_run)): - outputs.append (dst_name) + copy_file (src_name, dst_name, + preserve_mode, preserve_times, + update, verbose, dry_run) + outputs.append (dst_name) return outputs