diff options
Diffstat (limited to 'morphlib/buildsystem.py')
-rw-r--r-- | morphlib/buildsystem.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py index 86eac850..6287063a 100644 --- a/morphlib/buildsystem.py +++ b/morphlib/buildsystem.py @@ -55,7 +55,7 @@ class BuildSystem(object): 'bs': self.name, } - def used_by_project(self, exists): + def used_by_project(self, file_list): '''Does a project use this build system? ``exists`` is a function that returns a boolean telling if a @@ -71,7 +71,7 @@ class ManualBuildSystem(BuildSystem): name = 'manual' - def used_by_project(self, exists): + def used_by_project(self, file_list): return False @@ -87,7 +87,7 @@ class DummyBuildSystem(BuildSystem): self.test_commands = ['echo dummy test'] self.install_commands = ['echo dummy install'] - def used_by_project(self, exists): + def used_by_project(self, file_list): return False @@ -114,7 +114,7 @@ class AutotoolsBuildSystem(BuildSystem): 'make DESTDIR="$DESTDIR" install', ] - def used_by_project(self, exists): + def used_by_project(self, file_list): indicators = [ 'autogen', 'autogen.sh', @@ -124,7 +124,7 @@ class AutotoolsBuildSystem(BuildSystem): 'configure.in.in', ] - return any(exists(x) for x in indicators) + return any(x in file_list for x in indicators) class PythonDistutilsBuildSystem(BuildSystem): @@ -145,12 +145,12 @@ class PythonDistutilsBuildSystem(BuildSystem): 'python setup.py install --prefix "$PREFIX" --root "$DESTDIR"', ] - def used_by_project(self, exists): + def used_by_project(self, file_list): indicators = [ 'setup.py', ] - return any(exists(x) for x in indicators) + return any(x in file_list for x in indicators) class CPANBuildSystem(BuildSystem): @@ -178,12 +178,12 @@ class CPANBuildSystem(BuildSystem): 'make DESTDIR="$DESTDIR" install', ] - def used_by_project(self, exists): + def used_by_project(self, file_list): indicators = [ 'Makefile.PL', ] - return any(exists(x) for x in indicators) + return any(x in file_list for x in indicators) build_systems = [ @@ -202,11 +202,8 @@ def detect_build_system(file_list): For ``exists`` see the ``BuildSystem.exists`` method. ''' - def exists(filename): - return filename in file_list - for bs in build_systems: - if bs.used_by_project(exists): + if bs.used_by_project(file_list): return bs return None |