From 0a1c70f3904dca98566fb24ae6899e6aeb6fcb13 Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Tue, 4 Jun 2013 14:07:07 +0200 Subject: [PATCH] repomd: Reverse order of distro tags (FIFO instead of LIFO). --- src/repomd.c | 4 ++-- tests/python/tests/test_repomd.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/repomd.c b/src/repomd.c index 7e2635d..882fd0a 100644 --- a/src/repomd.c +++ b/src/repomd.c @@ -768,8 +768,8 @@ cr_repomd_add_distro_tag(cr_Repomd *repomd, distro = cr_distrotag_new(); distro->cpeid = cr_safe_string_chunk_insert(repomd->chunk, cpeid); distro->val = cr_safe_string_chunk_insert(repomd->chunk, tag); - repomd->distro_tags = g_slist_prepend(repomd->distro_tags, - (gpointer) distro); + repomd->distro_tags = g_slist_append(repomd->distro_tags, + (gpointer) distro); } void diff --git a/tests/python/tests/test_repomd.py b/tests/python/tests/test_repomd.py index bceb5a9..95aa397 100644 --- a/tests/python/tests/test_repomd.py +++ b/tests/python/tests/test_repomd.py @@ -52,9 +52,9 @@ class TestCaseRepomd(unittest.TestCase): md.add_distro_tag("tag2", "cpeid1") md.add_distro_tag("tag3", cpeid="cpeid2") self.assertEqual(md.distro_tags, - [('cpeid2', 'tag3'), + [(None, 'tag1'), ('cpeid1', 'tag2'), - (None, 'tag1')]) + ('cpeid2', 'tag3')]) self.assertEqual(md.repo_tags, []) md.add_repo_tag("repotag") @@ -74,9 +74,9 @@ class TestCaseRepomd(unittest.TestCase): contenttag repotag - tag3 - tag2 tag1 + tag2 + tag3 """) @@ -96,9 +96,9 @@ class TestCaseRepomd(unittest.TestCase): contenttag repotag - tag3 - tag2 tag1 + tag2 + tag3 dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9 -- 2.7.4