Mercurial > p > roundup > code
comparison roundup/dist/command/bdist_rpm.py @ 6907:551fec9c4cfc
flake8 fixes
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 01 Sep 2022 21:59:58 -0400 |
| parents | 42bf0a707763 |
| children |
comparison
equal
deleted
inserted
replaced
| 6906:3de5a14762ab | 6907:551fec9c4cfc |
|---|---|
| 5 # | 5 # |
| 6 # converted to not use distutils 2021 | 6 # converted to not use distutils 2021 |
| 7 from setuptools.command.bdist_rpm import bdist_rpm as base | 7 from setuptools.command.bdist_rpm import bdist_rpm as base |
| 8 import os | 8 import os |
| 9 | 9 |
| 10 | |
| 10 # cribbed from 2.7 distutils | 11 # cribbed from 2.7 distutils |
| 11 def write_file (filename, contents): | 12 def write_file(filename, contents): |
| 12 """Create a file with the specified name and write 'contents' (a | 13 """Create a file with the specified name and write 'contents' (a |
| 13 sequence of strings without line terminators) to it. | 14 sequence of strings without line terminators) to it. |
| 14 """ | 15 """ |
| 15 f = open(filename, "w") | 16 f = open(filename, "w") |
| 16 try: | 17 try: |
| 17 for line in contents: | 18 for line in contents: |
| 18 f.write(line + "\n") | 19 f.write(line + "\n") |
| 19 finally: | 20 finally: |
| 20 f.close() | 21 f.close() |
| 22 | |
| 21 | 23 |
| 22 class bdist_rpm(base): | 24 class bdist_rpm(base): |
| 23 | 25 |
| 24 def finalize_options(self): | 26 def finalize_options(self): |
| 25 base.finalize_options(self) | 27 base.finalize_options(self) |
| 36 # allow any additional extension for man pages | 38 # allow any additional extension for man pages |
| 37 # (rpm may compress them to .gz or .bz2) | 39 # (rpm may compress them to .gz or .bz2) |
| 38 # man page here is any file | 40 # man page here is any file |
| 39 # with single-character extension | 41 # with single-character extension |
| 40 # in man directory | 42 # in man directory |
| 41 "sed -e 's,\(/man/.*\..\)$,\\1*,' " | 43 r"sed -e 's,\(/man/.*\..\)$,\\1*,' " |
| 42 "<ROUNDUP_FILES >INSTALLED_FILES", | 44 "<ROUNDUP_FILES >INSTALLED_FILES", |
| 43 ]), "writing '%s'" % install_script) | 45 ]), "writing '%s'" % install_script) |
| 44 self.install_script = install_script | 46 self.install_script = install_script |
| 45 |
