7. Layer root

7.1. Overview

This is the root layer of the MFEXT module.

This layer mainly includes core libraries and utilities like :

  • layerapi2 library and utilities which manage the layer system
  • wrappers (python2, python3, python…)
  • glib (gnome) library
  • (and some other documented below)

The root layer is loaded by default and does not depend on another layer. This is the layer dependencies root.

7.2. Special focus on python wrappers

7.2.1. python2 wrapper

The python2 wrapper is available in ${MFEXT_HOME}/bin. It executes a python2 interpreter with following layers loaded :

  • python2_core@mfext
  • python2@mfext (if installed)
  • python2@mfcom (if installed)
  • python2@{current_module} (if installed)

So, if you want to execute a python2 script without any question about currently loaded layers, this is the way to go.

For example:

#!/usr/bin/env python2

print "this code will be always executed in python2 environment"
print "(thanks to the above python2 shebang)"

or

python2 /path/to/a/python2/script.py

7.2.2. python3 wrapper

The python3 wrapper is available in ${MFEXT_HOME}/bin. It executes a python3 interpreter with following layers loaded :

  • python3_core@mfext
  • python3@mfext (if installed)
  • python3@mfcom (if installed)
  • python3@{current_module} (if installed)

So, if you want to execute a python3 script without any question about currently loaded layers, this is the way to go.

For example:

#!/usr/bin/env python3

print("this code will be always executed in python3 environment")
print("(thanks to the above python3 shebang)")

or

python3 /path/to/a/python3/script.py

7.2.3. python wrapper

The python wrapper is available in ${MFEXT_HOME}/bin. It works exactly as the two above wrappers. But the major python version is selected with the METWORK_PYTHON_MODE environment variable.

7.3. Metadata

7.3.1. Layer Home

/opt/metwork-mfext-0.7

7.3.2. Label

root@mfext

7.4. Utilities

7.4.1. mfext_wrapper

usage: /opt/metwork-mfext-0.7/bin/mfext_wrapper COMMAND_TO_WRAP [COMMAND_ARG1] [COMMAND_ARG2] [...]
  => launch the given command within metwork/mfext environnent
  => note: the current environnent is cleared before
  =>       (only MODULE_RUNTIME_SUFFIX, MODULE_RUNTIME_HOME and some standard env var (HOME, TERM, DISPLAY...)
            are keeped intact)

7.4.2. clear.sh

clear wrapper (clear command does not work well for some terminal, force a xterm clear in this case)
usage: clear.sh

7.4.3. metwork_debug

usage: metwork_debug
       print debug informations on stdout

7.4.4. bootstrap_layer.sh

usage: bootstrap_layer.sh LAYER_LABEL LAYER_HOME
  => bootstrap a new layer in the given LAYER_HOME (directory path)
     with the given LAYER_LABEL
  => the directory is automatically created (if it does not exist)
     and the .layerapi2_label file is created (if it does not exist)
  => a bin/, lib/ and lib/pkgconfig/ subdirectories are also created
  => if ${METWORK_PYTHON_MODE} environnement variable == 2,
      a lib/python${PYTHON2_SHORT_VERSION}/site-packages is created
  => if ${METWORK_PYTHON_MODE} environnement variable == 3,
      a lib/python${PYTHON3_SHORT_VERSION}/site-packages is created

7.4.5. envtpl

usage: envtpl [ENVTPL_ARG1] [ENVTPL_ARG2] [...]
  => envtpl wrapper, load python3 layer dynamically but also use
     some other locations because we use envtpl during build
     (before python3/envtpl formal installation)

7.4.6. flake82.sh

usage: flake82.sh [FLAKE8_ARG1] [FLAGE8_ARG2] [...]
  => execute flake8 command with given args in a python2 env
     (even if we are currently in python3 mode)
  => some documentation errors/hints are also ignored here

7.4.7. flake83.sh

usage: flake83.sh [FLAKE8_ARG1] [FLAGE8_ARG2] [...]
  => execute flake8 command with given args in a python3 env
     (even if we are currently in python2 mode)
  => some documentation errors/hints are also ignored here

