diff --git a/0001-checksums-Add-label-to-file-name.patch b/0001-checksums-Add-label-to-file-name.patch new file mode 100644 index 0000000..88f7406 --- /dev/null +++ b/0001-checksums-Add-label-to-file-name.patch @@ -0,0 +1,80 @@ +From 65c52c463dbc1f0ec665bf6e982c8b4914b63384 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Wed, 16 Mar 2016 08:33:43 +0100 +Subject: [PATCH] [checksums] Add label to file name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Lubomír Sedlář +--- + doc/configuration.rst | 2 +- + pungi/phases/image_checksum.py | 1 + + tests/helpers.py | 1 + + tests/test_imagechecksumphase.py | 5 +++-- + 4 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/doc/configuration.rst b/doc/configuration.rst +index 50734a3..025fd70 100644 +--- a/doc/configuration.rst ++++ b/doc/configuration.rst +@@ -954,7 +954,7 @@ Media Checksums Settings + It is possible to use format strings that will be replace by actual values. + The allowed keys are ``%(release_showrt)s``, ``%(release_short)s``, + ``%(release_id)s``, ``%(variant)s``, ``%(version)s``, ``%(date)s``, +- ``%(type_suffix)s`` and ``%(respin)s`` ++ ``%(type_suffix)s``, ``%(label)s`` and ``%(respin)s`` + + For example, for Fedora the prefix should be + ``%(release_short)s-%(variant)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s``. +diff --git a/pungi/phases/image_checksum.py b/pungi/phases/image_checksum.py +index 4c8735d..c9ef321 100644 +--- a/pungi/phases/image_checksum.py ++++ b/pungi/phases/image_checksum.py +@@ -80,6 +80,7 @@ class ImageChecksumPhase(PhaseBase): + 'date': self.compose.compose_date, + 'type_suffix': self.compose.compose_type_suffix, + 'respin': self.compose.compose_respin, ++ 'label': self.compose.compose_label, + } + base_checksum_name += '-' + return base_checksum_name +diff --git a/tests/helpers.py b/tests/helpers.py +index 602368e..cf4dbd3 100644 +--- a/tests/helpers.py ++++ b/tests/helpers.py +@@ -25,6 +25,7 @@ class DummyCompose(object): + self.compose_type_suffix = '.t' + self.compose_respin = 0 + self.compose_id = 'Test-20151203.0.t' ++ self.compose_label = None + self.ci_base = mock.Mock( + release_id='Test-1.0', + release=mock.Mock( +diff --git a/tests/test_imagechecksumphase.py b/tests/test_imagechecksumphase.py +index 50595bd..6e23595 100755 +--- a/tests/test_imagechecksumphase.py ++++ b/tests/test_imagechecksumphase.py +@@ -86,8 +86,9 @@ class TestImageChecksumPhase(PungiTestCase): + compose = DummyCompose(self.topdir, { + 'media_checksums': ['sha256'], + 'media_checksum_one_file': True, +- 'media_checksum_base_filename': '%(release_short)s-%(variant)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s' ++ 'media_checksum_base_filename': '%(release_short)s-%(variant)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s_%(label)s' + }) ++ compose.compose_label = 'Alpha-1.0' + + phase = ImageChecksumPhase(compose) + +@@ -98,7 +99,7 @@ class TestImageChecksumPhase(PungiTestCase): + + dump.assert_called_once_with(self.topdir + '/compose/Client/i386/iso', 'sha256', + {'image.iso': 'cafebabe'}, +- 'test-Client-1.0-20151203.t.0-CHECKSUM') ++ 'test-Client-1.0-20151203.t.0_Alpha-1.0-CHECKSUM') + cc.assert_called_once_with(self.topdir + '/compose/Client/i386/iso/image.iso', ['sha256']) + compose.image.add_checksum.assert_called_once_with(None, 'sha256', 'cafebabe') + +-- +2.5.0 + diff --git a/pungi.spec b/pungi.spec index 7cccd18..697b8bd 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0.10 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -8,6 +8,7 @@ License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 Patch0: 0001-image_build-fix-subvariant-handling.patch +Patch1: 0001-checksums-Add-label-to-file-name.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -44,6 +45,7 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %{__python} setup.py build @@ -68,6 +70,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Wed Mar 16 2016 Dennis Gilmore - 4.0.10-3 +- add patch to enable use of label in checksums + * Sun Mar 13 2016 Dennis Gilmore - 4.0.10-2 - add patch for bug in subvariant handling