diff options
author | Éric Araujo <merwok@netwok.org> | 2010-08-14 03:07:46 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-08-14 03:07:46 (GMT) |
commit | 0389ae60fa4d02316b8c0d011f6c399d55f998bc (patch) | |
tree | 9ec0b09bf4b1f533109ee83ebac91689850f718a /Lib/distutils/command | |
parent | e8c4920e4cd0f652036127709c02d2147596ba76 (diff) | |
download | cpython-0389ae60fa4d02316b8c0d011f6c399d55f998bc.zip cpython-0389ae60fa4d02316b8c0d011f6c399d55f998bc.tar.gz cpython-0389ae60fa4d02316b8c0d011f6c399d55f998bc.tar.bz2 |
Merged revisions 83993 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83993 | eric.araujo | 2010-08-14 04:30:34 +0200 (sam., 14 août 2010) | 2 lines
Use a marker in generated MANIFEST files, don't touch files without it. Fixes #8688.
........
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/sdist.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index 087ae9d..f2d2f94 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -349,8 +349,21 @@ class sdist(Command): by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. """ - self.execute(file_util.write_file, - (self.manifest, self.filelist.files), + if os.path.isfile(self.manifest): + fp = open(self.manifest) + try: + first_line = fp.readline() + finally: + fp.close() + + if first_line != '# file GENERATED by distutils, do NOT edit\n': + log.info("not writing to manually maintained " + "manifest file '%s'" % self.manifest) + return + + content = self.filelist.files[:] + content.insert(0, '# file GENERATED by distutils, do NOT edit') + self.execute(file_util.write_file, (self.manifest, content), "writing manifest file '%s'" % self.manifest) def read_manifest(self): |