7.4.8. is_layer_installed

Usage:
  is_layer_installed [OPTION?] LAYER LABEL - output 1 is the given layer is installed

Help Options:
  -h, --help       Show help options

7.4.9. is_layer_loaded

Usage:
  is_layer_loaded [OPTION?] LAYER LABEL OR LAYER HOME - output 1 is the given layer is already loaded

Help Options:
  -h, --help       Show help options

7.4.10. layers

Usage:
  layers [OPTION?] - list installed layers

Help Options:
  -h, --help              Show help options

Application Options:
  -r, --raw               raw output
  -m, --loaded-filter     Loaded layer filter (default: no filter, possible values: yes, no)

7.4.11. layer_wrapper

Usage:
  layer_wrapper [OPTION?] -- COMMAND [COMMAND_ARG1] [COMMAND_ARG2] [...] - wrapper to execute the given command in a process with some specific layers loaded

Help Options:
  -h, --help                 Show help options

Application Options:
  -d, --debug                debug mode
  -e, --empty                unload all layers before
  -c, --cwd                  change working directory to the last layer home
  -x, --extra-env-prefix     if set, add three environnement variables {PREFIX}_NAME, {PREFIX}_LABEL and {PREFIX}_DIR containing the last layer name, label and the last layer home
  -E, --empty-env            empty environnement (imply --empty)
  -k, --empty-env-keeps      coma separated list of env var to keep with --empty-env
  -l, --layers               coma separated list of layers labels/homes ('-' before the name of the layer means 'optional dependency')
  -p, --prepend-env          ENV_VAR,VALUE string to prepend VALUE in : separated ENV_VAR (like PATH) (can be used multiple times)
  -f, --force-prepend        do not check existing paths in prepend

7.4.12. nosetests2.sh

usage: nosetests2.sh [NOSETESTS_ARG1] [NOSETESTS_ARG2] [...]
  => execute nosetests command with given args in a python2 env
     (even if we are currently in python3 mode)

7.4.13. nosetests3.sh

usage: nosetests3.sh [NOSETESTS_ARG1] [NOSETESTS_ARG2] [...]
  => execute nosetests command with given args in a python3 env
     (even if we are currently in python2 mode)

7.4.14. pylint2.sh

usage: pylint2.sh [PYLINT_ARG1] [PYLIN2_ARG2] [...]
  => execute pylint command with given args in a python2 env
     (even if we are currently in python3 mode)

7.4.15. pylint3.sh

usage: pylint3.sh [PYLINT_ARG1] [PYLINT_ARG2] [...]
  => execute pylint command with given args in a python3 env
     (even if we are currently in python2 mode)

7.4.16. python

[WARNING]: can't launch command=/opt/metwork-mfext-0.7/bin/python

7.4.17. python2

usage: /opt/metwork-mfext-0.7/bin/python2 [ARG1] [ARG2] [...]
  => wrapper to execute the command 'python [ARG1] [ARG2] [...]' in a context with layers 'python2_core@mfext,-python2@mfext,-python2@mfcom,-python2@{MODULE_LOWERCASE}' loaded

7.4.18. python3

usage: /opt/metwork-mfext-0.7/bin/python3 [ARG1] [ARG2] [...]
  => wrapper to execute the command 'python [ARG1] [ARG2] [...]' in a context with layers 'python3_core@mfext,-python3@mfext,-python3@mfcom,-python3@{MODULE_LOWERCASE}' loaded

7.4.19. sphinx_wrapper

usage: /opt/metwork-mfext-0.7/bin/sphinx_wrapper [ARG1] [ARG2] [...]
  => wrapper to execute the command 'sphinx-build [ARG1] [ARG2] [...]' in a context with layers 'python3_devtools@mfext' loaded

7.5. Packages

Name Version Description Home Page  
glib 2.56.4 GLib provides the core application building blocks for libraries and applications written in C. https://developer.gnome.org/glib/

(1 package)