Commit Graph

25 Commits

Author SHA1 Message Date
Jeremy Cline ee1ee0467b extra-files: Write a metadata file enumerating extra files
Introduces a new metadata file to track arbitrary files added during the
extra-files phase. This file is placed in the root of each tree and is
called ``extra_files.json``. It is a JSON file containing a single
object, which contains a "header" key with an object describing the
metadata, and a "data" key, which is an array of objects, where each
object represents a file. Each object contains the "file", "checksums",
and "size" keys. "file" is the relative path from the tree root to the
extra file. "checksums" is an object containing one or more checksums,
where the key is the digest type and the value of that key is the hex
digest. Finally, the size is the size of the file in bytes.

For example:
{
  "header": {"version": "1.0},
  "data": [
    {
      "file": "GPL",
      "checksums": {
        "sha256": "8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643"
      },
      "size": 18092
    },
    {
      "file": "release-notes/notes.html",
      "checksums": {
        "sha256": "82b1ba8db522aadf101dca6404235fba179e559b95ea24ff39ee1e5d9a53bdcb"
      },
      "size": 1120
    }
  ]
}

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
Fixes: #295
2016-09-07 13:02:48 +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ář 8323a735e7 Always generate rpms.json file
Even if gather phase is skipped, it will still generate a rpms.json
metadata file. It will have no payload, but the header structure is
there.

Createrepo phase had to be updated to ignore variants that have no RPMs
listed in metadata.

There is one more fix for writing treeinfo files: if repomd.xml files
are not generated, it will no longer crash.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-27 08:50:19 +02:00
Lubomír Sedlář 658ef90458 [metadata] Correctly save final flag
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-06-13 19:01:38 +02:00
Daniel Mach f0aecf6744 Add support for top-level variant IDs with dashes.
This is for layered products that have a variant mapped
to multiple variants in a base product, for example:
 * Foo-Tools (id: FooTools, uid: Foo-Tools, name: Tools)
 * Bar-Tools (id: BarTools, uid: Bar-Tools, name: Tools)

Requires productmd >= 1.2.

Signed-off-by: Daniel Mach <dmach@redhat.com>
2016-06-02 10:16:16 -04:00
Lubomír Sedlář 2113b6475c [metadata] Add tests for discinfo files
This tests writing and reading them.

Also, it makes sure the description for layered products is correct:
there was a missing space.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-23 18:34:04 +02:00
Lubomír Sedlář 385f0e950c Add type to base product for layered releases
Default value is "ga", can be overwritten by `base_product_type` config
option.

Fixes: #305
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-05-23 14:12:23 +02:00
Lubomír Sedlář f5897eccbb [metadata] Stop crashing on empty path from .treeinfo
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-03-16 15:24:37 +01:00
Lubomír Sedlář 454363fba8 Allow specifying empty variants
The variants.xml file can list a variant with is_empty="true" and no
groups. If such variant is found, not package gathering will be run for
it, and no repos will be created.

This only makes sense for a variant that will have some other
deliverables like live media or images.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-02-16 15:08:15 +01:00
Lubomír Sedlář a1384b60f4 Fix missing checksums in .treeinfo
The images listed in the file are obtained from .treeinfo files created
during buildinstall phase. However, the files are not stored directly in
buildinstall dir `work/$arch/buildinstall/` but in variant subdirectory
`work/$arch/buildinstall/$variant`.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2016-01-06 13:36:44 +01:00
Daniel Mach ba9df6dc5e New config option: product_type (default is 'ga'); Set to 'updates' for updates composes. 2015-08-25 08:04:06 -04:00
Daniel Mach 19a7394974 Fix treeinfo checksums. 2015-07-24 10:49:28 -04:00
Daniel Mach 72302bd98e Rename product_* to release_*.
CHANGE: Rename product_* config options to release_* for consistency with productmd.
ACTION: Rename product_name, product_short, product_version, product_is_layered to release_* in config files.
        Rename //variant/product to //variant/release in variants XML.
2015-07-09 06:58:30 -04:00
Lubos Kocman e3e60c75a2 fix incorrect reference to variable 'product_is_layered' 2015-06-07 18:28:08 +00:00
Daniel Mach fd8cd62e79 Fix remaining productmd issues. 2015-06-06 13:46:20 -05:00
Daniel Mach 6b34cb98d2 Revert "refactor metadata.py to use productmd's compose.dump for composeinfo"
This reverts commit 40b8ccb3acdc7dd869e4aa32f1ad672ff01bd0ea.
2015-06-06 13:46:19 -05:00
Daniel Mach 977ad66995 Fix LoraxTreeInfo class inheritance. 2015-06-06 13:46:19 -05:00
Adam Miller f633c04497 fix arg order for checksums.add 2015-06-06 13:46:19 -05:00
Adam Miller cc48f6522a update for productmd checksums.add to TreeInfo 2015-06-06 13:46:19 -05:00
Adam Miller 989b018090 fix product -> release namespace change for productmd 2015-06-06 13:46:19 -05:00
Adam Miller 59ca987233 refactor metadata.py to use productmd's compose.dump for composeinfo
instead of pungi compose_to_composeinfo
2015-06-06 13:45:48 -05:00
Dennis Gilmore 771ed2efcb fixup productmd imports for changes with open sourcing
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2015-04-24 17:55:56 -05:00
Dennis Gilmore d337c34b2a fix up the productmd imports to import the function from the common module
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2015-03-14 12:21:27 -05:00
Dennis Gilmore 07e90f0f96 change pypungi imports to pungi 2015-03-12 16:12:38 -05:00
Daniel Mach f116d9384f Initial code merge for Pungi 4.0. 2015-02-10 08:19:34 -05:00