When erroring out due to invalid prefix, print the value

Helps with debugging what's going wrong
pull/391/head
Nirbheek Chauhan 9 years ago committed by Nirbheek Chauhan
parent edd61dcf81
commit a901024d33
  1. 2
      mesonbuild/coredata.py
  2. 2
      mesonbuild/mesonmain.py

@ -62,7 +62,7 @@ class UserStringOption(UserOption):
if not isinstance(value, str): if not isinstance(value, str):
raise MesonException('Value "%s" for string option "%s" is not a string.' % (str(newvalue), self.name)) raise MesonException('Value "%s" for string option "%s" is not a string.' % (str(newvalue), self.name))
if self.name == 'prefix' and not os.path.isabs(value): if self.name == 'prefix' and not os.path.isabs(value):
raise MesonException('Prefix option must be an absolute path.') raise MesonException('Prefix option value \'{0}\' must be an absolute path.'.format(value))
if self.name in ('libdir', 'bindir', 'includedir', 'datadir', 'mandir', 'localedir') \ if self.name in ('libdir', 'bindir', 'includedir', 'datadir', 'mandir', 'localedir') \
and os.path.isabs(value): and os.path.isabs(value):
raise MesonException('Option %s must not be an absolute path.' % self.name) raise MesonException('Option %s must not be an absolute path.' % self.name)

@ -82,7 +82,7 @@ class MesonApp():
def __init__(self, dir1, dir2, script_file, handshake, options): def __init__(self, dir1, dir2, script_file, handshake, options):
(self.source_dir, self.build_dir) = self.validate_dirs(dir1, dir2, handshake) (self.source_dir, self.build_dir) = self.validate_dirs(dir1, dir2, handshake)
if not os.path.isabs(options.prefix): if not os.path.isabs(options.prefix):
raise RuntimeError('--prefix must be an absolute path.') raise RuntimeError('--prefix value \'{0}\' must be an absolute path: '.format(options.prefix))
if options.prefix.endswith('/') or options.prefix.endswith('\\'): if options.prefix.endswith('/') or options.prefix.endswith('\\'):
options.prefix = options.prefix[:-1] options.prefix = options.prefix[:-1]
self.meson_script_file = script_file self.meson_script_file = script_file

Loading…
Cancel
Save