diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-11-08 15:53:47 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-11-08 17:43:24 -0500 |
commit | a2262103fb749b570c4096b43ee107ad7143c04e (patch) | |
tree | 0f92a5ddca431d391d8918c9d84ec23c32d99389 /mesonbuild/modules | |
parent | 841380acfe682023b0df9fa76debbe3030f31daa (diff) | |
download | meson-a2262103fb749b570c4096b43ee107ad7143c04e.zip meson-a2262103fb749b570c4096b43ee107ad7143c04e.tar.gz meson-a2262103fb749b570c4096b43ee107ad7143c04e.tar.bz2 |
Implement mlog.warning and use it everywhere for warnings
Prepends the string with 'WARNING:' in ANSI yellow.
Closes https://github.com/mesonbuild/meson/issues/961
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/gnome.py | 12 | ||||
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 4 | ||||
-rw-r--r-- | mesonbuild/modules/qt4.py | 6 | ||||
-rw-r--r-- | mesonbuild/modules/qt5.py | 6 | ||||
-rw-r--r-- | mesonbuild/modules/rpm.py | 13 |
5 files changed, 20 insertions, 21 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 27200ae..fa8aec4 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -44,10 +44,10 @@ class GnomeModule: global gresource_warning_printed if not gresource_warning_printed: if mesonlib.version_compare(self._get_native_glib_version(state), '< 2.50.0'): - mlog.log('Warning, GLib compiled dependencies do not work fully ' - 'with versions of GLib older than 2.50.0.\n' - 'See the following upstream issue:', - mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=745754')) + mlog.warning('GLib compiled dependencies do not work fully ' + 'with versions of GLib older than 2.50.0.\n' + 'See the following upstream issue:', + mlog.bold('https://bugzilla.gnome.org/show_bug.cgi?id=745754')) gresource_warning_printed = True return [] @@ -136,7 +136,7 @@ class GnomeModule: cwd=state.environment.get_source_dir()) (stdout, _) = pc.communicate() if pc.returncode != 0: - mlog.log(mlog.bold('Warning:'), 'glib-compile-resources has failed to get the dependencies for {}'.format(cmd[1])) + mlog.warning('glib-compile-resources has failed to get the dependencies for {}'.format(cmd[1])) raise subprocess.CalledProcessError(pc.returncode, cmd) dep_files = stdout.split('\n')[:-1] @@ -297,7 +297,7 @@ class GnomeModule: except Exception: global girwarning_printed if not girwarning_printed: - mlog.log(mlog.bold('Warning:'), 'gobject-introspection dependency was not found, disabling gir generation.') + mlog.warning('gobject-introspection dependency was not found, disabling gir generation.') girwarning_printed = True return [] pkgargs = pkgstr.decode().strip().split() diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 7556375..3ecb40d 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -34,7 +34,7 @@ class PkgConfigModule: return l.name # In other cases, we can't guarantee that the compiler will be able to # find the library via '-lfoo', so tell the user that. - mlog.log(mlog.red('WARNING:'), msg.format(l.name, 'name_prefix', l.name, pcfile)) + mlog.warning(msg.format(l.name, 'name_prefix', l.name, pcfile)) return l.name def generate_pkgconfig_file(self, state, libraries, subdirs, name, description, @@ -79,7 +79,7 @@ class PkgConfigModule: # If using a custom suffix, the compiler may not be able to # find the library if l.name_suffix_set: - mlog.log(mlog.red('WARNING:'), msg.format(l.name, 'name_suffix', lname, pcfile)) + mlog.warning(msg.format(l.name, 'name_suffix', lname, pcfile)) yield '-l%s' % lname if len(libraries) > 0: ofile.write('Libs: {}\n'.format(' '.join(generate_libs_flags(libraries)))) diff --git a/mesonbuild/modules/qt4.py b/mesonbuild/modules/qt4.py index 81a70fc..b1d951b 100644 --- a/mesonbuild/modules/qt4.py +++ b/mesonbuild/modules/qt4.py @@ -90,7 +90,7 @@ class Qt4Module(): result = [] for child in root[0]: if child.tag != 'file': - mlog.log("Warning, malformed rcc file: ", os.path.join(state.subdir, fname)) + mlog.warning("malformed rcc file: ", os.path.join(state.subdir, fname)) break else: result.append(os.path.join(state.subdir, relative_part, child.text)) @@ -150,6 +150,6 @@ class Qt4Module(): return sources def initialize(): - mlog.log('Warning, rcc dependencies will not work properly until this upstream issue is fixed:', - mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460')) + mlog.warning('rcc dependencies will not work properly until this upstream issue is fixed:', + mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460')) return Qt4Module() diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py index 4f19b78..9fffcff 100644 --- a/mesonbuild/modules/qt5.py +++ b/mesonbuild/modules/qt5.py @@ -97,7 +97,7 @@ class Qt5Module(): result = [] for child in root[0]: if child.tag != 'file': - mlog.log("Warning, malformed rcc file: ", os.path.join(state.subdir, fname)) + mlog.warning("malformed rcc file: ", os.path.join(state.subdir, fname)) break else: result.append(os.path.join(state.subdir, relative_part, child.text)) @@ -160,6 +160,6 @@ class Qt5Module(): return sources def initialize(): - mlog.log('Warning, rcc dependencies will not work reliably until this upstream issue is fixed:', - mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460')) + mlog.warning('rcc dependencies will not work reliably until this upstream issue is fixed:', + mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460')) return Qt5Module() diff --git a/mesonbuild/modules/rpm.py b/mesonbuild/modules/rpm.py index 13aa20b..e9f6396 100644 --- a/mesonbuild/modules/rpm.py +++ b/mesonbuild/modules/rpm.py @@ -63,8 +63,8 @@ class RPMModule: so_installed = True elif isinstance(target, build.StaticLibrary) and target.need_install: to_delete.add('%%{buildroot}%%{_libdir}/%s' % target.get_filename()) - mlog.log('Warning, removing', mlog.bold(target.get_filename()), - 'from package because packaging static libs not recommended') + mlog.warning('removing', mlog.bold(target.get_filename()), + 'from package because packaging static libs not recommended') elif isinstance(target, gnome.GirTarget) and target.should_install(): files_devel.add('%%{_datadir}/gir-1.0/%s' % target.get_filename()[0]) elif isinstance(target, gnome.TypelibTarget) and target.should_install(): @@ -97,11 +97,10 @@ class RPMModule: fn.write('BuildRequires: pkgconfig(%s)\n' % dep) for lib in state.environment.coredata.ext_libs.values(): fn.write('BuildRequires: %s # FIXME\n' % lib.fullpath) - mlog.log('Warning, replace', mlog.bold(lib.fullpath), - 'with real package.', - 'You can use following command to find package which ' - 'contains this lib:', - mlog.bold('dnf provides %s' % lib.fullpath)) + mlog.warning('replace', mlog.bold(lib.fullpath), 'with real package.', + '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(): if not prog.found(): fn.write('BuildRequires: %{_bindir}/%s # FIXME\n' % |