fedabipkgdiff refuses to compare packages with the same release number

I tried to run:

    fedabipkgdiff vte291-0.39.1-1.fc22.x86_64 vte291-0.39.90-1.fc22.x86_64

And it wouldn't work :-(

The program considers the two packages as not being "peers".  This has
to do with the RPM.is_peer method which considers the two package as
not being "peers", just because they have the same release number
(1.fc22).

They should be considered peers, though, because they have the same
name but different {version, release} pairs.

This patch fixes the RPM.is_peer method and adds the aforementioned
packages to the regression test suite for good measure.

	* tools/fedabipkgdiff (RPM.is_peer): Update comment.  Fix logic.
	* tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-0.39.1-1.fc22.x86_64.rpm:
	New test input file.
	* tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-debuginfo-0.39.1-1.fc22.x86_64.rpm: Likewise.
	* tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-devel-0.39.1-1.fc22.x86_64.rpm: Likewise.
	* tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-0.39.90-1.fc22.x86_64.rpm: Likewise.
	* tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-debuginfo-0.39.90-1.fc22.x86_64.rpm: Likewise.
	* tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-devel-0.39.90-1.fc22.x86_64.rpm:
	Likewise.
	* tests/data/test-fedabipkgdiff/vte291-0.39.1-1.fc22.x86_64--vte291-0.39.90-1.fc22.x86_64-report-0.txt: Likewise.
	* tests/data/Makefile.am: Add the new test input data to source
	distribution.
	* tests/mockfedabipkgdiff.in: Update the package and build
	information to add the new vte291-0.39.1-1.fc22.x86_64.rpm and
	vte291-0.39.90-1.fc22.x86_64.rpm packages (as well as their devel
	and debuginfo packages) into the "mock" Koji build database.
	* tests/runtestfedabipkgdiff.py.in:  Make this test harness run
	over the two aforementioned packages.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2017-01-23 23:28:12 +01:00
parent 08b1ef7ae1
commit cac0cbb6d5
11 changed files with 90 additions and 3 deletions

View File

@ -1308,6 +1308,13 @@ test-fedabipkgdiff/packages/nss-util/3.12.6/1.fc14/x86_64/nss-util-debuginfo-3.1
test-fedabipkgdiff/packages/nss-util/3.24.0/2.0.fc25/x86_64/nss-util-debuginfo-3.24.0-2.0.fc25.x86_64.rpm \
test-fedabipkgdiff/packages/nss-util/3.24.0/2.0.fc25/x86_64/nss-util-devel-3.24.0-2.0.fc25.x86_64.rpm \
test-fedabipkgdiff/packages/nss-util/3.24.0/2.0.fc25/x86_64/nss-util-3.24.0-2.0.fc25.x86_64.rpm \
test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-0.39.1-1.fc22.x86_64.rpm \
test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-debuginfo-0.39.1-1.fc22.x86_64.rpm \
test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-devel-0.39.1-1.fc22.x86_64.rpm \
test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-0.39.90-1.fc22.x86_64.rpm \
test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-debuginfo-0.39.90-1.fc22.x86_64.rpm \
test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-devel-0.39.90-1.fc22.x86_64.rpm \
test-fedabipkgdiff/vte291-0.39.1-1.fc22.x86_64--vte291-0.39.90-1.fc22.x86_64-report-0.txt \
\
test-default-supprs/test0-type-suppr-0.suppr \
test-default-supprs/test0-type-suppr-report-0.txt \

View File

@ -0,0 +1,27 @@
Comparing the ABI of binaries between vte291-0.39.1-1.fc22.x86_64.rpm and vte291-0.39.90-1.fc22.x86_64.rpm:
================ changes of 'gnome-pty-helper'===============
Functions changes summary: 0 Removed, 0 Changed, 0 Added function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
Function symbols changes summary: 0 Removed, 0 Added function symbol not referenced by debug info
Variable symbols changes summary: 0 Removed, 1 Added variable symbol not referenced by debug info
1 Added variable symbol not referenced by debug info:
stderr
================ end of changes of 'gnome-pty-helper'===============
================ changes of 'libvte-2.91.so.0.3901.0'===============
Functions changes summary: 0 Removed, 0 Changed (81 filtered out), 3 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
3 Added functions:
'function const char* vte_get_features()' {vte_get_features}
'function const char* vte_terminal_get_word_char_exceptions(VteTerminal*)' {vte_terminal_get_word_char_exceptions}
'function void vte_terminal_set_word_char_exceptions(VteTerminal*, const char*)' {vte_terminal_set_word_char_exceptions}
================ end of changes of 'libvte-2.91.so.0.3901.0'===============

