summaryrefslogtreecommitdiff
path: root/distutils2/command/install_distinfo.py
diff options
context:
space:
mode:
Diffstat (limited to 'distutils2/command/install_distinfo.py')
-rw-r--r--distutils2/command/install_distinfo.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/distutils2/command/install_distinfo.py b/distutils2/command/install_distinfo.py
index 6e76546..3df90cd 100644
--- a/distutils2/command/install_distinfo.py
+++ b/distutils2/command/install_distinfo.py
@@ -39,9 +39,11 @@ class install_distinfo(Command):
"do not generate a REQUESTED file"),
('no-record', None,
"do not generate a RECORD file"),
+ ('no-datafiles', None,
+ "do not generate a DATAFILES list installed file")
]
- boolean_options = ['requested', 'no-record']
+ boolean_options = ['requested', 'no-record', 'no-datafiles']
negative_opt = {'no-requested': 'requested'}
@@ -50,6 +52,7 @@ class install_distinfo(Command):
self.installer = None
self.requested = None
self.no_record = None
+ self.no_datafiles = None
def finalize_options(self):
self.set_undefined_options('install_dist',
@@ -142,6 +145,22 @@ class install_distinfo(Command):
finally:
f.close()
+ if not self.no_datafiles:
+ datafiles_path = os.path.join(self.distinfo_dir, 'DATAFILES')
+ logger.info('creating %s', datafiles_path)
+ f = open(datafiles_path, 'wb')
+ try:
+ writer = csv.writer(f, delimiter=',',
+ lineterminator=os.linesep,
+ quotechar='"')
+ install_data = self.get_finalized_command('install_data')
+ if install_data.get_datafiles_out() != '':
+ for tuple in install_data.get_datafiles_out():
+ writer.writerow(tuple)
+ finally:
+ f.close()
+
+
def get_outputs(self):
return self.outputs