diskimage-builder/diskimage_builder/elements/pkg-map
Neil Hanlon 398e07e6f2 Add new container element - Rocky Linux
Introduce new container image for Rocky Linux, a downstream clone of Red
Hat Enterprise Linux.

Keep non-voting in Check for a while before adding to any gate checks

Signed-off-by: Neil Hanlon <neil@shrug.pw>
Change-Id: Ib383f60bc23b434b400f85c376840a000cafc697
Related-Bug: https://review.opendev.org/805800/
2022-01-31 17:26:16 +00:00
..
bin Add new container element - Rocky Linux 2022-01-31 17:26:16 +00:00
extra-data.d Turn down pkg-map and hook copy tracing output 2018-10-18 11:03:17 +11:00
README.rst Introduce openEuler distro 2021-08-04 03:06:55 +00:00

=======
pkg-map
=======
Map package names to distro specific packages.

Provides the following:

 * bin/pkg-map::

    usage: pkg-map [-h] [--element ELEMENT] [--distro DISTRO]

    Translate package name to distro specific name.

    optional arguments:
      -h, --help         show this help message and exit
      --element ELEMENT  The element (namespace) to use for translation.
      --distro DISTRO    The distro name to use for translation. Defaults to
                         DISTRO_NAME
      --release RELEASE  The release to use for translation.  Defaults to
                         DIB_RELEASE

 * Any element may create its own pkg-map JSON config file using the
   one of 4 sections for the release/distro/family/ and or default.
   The family is set automatically within pkg-map based on the
   supplied distro name. Families include:

     + redhat: includes centos, fedora, openeuler and rhel distros
     + debian: includes debian and ubuntu distros
     + suse: includes the opensuse distro

   The release is a specification of distro; i.e. the distro and
   release must mach for a translation.

   The most specific section takes priority.

   An empty package list can be provided.

   Example for Nova and Glance (NOTE: using fictitious package names
   for Fedora and package mapping for suse family to provide a good
   example!)

   Example format::

    {
      "release": {
        "fedora": {
          "23": {
            "nova_package": "foo" "bar"
          }
        }
      },
      "distro": {
        "fedora": {
          "nova_package": "openstack-compute",
          "glance_package": "openstack-image"
        }
      },
      "family": {
        "redhat": {
          "nova_package": "openstack-nova",
          "glance_package": "openstack-glance"
        },
        "suse": {
          "nova_package": ""
        }
      },
      "default": {
        "nova_package": "nova",
        "glance_package": "glance"
      }
    }

   Example commands using this format:

   pkg-map --element nova-compute --distro fedora nova_package

   Returns: openstack-compute

   pkg-map --element nova-compute --distro rhel nova_package

   Returns: openstack-nova

   pkg-map --element nova-compute --distro ubuntu nova_package

   Returns: nova

   pkg-map --element nova-compute --distro opensuse nova_package

   Returns:

 * This output can be used to filter what other tools actually install
   (install-packages can be modified to use this for example)

 * Individual pkg-map files live within each element. For example
   if you are created an Apache element your pkg-map JSON file
   should be created at elements/apache/pkg-map.