From db2b7601c85a7c5f96e8d87cee74d318bce9a367 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Mar 2015 20:30:44 +0300 Subject: [PATCH] modules/rpm: workaround when ext_prog not found locally Traceback (most recent call last): File "../../../meson.py", line 184, in app.generate() File "../../../meson.py", line 130, in generate intr.run() File "/home/brain/git/upstream/meson/interpreter.py", line 828, in run self.evaluate_codeblock(self.ast) File "/home/brain/git/upstream/meson/interpreter.py", line 850, in evaluate_codeblock raise e File "/home/brain/git/upstream/meson/interpreter.py", line 844, in evaluate_codeblock self.evaluate_statement(cur) File "/home/brain/git/upstream/meson/interpreter.py", line 897, in evaluate_statement return self.method_call(cur) File "/home/brain/git/upstream/meson/interpreter.py", line 1620, in method_call return obj.method_call(method_name, args, kwargs) File "/home/brain/git/upstream/meson/interpreter.py", line 625, in method_call value = fn(state, args, kwargs) File "/home/brain/git/upstream/meson/modules/rpm.py", line 98, in generate_spec_template fn.write('BuildRequires: %s\n' % ' '.join(prog.fullpath)) TypeError: sequence item 0: expected str instance, NoneType found Signed-off-by: Igor Gnatenko --- manual tests/5 rpm/meson.build | 1 + modules/rpm.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manual tests/5 rpm/meson.build b/manual tests/5 rpm/meson.build index ebbbdfde9..131da3930 100644 --- a/manual tests/5 rpm/meson.build +++ b/manual tests/5 rpm/meson.build @@ -2,6 +2,7 @@ project('test spec', 'c') rpm = import('rpm') dependency('zlib') +find_program('nonexistprog', required : false) lib = shared_library('mesontest_shared', ['lib.c', 'lib.h'], version : '0.1', soversion : '0', diff --git a/modules/rpm.py b/modules/rpm.py index 4ae1cc6c7..71717386b 100644 --- a/modules/rpm.py +++ b/modules/rpm.py @@ -95,7 +95,10 @@ class RPMModule: 'You can use following command to find package which contains this lib:', mlog.bold('dnf provides %s' % lib.fullpath)) for prog in state.environment.coredata.ext_progs.values(): - fn.write('BuildRequires: %s\n' % ' '.join(prog.fullpath)) + if not prog.found(): + fn.write('BuildRequires: /usr/bin/%s # FIXME\n' % prog.get_name()) + else: + fn.write('BuildRequires: %s\n' % ' '.join(prog.fullpath)) fn.write('BuildRequires: meson\n') fn.write('\n') fn.write('%description\n')