Modulemd.ModuleStream (Private)

Modulemd.ModuleStream (Private) — ModulemdModuleStream methods that should only be used by internal consumers.

Stability Level

Private, unless otherwise indicated

Functions

Description

Functions

modulemd_module_stream_set_module_name ()

void
modulemd_module_stream_set_module_name
                               (ModulemdModuleStream *self,
                                const gchar *module_name);

Parameters

self

This ModulemdModuleStream object.

[in]

module_name

The module name this object represents.

 

Since: 2.0


modulemd_module_stream_set_stream_name ()

void
modulemd_module_stream_set_stream_name
                               (ModulemdModuleStream *self,
                                const gchar *stream_name);

Parameters

self

This ModulemdModuleStream object.

[in]

stream_name

The stream name this object represents.

 

Since: 2.0


modulemd_module_stream_associate_translation ()

void
modulemd_module_stream_associate_translation
                               (ModulemdModuleStream *self,
                                ModulemdTranslation *translation);

Parameters

self

This ModulemdModuleStream object.

[in]

translation

The ModulemdTranslation information to associate with this object.

[in]

Since: 2.0


modulemd_module_stream_get_translation ()

ModulemdTranslation *
modulemd_module_stream_get_translation
                               (ModulemdModuleStream *self);

Parameters

self

This ModulemdModuleStream object.

[in]

Returns

The ModulemdTranslation information to associated with this object.

Since: 2.0


modulemd_module_stream_get_translation_entry ()

ModulemdTranslationEntry *
modulemd_module_stream_get_translation_entry
                               (ModulemdModuleStream *self,
                                const gchar *locale);

Parameters

self

This ModulemdModuleStream object.

[in]

locale

The locale of the translation to retrieve.

 

Returns

The module stream ModulemdTranslationEntry for the requested locale, or NULL if the locale was unknown.

[transfer none]

Since: 2.0


modulemd_module_stream_validate_components ()

gboolean
modulemd_module_stream_validate_components
                               (GHashTable *components,
                                GError **error);

Verifies that each of the ModulemdComponent objects in components validates correctly via modulemd_component_validate(), verifies that any buildafter components are also present in components , and verifies that buildorder and buildafter aren't mixed.

Parameters

components

A GHashTable of ModulemdComponent objects.

[in]

error

A GError that will return the reason for a validation error.

[out]

Returns

TRUE if the component objects passed validation. FALSE and sets error appropriately if validation fails.

Since: 2.0


modulemd_module_stream_validate_component_rpm_arches ()

gboolean
modulemd_module_stream_validate_component_rpm_arches
                               (GHashTable *components,
                                GStrv module_arches,
                                GError **error);

Verifies that for each of the ModulemdComponent RPM objects in components , any arches specified must be a subset of module_arches . If module_arches is empty, all arches are allowed.

Parameters

components

A GHashTable of ModulemdComponent objects.

[in]

module_arches

A GStrv list of arches for which to build the module.

[in]

error

A GError that will return the reason for a validation error.

[out]

Returns

TRUE if the component objects passed validation. FALSE and sets error appropriately if validation fails.

Since: 2.9


STREAM_UPGRADE_IF_SET_FULL()

#define             STREAM_UPGRADE_IF_SET_FULL(                                           \
              oldversion, newversion, dest, src, property, locale...)

DIRECT USE OF THIS MACRO SHOULD BE AVOIDED. This is the internal implementation for STREAM_COPY_IF_SET, STREAM_UPGRADE_IF_SET, STREAM_COPY_IF_SET_WITH_LOCALE, and STREAM_UPGRADE_IF_SET_WITH_LOCALE which should be used instead.

This is a helper macro to simplify the coding when copying/upgrading properties between ModulemdModuleStreamV1, ModulemdModuleStreamV2, and ModulemdModuleStreamV3 objects.

Does nothing if the src property is NULL.

Parameters

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", "v2", or "v3" without the quotes.

 

dest

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the destination to which property is to be copied.

[out]

src

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the source from which property is to be copied.

[in]

property

The name of the property to copy. Must be the literal property name, in lower case, without quotes.

 

locale...

An optional locale that can be provided when property has possible translations.

[in]

Since: 2.0


STREAM_COPY_IF_SET()

#define             STREAM_COPY_IF_SET(version, dest, src, property)

This is a convenience macro to simplify the coding when copying properties between ModulemdModuleStream objects when both src and dest are the same version.

Does nothing if the src property is NULL.

Parameters

version

The stream version being copied. Must be literal "v1", "v2", or "v3" without the quotes.

 

dest

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the destination to which property is to be copied.

[out]

src

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the source from which property is to be copied.

[in]

property

The name of the property to copy. Must be the literal property name, in lower case, without quotes.

 

Since: 2.0


STREAM_UPGRADE_IF_SET()