View File

@ -109,6 +109,7 @@ packages = [
{'id': 286, 'name': 'gnutls'},
{'id': 612, 'name': 'dbus-glib'},
{'id': 9041, 'name': 'nss-util'},
{'id': 18494, 'name': 'vte291'},
]
builds = [
@ -159,6 +160,16 @@ builds = [
'name': 'gnutls', 'release': '1.fc23', 'version': '3.4.2',
'package_id': 286, 'package_name': 'gnutls', 'state': 1,
},
# builds of package vte291
{'build_id': 600011, 'nvr': 'vte291-0.39.1-1.fc22',
'name': 'vte291', 'version': '0.39.1', 'release': '1.fc22',
'package_id': 18494, 'package_name': 'vte291', 'state': 1,
},
{'build_id': 612610, 'nvr': 'vte291-0.39.90-1.fc22',
'name': 'vte291', 'version': '0.39.90', 'release': '1.fc22',
'package_id': 18494, 'package_name': 'vte291', 'state': 1,
},
]
rpms = [
@ -239,7 +250,34 @@ rpms = [
'name': 'nss-util-devel', 'release': '2.0.fc25', 'version': '3.24.0',
'arch': 'x86_64', 'nvr': 'nss-util-devel-3.24.0-2.0.fc25',
},
]
# RPMs of build vte291-0.39.1-1.fc22
{'build_id': 600011,
'name': 'vte291', 'version': '0.39.1', 'release': '1.fc22',
'arch': 'x86_64', 'nvr': 'vte291-0.39.1-1.fc22',
},
{'build_id': 600011,
'name': 'vte291-devel', 'version': '0.39.1', 'release': '1.fc22',
'arch': 'x86_64', 'nvr': 'vte291-0.39.1-1.fc22',
},
{'build_id': 600011,
'name': 'vte291-debuginfo', 'version': '0.39.1', 'release': '1.fc22',
'arch': 'x86_64', 'nvr': 'vte291-0.39.1-1.fc22',
},
# RPMs of build vte291-0.39.90-1.fc22
{'build_id': 612610,
'name': 'vte291', 'version': '0.39.90', 'release': '1.fc22',
'arch': 'x86_64', 'nvr': 'vte291-0.39.90-1.fc22',
},
{'build_id': 612610,
'name': 'vte291-devel', 'version': '0.39.90', 'release': '1.fc22',
'arch': 'x86_64', 'nvr': 'vte291-0.39.90-1.fc22',
},
{'build_id': 612610,
'name': 'vte291-debuginfo', 'version': '0.39.90', 'release': '1.fc22',
'arch': 'x86_64', 'nvr': 'vte291-0.39.90-1.fc22',
},
]
# ----------------- End of Koji resource storage ------------------

View File

@ -73,6 +73,10 @@ FEDABIPKGDIFF_TEST_SPECS = [
'data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt',
'output/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt'),
(['vte291-0.39.1-1.fc22.x86_64', 'vte291-0.39.90-1.fc22.x86_64'],
'data/test-fedabipkgdiff/vte291-0.39.1-1.fc22.x86_64--vte291-0.39.90-1.fc22.x86_64-report-0.txt',
'output/test-fedabipkgdiff/vte291-0.39.1-1.fc22.x86_64--vte291-0.39.90-1.fc22.x86_64-report-0.txt'),
([os.path.join(INPUT_DIR, 'packages/dbus-glib/0.100.2/2.fc20/x86_64/dbus-glib-0.100.2-2.fc20.x86_64.rpm'),
os.path.join(INPUT_DIR, 'packages/dbus-glib/0.106/1.fc23/x86_64/dbus-glib-0.106-1.fc23.x86_64.rpm')],
'data/test-fedabipkgdiff/test4-glib-0.100.2-2.fc20.x86_64.rpm-glib-0.106-1.fc23.x86_64.rpm-report-0.txt',

View File

@ -258,10 +258,21 @@ class RPM(object):
raise AttributeError('No attribute name {0}'.format(name))
def is_peer(self, another_rpm):
"""Determine if this is the peer of a given rpm"""
"""Determine if this is the peer of a given rpm.
Here is what "peer" means.
Consider a package P for which the tripplet Name, Version,
Release is made of the values {N,V,R}. Then, consider a
package P' for which the similar tripplet is {N', V', R'}.
P' is a peer of P if N == N', and either V != V' or R != R'.
given package with a given NVR is another package with a N'V'
"""
return self.name == another_rpm.name and \
self.arch == another_rpm.arch and \
self.release != another_rpm.release
not (self.version == another_rpm.version
and self.release == another_rpm.release)
@property
def nvra(self):