Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modulemd-stream v3 #487

Merged
merged 1 commit into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
964 changes: 964 additions & 0 deletions modulemd/include/modulemd-2.0/modulemd-module-stream-v3.h

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions modulemd/include/modulemd-2.0/modulemd-module-stream.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of libmodulemd
* Copyright (C) 2018 Red Hat, Inc.
* Copyright (C) 2018-2020 Red Hat, Inc.
*
* Fedora-License-Identifier: MIT
* SPDX-2.0-License-Identifier: MIT
Expand Down Expand Up @@ -38,6 +38,8 @@ G_BEGIN_DECLS
* metadata format.
* @MD_MODULESTREAM_VERSION_TWO: Represents v2 of the #ModulemdModuleStream
* metadata format.
* @MD_MODULESTREAM_VERSION_THREE: Represents v3 of the #ModulemdModuleStream
* metadata format. Since: 2.10
* @MD_MODULESTREAM_VERSION_LATEST: Represents the highest-supported version of
* the #ModulemdModuleStream metadata format.
*
Expand All @@ -50,8 +52,9 @@ typedef enum

MD_MODULESTREAM_VERSION_ONE = 1,
MD_MODULESTREAM_VERSION_TWO = 2,
MD_MODULESTREAM_VERSION_THREE = 3,

MD_MODULESTREAM_VERSION_LATEST = MD_MODULESTREAM_VERSION_TWO
MD_MODULESTREAM_VERSION_LATEST = MD_MODULESTREAM_VERSION_THREE
} ModulemdModuleStreamVersionEnum;


Expand Down
3 changes: 2 additions & 1 deletion modulemd/include/modulemd-2.0/modulemd.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of libmodulemd
* Copyright (C) 2018 Red Hat, Inc.
* Copyright (C) 2018-2020 Red Hat, Inc.
*
* Fedora-License-Identifier: MIT
* SPDX-2.0-License-Identifier: MIT
Expand All @@ -27,6 +27,7 @@
#include "modulemd-module-index.h"
#include "modulemd-module-stream-v1.h"
#include "modulemd-module-stream-v2.h"
#include "modulemd-module-stream-v3.h"
#include "modulemd-module-stream.h"
#include "modulemd-module.h"
#include "modulemd-profile.h"
Expand Down
64 changes: 63 additions & 1 deletion modulemd/include/private/gi-binding-renames.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of libmodulemd
* Copyright (C) 2018 Red Hat, Inc.
* Copyright (C) 2018-2020 Red Hat, Inc.
*
* Fedora-License-Identifier: MIT
* SPDX-2.0-License-Identifier: MIT
Expand Down Expand Up @@ -246,6 +246,68 @@ GStrv
modulemd_module_stream_v2_get_servicelevel_names (
ModulemdModuleStreamV2 *self);

