summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-09-04 20:42:08 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-09-04 20:42:08 (GMT)
commit4d335b3b9b4d24f2869be08b1706153c005523ab (patch)
tree6220ea114c10742338f3b6935ed7675d7a75c5ba /Lib
parenta8ea5ba8a9c2e0674a22fd1629f8fee0cf4cb282 (diff)
downloadcpython-4d335b3b9b4d24f2869be08b1706153c005523ab.zip
cpython-4d335b3b9b4d24f2869be08b1706153c005523ab.tar.gz
cpython-4d335b3b9b4d24f2869be08b1706153c005523ab.tar.bz2
[Bug #444589] Record empty directories in the install_data command
Slightly modified version of patch from Jon Nelson (jnelson).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/command/install_data.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/distutils/command/install_data.py b/Lib/distutils/command/install_data.py
index 28f5938..d0091ce 100644
--- a/Lib/distutils/command/install_data.py
+++ b/Lib/distutils/command/install_data.py
@@ -63,10 +63,18 @@ class install_data (Command):
elif self.root:
dir = change_root(self.root, dir)
self.mkpath(dir)
- for data in f[1]:
- data = convert_path(data)
- (out, _) = self.copy_file(data, dir)
- self.outfiles.append(out)
+
+ if f[1] == []:
+ # If there are no files listed, the user must be
+ # trying to create an empty directory, so add the
+ # directory to the list of output files.
+ self.outfiles.append(dir)
+ else:
+ # Copy files, adding them to the list of output files.
+ for data in f[1]:
+ data = convert_path(data)
+ (out, _) = self.copy_file(data, dir)
+ self.outfiles.append(out)
def get_inputs (self):
return self.data_files or []