diff options
| author | FELD Boris <lothiraldan@gmail.com> | 2011-01-29 17:32:29 +0100 |
|---|---|---|
| committer | FELD Boris <lothiraldan@gmail.com> | 2011-01-29 17:32:29 +0100 |
| commit | 35c4545ca4ca5b4d46d11cfe9968f1644148b308 (patch) | |
| tree | aefa8ccd6e6f315da35bf859642fde0ba19e71e2 | |
| parent | 5c0b1a9c7832d60599a6790b680a27759db225f7 (diff) | |
| download | disutils2-35c4545ca4ca5b4d46d11cfe9968f1644148b308.tar.gz | |
Correct bug : DATAFILES not added in RECORD file.
| -rw-r--r-- | distutils2/command/install_distinfo.py | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/distutils2/command/install_distinfo.py b/distutils2/command/install_distinfo.py index 3df90cd..61c27ad 100644 --- a/distutils2/command/install_distinfo.py +++ b/distutils2/command/install_distinfo.py @@ -69,6 +69,9 @@ class install_distinfo(Command): self.requested = True if self.no_record is None: self.no_record = False + if self.no_datafiles is None: + self.no_datafiles = False + metadata = self.distribution.metadata @@ -116,6 +119,24 @@ class install_distinfo(Command): f.close() self.outputs.append(requested_path) + + 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) + + self.outputs.append(datafiles_path) + finally: + f.close() + if not self.no_record: record_path = os.path.join(self.distinfo_dir, 'RECORD') logger.info('creating %s', record_path) @@ -145,21 +166,6 @@ 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 |
