Fix validation of man page extension. (#749)

If the extension does not exist or is not a number, the error message is
not raised because the assumptions cause a different exception.
pull/754/head
Elliott Sales de Andrade 9 years ago committed by Jussi Pakkanen
parent 84995b2993
commit a7cf241334
  1. 5
      mesonbuild/interpreter.py
  2. 2
      test cases/failing/31 invalid man extension/meson.build
  3. 2
      test cases/failing/32 no man extension/meson.build

@ -454,7 +454,10 @@ class Man(InterpreterObject):
def validate_sources(self):
for s in self.sources:
num = int(s.split('.')[-1])
try:
num = int(s.split('.')[-1])
except (IndexError, ValueError):
num = 0
if num < 1 or num > 8:
raise InvalidArguments('Man file must have a file extension of a number between 1 and 8')

@ -0,0 +1,2 @@
project('man install', 'c')
m1 = install_man('foo.a1')

@ -0,0 +1,2 @@
project('man install', 'c')
m1 = install_man('foo')
Loading…
Cancel
Save