No description
Find a file
David Rheinsberg 2624be92dc osbuild: cleanup contextlib usage
Two cleanups for the context-managers we use:

  * Use `contextlib.AbstractContextManager` if possible. This class
    simply provides a default `__enter__` implementation which just
    returns `self`. So use it where applicable.
    Additionally, it provides an abstract `__exit__` method and thus
    allows static checks for an existance of `__exit__` in the dependent
    class. We might use that everywhere, but this is a separate
    decision, so not included here.

  * Explicitly return `None` from `__exit__`. The python docs state:

        If an exception is supplied, and the method wishes to suppress
        the exception (i.e., prevent it from being propagated), it
        should return a true value. Otherwise, the exception will be
        processed normally upon exit from this method.

    That is, unless we want exceptions to be suppressed, we should
    never return a `truthy` value. The python contextlib suggest using
    `None` as a default return value, so lets just do that.

    In particular, the explicit `return exc_type is None` that we use
    has no effect at all, since it only returns `True` if no exception
    was raised.

    This commit cleans this up and just follows what the `contextlib`
    module does and returns None everywhere (well, it returns nothing
    which apparently is the same as returning `None` in python). It is
    unlikely that we ever want to suppress any exceptions, anyway.
2020-04-21 16:02:20 +02:00
.github/workflows ci: pylint all the things 2020-04-20 18:58:26 +02:00
assemblers osbuild: convert to jsoncomm 2020-04-21 13:47:38 +02:00
docs osbuild: add --output-directory=DIR 2020-04-15 15:40:17 +02:00
jenkins 🤏 Add a little bit more testing 2020-04-09 16:35:08 +02:00
osbuild osbuild: cleanup contextlib usage 2020-04-21 16:02:20 +02:00
runners osbuild: convert to jsoncomm 2020-04-21 13:47:38 +02:00
samples samples: fix grub2-legacy in base-qcow2 2020-04-20 18:58:53 +02:00
schemas schema: add json-schema describing our manifest 2020-03-07 13:43:24 +01:00
sources osbuild: unify libdir handling 2020-04-21 13:44:43 +02:00
stages osbuild: cleanup contextlib usage 2020-04-21 16:02:20 +02:00
test util/linux: add explicit FS_IMMUTABLE_FL helpers 2020-04-21 14:46:02 +02:00
.editorconfig editorconfig: add one matching current style 2019-12-13 18:15:08 +01:00
.gitignore .gitignore: remove old ignored directory 2020-03-06 11:57:17 +01:00
.pylintrc pylint: disable too-many-arguments rule 2019-07-24 12:55:48 +02:00
.travis.yml ci: import runtime tests to github actions 2020-03-24 16:08:24 +01:00
LICENSE Revert "Fill in the license template" 2019-11-18 12:23:10 +01:00
Makefile build: fix makefile comments 2020-04-15 18:21:03 +02:00
NEWS.md NEWS: add v12 entry 2020-04-15 18:21:03 +02:00
osbuild.spec osbuild: unify libdir handling 2020-04-21 13:44:43 +02:00
README.md docs: refactor README 2020-03-02 21:34:09 +01:00
setup.py 12 2020-04-15 20:19:36 +02:00
tree-diff tools/tree-diff: strip NULL character from selinux xattr 2019-10-08 21:39:35 +02:00

OSBuild

Build-Pipelines for Operating System Artifacts

OSBuild is a pipeline-based build system for operating system artifacts. It defines a universal pipeline description and a build system to execute them, producing artifacts like operating system images, working towards an image build pipeline that is more comprehensible, reproducible, and extendable.

See the osbuild(1) man-page for details on how to run osbuild, the definition of the pipeline description, and more.

Project

Requirements

The requirements for this project are:

  • python >= 3.7
  • systemd-nspawn >= 244

Additionally, the built-in stages require:

  • bash >= 5.0
  • coreutils >= 8.31
  • curl >= 7.68
  • qemu-img >= 4.2.0
  • rpm >= 4.15
  • tar >= 1.32
  • util-linux >= 235

At build-time, the following software is required:

  • python-docutils >= 0.13
  • pkg-config >= 0.29

Build

The standard python package system is used. Consult upstream documentation for detailed help. In most situations the following commands are sufficient to build and install from source:

python setup.py build
python setup.py install --skip-build --root=/

The man-pages require python-docutils and can be built via:

rst2man docs/<input-file>.rst <output-file>

Repository:

License:

  • Apache-2.0
  • See LICENSE file for details.