Commit Graph

168 Commits

Author SHA1 Message Date
Lubomír Sedlář bfd5a39ce6 checks: Check for createrepo_c
The createrepo package is needed always, but depending on configuration
we should also look for createrepo_c.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-10-25 16:00:37 +02:00
Patrick Uiterwijk 933c2608cd Add more require checks
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2016-10-25 10:37:55 +00:00
Patrick Uiterwijk 51a8f7a7fe Fix package name for createrepo and mergerepo
These binaries are in the createrepo package, not yum-utils.

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2016-10-25 10:29:06 +00:00
Lubomír Sedlář c38bb4809b config: Don't abort on deprecated options
These options are in fact removed and have no effect anymore. This patch
changes the validation to print a warning that the option was removed
and what should be done instead. It no longer stops the whole compose.

The validation script still rejects configuration files with these
removed keys.

This change means we no longer check these removals with the JSON schema
(as that makes it hard to determine where exactly the problem is).

Fixes: #438
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-10-20 12:51:12 +02:00
Lubomír Sedlář 50e9294057 config: Validate variant regular expressions
When the mapping in configuration specifies incorrect regular expression
to match regular expressions, we should raise an error immediately and
not wait until the part of config is actually used.

This patch does not cover `live_media`, `image_build` and `osbs`
sections, as they use plain dicts and not the list of tuples format.

Fixes: #424
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-10-12 09:38:59 +02:00
Lubomír Sedlář 446f21d4d7 config: Accept empty branch in SCM dict
If user sets `branch` to `None`, it should behave as if the branch is
not set at all. Nagging them about removing it is not helping anything.

Fixes: #415
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-10-03 19:37:56 +02:00
Lubomír Sedlář a042906717 init: Remove keep_original_comps option
The same information can be inferred from definitions in variants.xml:
if the variant has no groups defined, we include packages from all
groups. By the same logic we can also include all groups in the comps
file.

The config validation is updated to give a hint on how to remove the
option from the configuration.

Relates: #29
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-09-22 13:35:28 +02:00
Lubomír Sedlář bf46048cbf createrepo: Add option to use xz compression
This patch adds a new config option createrepo_use_xz, which when set to
true will cause createrepo to compress sqlite databases with xz. The
default setting is False.

Fixes: #387
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-09-12 11:10:43 +02:00
Lubomír Sedlář f9a6c8418f Add JSON Schema for configuration
The schema is written in Python to reduce duplication. When
configuration is loaded, the validation checks if it's correct and fills
in default values.

There is a custom extension to the schema to report deprecated options.

The config dependencies are implemented as a separate pass. While it's
technically possible to express the dependencies in the schema itself,
the error messages are not very helpful and it makes the schema much
harder to read.

Phases no longer define `config_options`. New options should be added to
the schema. Since the default values are populated automatically during
validation, there is no need to duplicate them into the code.

The `pungi-config-validate` script is updated to use the schema and
report errors even for deeply nested fields.

The dependencies are updated: pungi now depends on `python-jsonschema`
(which is already available in Fedora).

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-09-01 10:56:15 +02:00
Lubomír Sedlář 490514e263 [checks] Add a check for too restrictive umask
If umask is set to something too high (>0022), a warning will be
printed. It does not abort the compose though.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-31 10:10:18 +02:00
Lubomír Sedlář 07f5da5d4f [checks] Fix tests to never use real real arch
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 18:54:14 +01:00
Lubomír Sedlář 19468dda77 [checks] Reduce code duplication
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 12:35:08 +01:00
Lubomír Sedlář 0f3bfbbddf [checks] Relax check for genisoimage
The rules are similar to isohybrid, but there are no checks for
architecture.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 11:23:45 +01:00
Lubomír Sedlář d8f685000d [checks] Remove duplicate msgfmt line
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 11:20:10 +01:00
Lubomír Sedlář 2d9dd0e535 [checks] Relax check for isohybrid command
It is used only in createiso and productimg phases.

For productimg, it needs to be present only when the compose is bootable
and productimg phase is explicitly enabled.

For createiso, it is only needed if runroot is not enabled.

Additionally, if we detect pungi running on arch for which syslinux is
not available, a warning is printed, but the compose is allowed to
continue (and possibly crash later).

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 11:20:10 +01:00
Lubomír Sedlář 337d2a999c [checks] Don't always require jigdo
If the configuration specifically requests no jigdos, there is no point
in checking for the binary existence.

This is not 100% reliable. The jigdo option defaults to True, so if the
option is not specified the binary is required even if there are no
images configured.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-10 09:08:19 +01:00
Dennis Gilmore 913494d889 update the package to be installed for productmd to python-productmd
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2015-06-07 10:55:10 -05:00
Daniel Mach f116d9384f Initial code merge for Pungi 4.0. 2015-02-10 08:19:34 -05:00