pungi: Include noarch debuginfo

The check for arch compatibility should not be performed if the
debuginfo package is noarch. Such packages should be included
unconditionally.

Fixes: #450
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-11-07 14:43:04 +01:00
parent b7813d34ac
commit deb8623bd1
16 changed files with 103 additions and 38 deletions

View File

@ -1162,8 +1162,10 @@ class Pungi(PungiBase):
if po.sourcerpm not in self.sourcerpm_arch_map:
# TODO: print a warning / throw an error
continue
if not (set(self.compatible_arches[po.arch]) & set(self.sourcerpm_arch_map[po.sourcerpm]) - set(["noarch"])):
# skip all incompatible arches
if po.arch != 'noarch' and not (set(self.compatible_arches[po.arch]) &
set(self.sourcerpm_arch_map[po.sourcerpm]) -
set(["noarch"])):
# skip all incompatible arches unless it's a noarch debuginfo
# this pulls i386 debuginfo for a i686 package for example
continue
msg = 'Added debuginfo %s.%s (repo: %s)' % (po.name, po.arch, po.repoid)

View File

@ -0,0 +1,47 @@
Name: dummy-mingw-qt5-qtbase
Version: 5.6.0
Release: 1
License: LGPLv2
Summary: A dummy mingw qt5 qtbase package
%description
A dummy package with noarch debuginfo
%package -n dummy-mingw32-qt5-qtbase
Summary: A dummy mingw32-qt5-qtbase package
BuildArch: noarch
%description -n dummy-mingw32-qt5-qtbase
A dummy 32bit mingw-qt5-qtbase package
%package -n dummy-mingw32-qt5-qtbase-debuginfo
Summary: A dummy mingw32-qt5-qtbase package debuginfo
BuildArch: noarch
%description -n dummy-mingw32-qt5-qtbase-debuginfo
A dummy 32bit mingw-qt5-qtbase package debuginfo
#%prep
#%setup -q
%build
echo OK
%install
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files -n dummy-mingw32-qt5-qtbase
%files -n dummy-mingw32-qt5-qtbase-debuginfo
%changelog
* Mon Nov 7 2016 Lubomír Sedlář <lsedlar@redhat.com> - 5.6.0-1
- First release

View File

