Mercurial > p > roundup > code
comparison roundup/dist/command/bdist_rpm.py @ 6647:42bf0a707763
issue2551183 - Replace references to distutils in roundup/dist/command
First pass at fixing this. Seems to work in:
native install
virtual env
python 2.7 and 3.6. Also docker python 3. Could use more testing
though.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 28 Apr 2022 18:10:10 -0400 |
| parents | e233d7a66343 |
| children | 551fec9c4cfc |
comparison
equal
deleted
inserted
replaced
| 6646:98a9df71e24c | 6647:42bf0a707763 |
|---|---|
| 1 # | 1 # |
| 2 # Copyright (C) 2009 Stefan Seefeld | 2 # Copyright (C) 2009 Stefan Seefeld |
| 3 # All rights reserved. | 3 # All rights reserved. |
| 4 # For license terms see the file COPYING.txt. | 4 # For license terms see the file COPYING.txt. |
| 5 # | 5 # |
| 6 from distutils.command.bdist_rpm import bdist_rpm as base | 6 # converted to not use distutils 2021 |
| 7 from distutils.file_util import write_file | 7 from setuptools.command.bdist_rpm import bdist_rpm as base |
| 8 import os | 8 import os |
| 9 | |
| 10 # cribbed from 2.7 distutils | |
| 11 def write_file (filename, contents): | |
| 12 """Create a file with the specified name and write 'contents' (a | |
| 13 sequence of strings without line terminators) to it. | |
| 14 """ | |
| 15 f = open(filename, "w") | |
| 16 try: | |
| 17 for line in contents: | |
| 18 f.write(line + "\n") | |
| 19 finally: | |
| 20 f.close() | |
| 9 | 21 |
| 10 class bdist_rpm(base): | 22 class bdist_rpm(base): |
| 11 | 23 |
| 12 def finalize_options(self): | 24 def finalize_options(self): |
| 13 base.finalize_options(self) | 25 base.finalize_options(self) |