#define             STREAM_UPGRADE_IF_SET(oldversion, newversion, dest, src, property)

This is a convenience macro to simplify the coding when copying properties between ModulemdModuleStreamV1, ModulemdModuleStreamV2, and ModulemdModuleStreamV3 objects when src and dest are different versions.

Does nothing if the src property is NULL.

Parameters

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", "v2", or "v3" without the quotes.

 

dest

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the destination to which property is to be copied.

[out]

src

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the source from which property is to be copied.

[in]

property

The name of the property to copy. Must be the literal property name, in lower case, without quotes.

 

Since: 2.0


STREAM_COPY_IF_SET_WITH_LOCALE()

#define             STREAM_COPY_IF_SET_WITH_LOCALE(version, dest, src, property)

This is a convenience macro to simplify the coding when copying properties 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.

Parameters

version

The stream version being copied. Must be literal "v1", "v2", or "v3" without the quotes.

 

dest

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the destination to which property is to be copied.

[out]

src

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the source from which property is to be copied.

[in]

property

The name of the property to copy. Must be the literal property name, in lower case, without quotes.

 

Since: 2.0


STREAM_UPGRADE_IF_SET_WITH_LOCALE()

#define             STREAM_UPGRADE_IF_SET_WITH_LOCALE(                                    \
              oldversion, newversion, dest, src, property)

This is a convenience macro to simply the coding when copying properties 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.

Parameters

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", "v2", or "v3" without the quotes.

 

dest

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the destination to which property is to be copied.

[out]

src

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the source from which property is to be copied.

[in]

property

The name of the property to copy. Must be the literal property name, in lower case, without quotes.

 

Since: 2.0


STREAM_REPLACE_HASHTABLE()

#define             STREAM_REPLACE_HASHTABLE(version, dest, src, property)

This is a convenience macro to simply the coding when replacing GHashTable properties of ModulemdModuleStreamV1, ModulemdModuleStreamV2, and ModulemdModuleStreamV3 objects when both src and dest are the same version.

Parameters

version

The stream version being replaced. Must be literal "v1", "v2", or "v3" without the quotes.

 

dest

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the destination at which property is being replaced.

[out]

src

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the source from which property is being replaced.

[in]

property

The name of the GHashTable property to replace. Must be the literal property name, in lower case, without quotes.

 

Since: 2.0


COPY_HASHTABLE_BY_VALUE_ADDER()

#define             COPY_HASHTABLE_BY_VALUE_ADDER(dest, src, property, adder)

This is a convenience macro to simply the coding when copying GHashTable properties between ModulemdModuleStreamV1, ModulemdModuleStreamV2, and ModulemdModuleStreamV3 objects when the property is set by using add-on values.

Parameters

dest

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the destination to which property is to be copied.

[out]

src

A ModulemdModuleStreamV1, ModulemdModuleStreamV2, or ModulemdModuleStreamV3 object that is the source from which property is to be copied.

[in]

property

The name of the GHashTable property to copy. Must be the literal property name, in lower case, without quotes.

 

adder

A pointer to a method of dest that supports add-on property values.

[in]

Since: 2.0


modulemd_module_stream_emit_yaml_base ()

gboolean
modulemd_module_stream_emit_yaml_base (ModulemdModuleStream *self,
                                       yaml_emitter_t *emitter,
                                       GError **error);

Emit the common non-version specific YAML components for the Module Stream document.

Parameters

self

This ModulemdModuleStream object.

 

emitter

A libyaml emitter object positioned where a Module Stream document belongs in the YAML document.

[inout]

error

A GError that will return the reason for an emission or validation error.

[out]

Returns

TRUE if the ModulemdModuleStream components were emitted successfully. FALSE and sets error appropriately if the YAML could not be emitted.

Since: 2.0


modulemd_module_stream_includes_nevra ()

gboolean
modulemd_module_stream_includes_nevra (ModulemdModuleStream *self,
                                       const gchar *nevra_pattern);

Parameters

self

This ModulemdModuleStream object.

 

nevra_pattern

A glob pattern to match against the NEVRA strings of the rpm artifacts in self .

[not nullable]

Returns

TRUE if this stream includes at least one RPM artifact that matches nevra_pattern . FALSE otherwise.

Since: 2.9


modulemd_module_stream_expand_v2_to_v3_deps ()

GPtrArray *
modulemd_module_stream_expand_v2_to_v3_deps
                               (ModulemdModuleStreamV2 *v2_stream,
                                GError **error);

Stream V2 dependencies can be a list of ModulemdDependencies, each of which consists of a list of buildtime and runtime modules, each of which can have multiple streams specified. Stream V3 dependencies are much simpler compared to Stream V2, and have just a single list of buildtime modules and single list of runtime modules. Additionally, each dependent module in Stream V3 can specify only a single stream. Furthermore, Stream V2 dependencies treated "platform" the same as any other module dependency, while Stream V3 dependencies have "platform" as a seperate property.

