diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2001-08-10 20:24:33 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2001-08-10 20:24:33 (GMT) |
commit | f4aa684132a2752118af9a2412f0acc90c258035 (patch) | |
tree | 010537cad2d245af31247c85a78110c05ed6c299 /Lib/distutils/command | |
parent | ab0cad520dc97cc429b912a0c49dfe75305dc684 (diff) | |
download | cpython-f4aa684132a2752118af9a2412f0acc90c258035.zip cpython-f4aa684132a2752118af9a2412f0acc90c258035.tar.gz cpython-f4aa684132a2752118af9a2412f0acc90c258035.tar.bz2 |
[Bug #414032] Make the 'sdist' command work when the distribution contains
libraries. This is done by adding a .get_source_files() method,
contributed by Rene Liebscher and slightly modified.
Remove an unused local variable spotted by PyChecker
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/build_clib.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Lib/distutils/command/build_clib.py b/Lib/distutils/command/build_clib.py index 063da91..69ed044 100644 --- a/Lib/distutils/command/build_clib.py +++ b/Lib/distutils/command/build_clib.py @@ -184,9 +184,25 @@ class build_clib (Command): # get_library_names () - def build_libraries (self, libraries): + def get_source_files (self): + self.check_library_list(self.libraries) + filenames = [] + for (lib_name, build_info) in self.libraries: + sources = build_info.get('sources') + if (sources is None or + type(sources) not in (ListType, TupleType) ): + raise DistutilsSetupError, \ + ("in 'libraries' option (library '%s'), " + "'sources' must be present and must be " + "a list of source filenames") % lib_name + + filenames.extend(sources) + + return filenames + # get_source_files () - compiler = self.compiler + + def build_libraries (self, libraries): for (lib_name, build_info) in libraries: sources = build_info.get('sources') |