@ -1,68 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
<revision>1478525452</revision>
<revision>1478526049</revision>
<data type="primary">
<checksum type="sha256">443dade43e632f2bbb768b1768cb090175429b5e70823525c3a3f4d45b7984ed</checksum>
<open-checksum type="sha256">e60486cc17a922a5cfa3b0eeb6b02176d046bb81d4477806ccf76e49f2f619dd</open-checksum>
<location href="repodata/443dade43e632f2bbb768b1768cb090175429b5e70823525c3a3f4d45b7984ed-primary.xml.gz"/>
<timestamp>1478525452</timestamp>
<size>32219</size>
<open-size>442634</open-size>
<checksum type="sha256">94431f15fa198cae4d31bf81c9714060e413c909b95d19ff0f9e00750b373b77</checksum>
<open-checksum type="sha256">6f364ce3b49fbed06d4d4cc001680b14f4a7c43b9e105a82a3e77c9b3af95389</open-checksum>
<location href="repodata/94431f15fa198cae4d31bf81c9714060e413c909b95d19ff0f9e00750b373b77-primary.xml.gz"/>
<timestamp>1478526049</timestamp>
<size>32414</size>
<open-size>445535</open-size>
</data>
<data type="filelists">
<checksum type="sha256">05ecf05b96e9d055dc9e3df028b1af2cf6661af7bb082278d96eebe4bf0b9012</checksum>
<open-checksum type="sha256">2df95e0dc72d04e62064d15d3b95d3aac7c4f1733ebb67c16beab89345808ceb</open-checksum>
<location href="repodata/05ecf05b96e9d055dc9e3df028b1af2cf6661af7bb082278d96eebe4bf0b9012-filelists.xml.gz"/>
<timestamp>1478525452</timestamp>
<size>19701</size>
<open-size>73844</open-size>
<checksum type="sha256">4305042fb21c392795638a1c79ec4a83d00b9dbef8cd79b06a4c4f1cd2c47235</checksum>
<open-checksum type="sha256">7c5c4df0b7d944e5d9cff8d8297d132f111e782710d6a1d99b33389f664e52b0</open-checksum>
<location href="repodata/4305042fb21c392795638a1c79ec4a83d00b9dbef8cd79b06a4c4f1cd2c47235-filelists.xml.gz"/>
<timestamp>1478526049</timestamp>
<size>19949</size>
<open-size>74441</open-size>
</data>
<data type="other">
<checksum type="sha256">74a554f4a2c7392d9ef0cf6a07652d7a198a104a202584e71f57bc247a32f41b</checksum>
<open-checksum type="sha256">56bb0c634647446b741246930d55542b6ca50084008678ab441d5f4960d1eaea</open-checksum>
<location href="repodata/74a554f4a2c7392d9ef0cf6a07652d7a198a104a202584e71f57bc247a32f41b-other.xml.gz"/>
<timestamp>1478525452</timestamp>
<size>19712</size>
<open-size>117697</open-size>
<checksum type="sha256">76ebb27d2d8e584aee9ade778d0f4908a9675e15bcb61e12dc687b6a98c9a20c</checksum>
<open-checksum type="sha256">5aa769f272cdb4cdccc13f9e1dfa74f6b2551dd25589b8fed9872c72c1bb3fcb</open-checksum>
<location href="repodata/76ebb27d2d8e584aee9ade778d0f4908a9675e15bcb61e12dc687b6a98c9a20c-other.xml.gz"/>
<timestamp>1478526049</timestamp>
<size>19950</size>
<open-size>118659</open-size>
</data>
<data type="primary_db">
<checksum type="sha256">9249118941570779bf043a7a393f0308f891ac1d7fdd2dfe006d3caf69d26a6f</checksum>
<open-checksum type="sha256">c0ecdec1aeac2c4e1f32f97c04c703a438e139f4d9d9631a95e3fca5fec61e5c</open-checksum>
<location href="repodata/9249118941570779bf043a7a393f0308f891ac1d7fdd2dfe006d3caf69d26a6f-primary.sqlite.bz2"/>
<timestamp>1478525452</timestamp>
<size>57571</size>
<checksum type="sha256">0dff37e23a0af5dc33002460679b56b3b6af6ec9a36981c8377b44223724e549</checksum>
<open-checksum type="sha256">4e7b4ec0f5d7814815f340866726e08c3fcfd14d0ff3d72bac92b6d416e8a0a3</open-checksum>
<location href="repodata/0dff37e23a0af5dc33002460679b56b3b6af6ec9a36981c8377b44223724e549-primary.sqlite.bz2"/>
<timestamp>1478526049</timestamp>
<size>57779</size>
<open-size>368640</open-size>
<database_version>10</database_version>
</data>
<data type="filelists_db">
<checksum type="sha256">a5891b48313e9cd503e94e48c93a08b5160ce04f4fde2d1e32f21ef69f550141</checksum>
<open-checksum type="sha256">b8398ea076836772a553717e9abfcd6fec1cb7d69ad32c09094b4abf1345aa88</open-checksum>
<location href="repodata/a5891b48313e9cd503e94e48c93a08b5160ce04f4fde2d1e32f21ef69f550141-filelists.sqlite.bz2"/>
<timestamp>1478525452</timestamp>
<size>25706</size>
<checksum type="sha256">fa89c463e1653f2544468cec48512d57501b9a72c129b9faed2f353cf2e82a3b</checksum>
<open-checksum type="sha256">ae73ede0c0fedc9925a1075c4d777d80613011e29066f93675a67c2d64003d4c</open-checksum>
<location href="repodata/fa89c463e1653f2544468cec48512d57501b9a72c129b9faed2f353cf2e82a3b-filelists.sqlite.bz2"/>
<timestamp>1478526049</timestamp>
<size>25770</size>
<open-size>94208</open-size>
<database_version>10</database_version>
</data>
<data type="other_db">
<checksum type="sha256">129bcb220b766abd0d38b33f919af26b017c6ae086cf087ca00d183d97d57a06</checksum>
<open-checksum type="sha256">41a274ac1928cbd1b9126972b154826842af8781a6037fade0ca1bc57443d5d2</open-checksum>
<location href="repodata/129bcb220b766abd0d38b33f919af26b017c6ae086cf087ca00d183d97d57a06-other.sqlite.bz2"/>
<timestamp>1478525452</timestamp>
<size>29618</size>
<checksum type="sha256">fc348dcd0e073c1ff457bd72617a1ef8274a2b9b74a82167e299af57525223e7</checksum>
<open-checksum type="sha256">a7163e921e14be31ac532c3130c558eb3a12b282fc7b7c08dbf8d50c19f85dc0</open-checksum>
<location href="repodata/fc348dcd0e073c1ff457bd72617a1ef8274a2b9b74a82167e299af57525223e7-other.sqlite.bz2"/>
<timestamp>1478526049</timestamp>
<size>29797</size>
<open-size>122880</open-size>
<database_version>10</database_version>
</data>
<data type="group">
<checksum type="sha256">cd2e022a3f1163bed5dd38328a2c0bd7a8db1589a9e67b25c6341941914e1077</checksum>
<location href="repodata/cd2e022a3f1163bed5dd38328a2c0bd7a8db1589a9e67b25c6341941914e1077-dummy-comps.xml"/>
<timestamp>1478525452</timestamp>
<timestamp>1478526049</timestamp>
<size>5178</size>
</data>
<data type="group_gz">
<checksum type="sha256">2f8cc4b5cf852eca9838393db012ad4e494ccea437ffbbbf95e110a388e15f35</checksum>
<open-checksum type="sha256">cd2e022a3f1163bed5dd38328a2c0bd7a8db1589a9e67b25c6341941914e1077</open-checksum>
<location href="repodata/2f8cc4b5cf852eca9838393db012ad4e494ccea437ffbbbf95e110a388e15f35-dummy-comps.xml.gz"/>
<timestamp>1478525452</timestamp>
<timestamp>1478526049</timestamp>
<size>1244</size>
<open-size>5178</open-size>
</data>

View File

@ -1364,6 +1364,22 @@ class TestPungi(unittest.TestCase):
"dummy-glibc-debuginfo-common-2.14-5.x86_64.rpm",
])
def test_noarch_debuginfo(self):
packages = [
"dummy-mingw32-qt5-qtbase",
]
pkg_map = self.go(packages, None)
self.assertItemsEqual(pkg_map["rpm"], [
"dummy-mingw32-qt5-qtbase-5.6.0-1.noarch.rpm",
])
self.assertItemsEqual(pkg_map["srpm"], [
"dummy-mingw-qt5-qtbase-5.6.0-1.src.rpm",
])
self.assertItemsEqual(pkg_map["debuginfo"], [
"dummy-mingw32-qt5-qtbase-debuginfo-5.6.0-1.noarch.rpm",
])
if __name__ == "__main__":
unittest.main()