/**
* modulemd_module_stream_v3_get_module_component_names: (skip)
*/
GStrv
modulemd_module_stream_v3_get_module_component_names (
ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_rpm_component_names: (skip)
*/
GStrv
modulemd_module_stream_v3_get_rpm_component_names (
ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_content_licenses: (skip)
*/
GStrv
modulemd_module_stream_v3_get_content_licenses (ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_module_licenses: (skip)
*/
GStrv
modulemd_module_stream_v3_get_module_licenses (ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_profile_names: (skip)
*/
GStrv
modulemd_module_stream_v3_get_profile_names (ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_rpm_api: (skip)
*/
GStrv
modulemd_module_stream_v3_get_rpm_api (ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_rpm_artifacts: (skip)
*/
GStrv
modulemd_module_stream_v3_get_rpm_artifacts (ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_rpm_filters: (skip)
*/
GStrv
modulemd_module_stream_v3_get_rpm_filters (ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_buildtime_modules: (skip)
*/
GStrv
modulemd_module_stream_v3_get_buildtime_modules (ModulemdModuleStreamV3 *self);

/**
* modulemd_module_stream_v3_get_runtime_modules: (skip)
*/
GStrv
modulemd_module_stream_v3_get_runtime_modules (ModulemdModuleStreamV3 *self);

/**
* modulemd_profile_get_rpms: (skip)
*/
Expand Down
125 changes: 71 additions & 54 deletions modulemd/include/private/modulemd-module-stream-private.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of libmodulemd
* Copyright (C) 2017-2018 Stephen Gallagher
* Copyright (C) 2017-2020 Stephen Gallagher
*
* Fedora-License-Identifier: MIT
* SPDX-2.0-License-Identifier: MIT
Expand All @@ -18,6 +18,7 @@
#include "modulemd-translation.h"
#include "private/modulemd-module-stream-v1-private.h"
#include "private/modulemd-module-stream-v2-private.h"
#include "private/modulemd-module-stream-v3-private.h"
#include "private/modulemd-yaml.h"
#include <glib-object.h>

Expand Down Expand Up @@ -136,14 +137,16 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,
/* Some macros used for copy operations */
/**
* STREAM_UPGRADE_IF_SET_FULL:
* @oldversion: The stream version of @src. Must be literal "v1" or "v2"
* @oldversion: The stream version of @src. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @newversion: The stream version of @dest. Must be literal "v1" or "v2"
* @newversion: The stream version of @dest. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @dest: (out): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object
* that is the destination to which @property is to be copied.
* @src: (in): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object that
* is the source from which @property is to be copied.
* @dest: (out): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the destination to which @property is
* to be copied.
* @src: (in): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the source from which @property is to
* be copied.
* @property: The name of the property to copy. Must be the literal property
* name, in lower case, without quotes.
* @locale...: (in): An optional locale that can be provided when @property has
Expand All @@ -155,8 +158,8 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,
* which should be used instead.
*
* This is a helper macro to simplify the coding when copying/upgrading
* properties between #ModulemdModuleStreamV1 and #ModulemdModuleStreamV2
* objects.
* properties between #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, and
* #ModulemdModuleStreamV3 objects.
*
* Does nothing if the @src @property is NULL.
*
Expand All @@ -177,12 +180,14 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,

/**
* STREAM_COPY_IF_SET:
* @version: The stream version being copied. Must be literal "v1" or "v2"
* @version: The stream version being copied. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @dest: (out): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object
* that is the destination to which @property is to be copied.
* @src: (in): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object that
* is the source from which @property is to be copied.
* @dest: (out): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the destination to which @property is
* to be copied.
* @src: (in): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the source from which @property is to
* be copied.
* @property: The name of the property to copy. Must be the literal property
* name, in lower case, without quotes.
*
Expand All @@ -199,20 +204,22 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,

/**
* STREAM_UPGRADE_IF_SET:
* @oldversion: The stream version of @src. Must be literal "v1" or "v2"
* @oldversion: The stream version of @src. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @newversion: The stream version of @dest. Must be literal "v1" or "v2"
* @newversion: The stream version of @dest. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @dest: (out): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object
* that is the destination to which @property is to be copied.
* @src: (in): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object that
* is the source from which @property is to be copied.
* @dest: (out): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the destination to which @property is
* to be copied.
* @src: (in): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the source from which @property is to
* be copied.
* @property: The name of the property to copy. Must be the literal property
* name, in lower case, without quotes.
*
* This is a convenience macro to simplify the coding when copying properties
* between #ModulemdModuleStreamV1 and #ModulemdModuleStreamV2 objects when
* @src and @dest are different versions.
* between #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, and
* #ModulemdModuleStreamV3 objects when @src and @dest are different versions.
*
* Does nothing if the @src @property is NULL.
*
Expand All @@ -223,20 +230,22 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,

/**
* STREAM_COPY_IF_SET_WITH_LOCALE:
* @version: The stream version being copied. Must be literal "v1" or "v2"
* @version: The stream version being copied. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @dest: (out): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object
* that is the destination to which @property is to be copied.
* @src: (in): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object that
* is the source from which @property is to be copied.
* @dest: (out): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the destination to which @property is
* to be copied.
* @src: (in): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the source from which @property is to
* be copied.
* @property: The name of the property to copy. Must be the literal property
* name, in lower case, without quotes.
*
* This is a convenience macro to simplify the coding when copying properties
* between #ModulemdModuleStreamV1 and #ModulemdModuleStreamV2 objects when
* both @src and @dest are the same version and @property has possible
* translations. Only the untranslated (`"C"` locale) version of @property will
* be copied.
* between #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, and
* #ModulemdModuleStreamV3 objects when both @src and @dest are the same version
* and @property has possible translations. Only the untranslated (`"C"` locale)
* version of @property will be copied.
*
* Does nothing if the @src @property is NULL.
*
Expand All @@ -247,22 +256,24 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,

/**
* STREAM_UPGRADE_IF_SET_WITH_LOCALE:
* @oldversion: The stream version of @src. Must be literal "v1" or "v2"
* @oldversion: The stream version of @src. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @newversion: The stream version of @dest. Must be literal "v1" or "v2"
* @newversion: The stream version of @dest. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @dest: (out): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object
* that is the destination to which @property is to be copied.
* @src: (in): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object that
* is the source from which @property is to be copied.
* @dest: (out): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the destination to which @property is
* to be copied.
* @src: (in): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the source from which @property is to
* be copied.
* @property: The name of the property to copy. Must be the literal property
* name, in lower case, without quotes.
*
* This is a convenience macro to simply the coding when copying properties
* between #ModulemdModuleStreamV1 and #ModulemdModuleStreamV2 objects when
* @src and @dest are different versions and @property has possible
* translations. Only the untranslated (`"C"` locale) version of @property will
* be copied.
* between #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, and
* #ModulemdModuleStreamV3 objects when @src and @dest are different versions
* and @property has possible translations. Only the untranslated (`"C"` locale)
* version of @property will be copied.
*
* Does nothing if the @src @property is NULL.
*
Expand All @@ -274,18 +285,21 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,

/**
* STREAM_REPLACE_HASHTABLE:
* @version: The stream version being replaced. Must be literal "v1" or "v2"
* @version: The stream version being replaced. Must be literal "v1", "v2", or "v3"
* without the quotes.
* @dest: (out): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object
* that is the destination at which @property is being replaced.
* @src: (in): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object that
* is the source from which @property is being replaced.
* @dest: (out): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the destination at which @property is
* being replaced.
* @src: (in): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the source from which @property is
* being replaced.
* @property: The name of the #GHashTable property to replace. Must be the
* literal property name, in lower case, without quotes.
*
* This is a convenience macro to simply the coding when replacing #GHashTable
* properties of #ModulemdModuleStreamV1 and #ModulemdModuleStreamV2 objects
* when both @src and @dest are the same version.
* properties of #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, and
* #ModulemdModuleStreamV3 objects when both @src and @dest are the same
* version.
*
* Since: 2.0
*/
Expand All @@ -299,18 +313,21 @@ modulemd_module_stream_validate_component_rpm_arches (GHashTable *components,

/**
* COPY_HASHTABLE_BY_VALUE_ADDER:
* @dest: (out): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object
* that is the destination to which @property is to be copied.
* @src: (in): A #ModulemdModuleStreamV1 or #ModulemdModuleStreamV2 object that
* is the source from which @property is to be copied.
* @dest: (out): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the destination to which @property is
* to be copied.
* @src: (in): A #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, or
* #ModulemdModuleStreamV3 object that is the source from which @property is to
* be copied.
* @property: The name of the #GHashTable property to copy. Must be the literal
* property name, in lower case, without quotes.
* @adder: (in): A pointer to a method of @dest that supports add-on property
* values.
*
* This is a convenience macro to simply the coding when copying #GHashTable
* properties between #ModulemdModuleStreamV1 and #ModulemdModuleStreamV2
* objects when the property is set by using add-on values.
* properties between #ModulemdModuleStreamV1, #ModulemdModuleStreamV2, and
* #ModulemdModuleStreamV3 objects when the property is set by using add-on
* values.
*
* Since: 2.0
*/
Expand Down
Loading