This function takes the Stream V2 dependencies and expands them into a GPtrArray of ModulemdBuildConfig objects representing the flattened combinations of module:stream dependencies, explicitly extracting "platform" from the list of dependent modules and using it to set the seperate "platform" property.

Parameters

v2_stream

A pointer to a ModulemdModuleStreamV2 object that is to have its dependencies expanded.

[in]

error

A GError that will return the reason for an expansion error.

[out]

Returns

A GPtrArray of ModulemdBuildConfig objects containing the fully stream expanded version of v2_stream , else NULL if an error occurred and error will be set accordingly.

[transfer full]

Since: 2.10


modulemd_module_stream_upgrade_v2_to_v3_ext ()

ModulemdModule *
modulemd_module_stream_upgrade_v2_to_v3_ext
                               (ModulemdModuleStreamV2 *from,
                                GError **error);

This function takes v2_stream and maps it into one or more ModulemdModuleStreamV3 objects representing the flattened combinations of module:stream dependencies found in the ModulemdModuleStreamV2 object, along with explicitly setting the "platform" property. These ModulemdModuleStreamV3 objects are bundled together in a ModulemdModule object that is returned to the caller.

Parameters

from

A pointer to a ModulemdModuleStream object (must be ModulemdModuleStreamV2) that is to be upgraded to ModulemdModuleStreamV3.

[in]

error

A GError that will return the reason for an expansion error.

[out]

Returns

A ModulemdModule containing one or more StreamV3 objects, else NULL if an error occured and error will be set accordingly.

[transfer full]

Since: 2.10


modulemd_module_stream_set_autogen_module_name ()

void
modulemd_module_stream_set_autogen_module_name
                               (ModulemdModuleStream *self,
                                guint id);

If self already has a module name set, this function does nothing. Otherwise, a module name will be generated and set for self .

Parameters

self

A pointer to a ModulemdModuleStream object.

[in]

id

An unsigned integer to be used as a unique identifier if a module name is generated.

[in]

Since: 2.10


modulemd_module_stream_set_autogen_stream_name ()

void
modulemd_module_stream_set_autogen_stream_name
                               (ModulemdModuleStream *self,
                                guint id);

If self already has a stream name set, this function does nothing. Otherwise, a stream name will be generated and set for self .

Parameters

self

A pointer to a ModulemdModuleStream object.

[in]

id

An unsigned integer to be used as a unique identifier if a stream name is generated.

[in]

Since: 2.10


modulemd_module_stream_is_autogen_module_name ()

gboolean
modulemd_module_stream_is_autogen_module_name
                               (ModulemdModuleStream *self);

Parameters

self

A pointer to a ModulemdModuleStream object.

[in]

Returns

TRUE if self has a module name that matches the format used if modulemd_module_stream_set_autogen_module_name() created the name. Otherwise FALSE.

Since: 2.10


modulemd_module_stream_is_autogen_stream_name ()

gboolean
modulemd_module_stream_is_autogen_stream_name
                               (ModulemdModuleStream *self);

Parameters

self

A pointer to a ModulemdModuleStream object.

[in]

Returns

TRUE if self has a stream name that matches the format used if modulemd_module_stream_set_autogen_stream_name() created the name. Otherwise FALSE.

Since: 2.10


modulemd_module_stream_clear_autogen_module_name ()

void
modulemd_module_stream_clear_autogen_module_name
                               (ModulemdModuleStream *self);

Clears self 's module name if it matches the format used if modulemd_module_stream_set_autogen_module_name() created the name, else does nothing.

Parameters

self

A pointer to a ModulemdModuleStream object.

[in]

Since: 2.10


modulemd_module_stream_clear_autogen_stream_name ()

void
modulemd_module_stream_clear_autogen_stream_name
                               (ModulemdModuleStream *self);

Clears self 's stream name if it matches the format used if modulemd_module_stream_set_autogen_stream_name() created the name, else does nothing.

Parameters

self

A pointer to a ModulemdModuleStream object.

[in]

Since: 2.10


modulemd_module_stream_associate_upgrade_helper ()

void
modulemd_module_stream_associate_upgrade_helper
                               (ModulemdModuleStream *self,
                                ModulemdUpgradeHelper *upgrade_helper);

Associates a ModulemdUpgradeHelper, usually from a ModulemdModuleIndex, with this stream to help with upgrades between ModuleStreamV2 and ModuleStreamV3. This function will take a reference on the one passed in, so modifications to the upgrade_helper will affect subsequent changes to this ModulemdModuleStream.

Parameters

self

This ModulemdModuleStream object.

 

upgrade_helper

a ModulemdUpgradeHelper to associate with this module.

[in][transfer none]

Since: 2.10