Skip to content

Commit c2c6bfc

Browse files
committed
Add PackagerV3.get_mdversion()
Signed-off-by: Stephen Gallagher <[email protected]>
1 parent da93685 commit c2c6bfc

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

modulemd/include/modulemd-2.0/modulemd-packager-v3.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,18 @@ GVariant *
282282
modulemd_packager_v3_get_xmd (ModulemdPackagerV3 *self);
283283

284284

285+
/**
286+
* modulemd_packager_v3_get_mdversion:
287+
* @self: (in): This #ModulemdPackagerV3 object.
288+
*
289+
* Returns: The metadata version of this #ModulemdPackagerV3.
290+
*
291+
* Since: 2.11
292+
*/
293+
guint64
294+
modulemd_packager_v3_get_mdversion (ModulemdPackagerV3 *self);
295+
296+
285297
/**
286298
* modulemd_packager_v3_add_build_config:
287299
* @self: (in): This #ModulemdPackagerV3 object.

modulemd/modulemd-packager-v3.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,13 @@ modulemd_packager_v3_get_xmd (ModulemdPackagerV3 *self)
327327
}
328328

329329

330+
guint64
331+
modulemd_packager_v3_get_mdversion (ModulemdPackagerV3 *self)
332+
{
333+
return MD_PACKAGER_VERSION_THREE;
334+
}
335+
336+
330337
void
331338
modulemd_packager_v3_add_build_config (ModulemdPackagerV3 *self,
332339
ModulemdBuildConfig *buildconfig)

modulemd/tests/test-modulemd-packager-v3.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ packager_test_construct (void)
3636
g_assert_true (MODULEMD_IS_PACKAGER_V3 (packager));
3737

3838
/* == Verify that it was constructed properly empty == */
39+
g_assert_cmpuint (modulemd_packager_v3_get_mdversion (packager),
40+
==,
41+
MD_PACKAGER_VERSION_THREE);
3942

4043
g_assert_null (modulemd_packager_v3_get_module_name (packager));
4144
g_assert_null (modulemd_packager_v3_get_stream_name (packager));
@@ -623,8 +626,8 @@ packager_test_read_to_index (void)
623626
modulemd_subdocument_info_debug_dump_failures (failures);
624627
g_assert_cmpint (failures->len, ==, 1);
625628
g_assert_false (ret);
626-
g_assert_error (
627-
modulemd_subdocument_info_get_gerror (g_ptr_array_index (failures, 0)),
629+
g_assert_error (
630+
modulemd_subdocument_info_get_gerror (g_ptr_array_index (failures, 0)),
628631
MODULEMD_YAML_ERROR,
629632
MMD_YAML_ERROR_PARSE);
630633
g_clear_pointer (&yaml_path, g_free);

0 commit comments

Comments
 (0)