It turns out that when we disable fedabipkgdiff, we also disable
detection of python and the setting of the proper environment
variables that are expected by some makefiles down the road. The
leads to the runtestdefaultsupprs.py test to be blocked at runtime
because the environement variable PYTHON is not defined. This patch
fixes that.
* configure.ac: Detect the presence and version of python even
when fedabipkgdiff is disabled.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
If no python2 interpreter is found and only a python3 one is found,
then use that one rather than just bailing.
* configure.ac: When no python2 is found and only python3 is
found, then use python3.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* configure.ac: Make the PYTHON environemnt variable usable in
auto-generated files.
* tests/runtestdefaultsupprs.py.in: Use the python interpreter
detected by configure.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When doing the Koji version tests at configure time, use the version
of the python interpreter that was selected by configure, not the one
first (randomly) found in the current PATH.
* configure.ac: Use the python interpreter that was selected by
the configure script for the Koji version test.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch makes fedabipkgdiff Python 3 compatible. All tests written
in Python are updated and compatible with Python 3 as well.
The patch looks for a Python 3 interperter. If it finds one then it
runs the tests using that interpreter. Otherwise it just tries to use
the Python 2 interpreter.
This behaviour can be disabled by the new --disable-python3 option.
* configure.ac: Add new option --enable-python3. Add new
test runner file tests/runtestdefaultsupprs-py3 and
tests/runtestfedabipkgdiffpy3.sh. Add required six Python module.
* tests/Makefile.am: Add new test files
tests/runtestdefaultsupprspy3.sh and
tests/runtestfedabipkgdiffpy3.sh accordingly.
* tests/mockfedabipkgdiff.in: Convert print statement to
six.print_. Replace call to function filter with list
comprehension. Replace basestring with six.string_types.
* tests/runtestdefaultsupprspy3.sh.in: New shell script to run
test runtestdefaultsupprs with Python 3.
* tests/runtestdefaultsupprs.py.in: Repalce a few tabs with
proper number of spaces which is detected by Python 3
interpreter.
* tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run
test runtestfedabipkgdiff with Python 3.
* tests/runtestfedabipkgdiff.py.in: Use python from env in
shebang instead of a fixed path to a Python interpreter.
* tools/fedabipkgdiff: Globally replace print statement with a
function call to print which is available by importing
print_function from __future__ module. Use six.print_ to output
string to stderr instead. Convert function call to map to
for-loop. (cmp_nvr): Change argument to handle a Koji build
mapping instead of only the nvr. (Brew.listBuilds): use the new
cmp_nvr to sort builds.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
If the rpm program is not installed, then we disable tests that
require it.
* configure.ac: Detect that the 'rpm' is present. Otherwise,
disable rpm support.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
The revision number of the version string is junk since 1.0. This
patch fixes that.
The patch also comes up with a function that returns a version string,
rather than having client code constructing the version string on
their own.
* configure.ac: Properly set the VERSION_REVISION macro.
* include/abg-tools-utils.h (get_library_version_string): Declare
new function.
* src/abg-tools-utils.cc (get_library_version_string): Define the
new function.
(gen_suppr_spec_from_kernel_abi_whitelist): Dis-ambiguate the use
of the 'config' type.
* tools/abicompat.cc (main): Use the new
abigail::tools_utils::get_library_version_string function.
* tools/abidiff.cc (main): Likewise.
* tools/abidw.cc (main): Likewise.
* tools/abilint.cc (main): Likewise.
* tools/abipkgdiff.cc (main): Likewise.
* tools/abisym.cc (main): Likewise.
* tools/kmidiff.cc (main): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
On some platforms, the koji client is so old that the koji object
doesn't have the .read_config method that we need.
Unfortunately, the koji client library module doesn't come with a
__version__ variable that carries its version number. So we cannot
use the version of the library. This patch thus tries to invoke the
koji.read_config method and see if it works. If it does, the koji
client is deemed recent enough. Otherwise the fedabipkgdiff feature
is disabled.
* configure.ac: Try to invoke the koji.read_config method. If it
fails then disable the fedabipkgdiff feature.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
On some 32 systems (older glibc) the fts.h file cannot be included
"as-is" if the _FILE_OFFSET_BITS macro is set to 64.
This patch handles that case gently by including fts.h with
_FILE_OFFSET_BITS unset, but then by making sure fts.h can still
handle 64 bits file offset files.
* configure.ac: Detect if we are on a system where fts.h cannot be
included with _FILE_OFFSET_BITS defined. If that is the case,
then define the BAD_FTS macro.
* src/abg-tools-utils.cc: If BAD_FTS is defined then include fts.h
with _FILE_OFFSET_BITS not defined (that is, before config.h) but
then make sure that open and fopen are 64 bits aware.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Cache data, currently containing downloaded RPM packages from Koji, is
stored in XDG_CACHE_HOME. This patch allows user to delete cache before
or after the ABI comparison, or both.
* configure.ac: Require shutil module.
* doc/manuals/fedabipkgdiff.rst: Add document for new option
clean-cache, clean-cache-before, and clean-cache-after.
* tools/fedabipkgdiff (build_commandline_args_parser): Add new
option --clean-cache, --clean-cache-before and
--clean-cache-after.
(diff_local_rpm_with_latest_rpm_from_koji): Delete download
cache directory before or after downloading RPMs.
(diff_latest_rpms_based_on_distros): Likewise.
(diff_two_nvras_from_koji): Likewise.
(diff_from_two_rpm_files): Likewise.
* bash-completion/fedabipkgdiff: Add new options.
* tests/mockfedabipkgdiff.in (get_download_dir): Rewrite to
behave just like the original get_download_dir.
(mock_get_download_dir): Removed.
(DOWNLOAD_CACHE_DIR): New global variable pointing directory
holding packages during tests.
(run_fedabipkgdiff): Mock original get_download_dir with the
rewrite get_download_dir.
* tests/runtestfedabipkgdiff.py.in (run_fedabipkgdiff_tests):
Add --clean-cache to run tests to ensure no regression.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
If a user has explicitly specified --enable-rpm when running
"configure", it will now fail unless both rpm2cpio and cpio
are present on the system.
* configure.ac: Check if both rpm2cpio and cpio
exist on the system. If not, disable the option and fail the
configuration if --enable-rpm was specified explicitly.
Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
Bug 20270 is also fixed.
This patch allows developer to compare two local RPMs in form
fedabipkgdiff some/place/foo.rpm another/place/bar.rpm
But, network is still needed to talk with Koji.
This patch also introduces new terms for libabigail, that is the
subject, ancillary package, and comparison half. Subject represents a
package that is subject of the ABI comparison, a subject could be a RPM
and maybe it would be a DEB or some other kind of "package". A subject
may have several ancillary packages that are used to compare the
subject. Generally, a subject may have devel, debuginfo, or both.
* configure.ac: add dependent mimetype module.
* doc/manuals/fedabipkgdiff.rst: Update to add document for the
new use case of comparing two local RPMs.
* tests/data/Makefile.am: Include new RPMs for tests.
* tests/data/test-fedabipkgdiff/dbus-glib/dbus-glib-0.100.2-2.fc20.x86_64.rpm:
New RPM for running test.
* tests/data/test-fedabipkgdiff/dbus-glib/dbus-glib-0.106-1.fc23.x86_64.rpm:
Likewise.
* tests/data/test-fedabipkgdiff/nss-util/nss-util-3.12.6-1.fc14.x86_64.rpm:
Likewise.
* tests/data/test-fedabipkgdiff/nss-util/nss-util-3.24.0-2.0.fc25.x86_64.rpm:
Likewise.
* tests/data/test-fedabipkgdiff/nss-util/nss-util-devel-3.24.0-2.0.fc25.x86_64.rpm:
Likewise.
* tests/data/test-fedabipkgdiff/test4-glib-0.100.2-2.fc20.x86_64.rpm-glib-0.106-1.fc23.x86_64.rpm-report-0.txt:
Rename filename by adding .rpm extension.
* tests/data/test-fedabipkgdiff/test5-same-dir-dbus-glib-0.100.2-2.fc20.x86_64--dbus-glib-0.106-1.fc23.x86_64-report-0.txt:
New reference output for testing comparing local RPMs.
* tests/data/test-fedabipkgdiff/test6-missing-devel-debuginfo-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt:
New reference output for testing comparison without non-existent
debuginfo or development package.
* tests/runtestfedabipkgdiff.py.in (FEDABIPKGDIFF_TEST_SPECS):
Rename filename for test4. Add two new test cases.
(run_fedabipkgdiff_tests): Remove semicolon and trailing
whitespaces.
(main): Likewise.
(ensure_output_dir_created): Likewise.
* tools/fedabipkgdiff: Require some new modules.
Fix of return code.
(PkgInfo): Renamed to ComparisonHalf.
(match_nvr): New method to determine if a string matches format
of N-V-R.
(match_nvra): New method to determine if a string matches format
of N-V-R.A.
(is_rpm_file): New method to guess if a file is a RPM file.
(RPM.is_peer): New method to determine if current RPM is a peer
of another.
(RPM.filename): Use Koji module API to construct the filename.
(RPM.nvra): Get nvra from filename instead of constructing
manually that is duplicated with Koji module API.
(RPMCollection): New class to represent a set of RPMs.
(generate_pkg_info_pair_for_abipkgdiff): New method working as a
generator to yeild comparison halves for running abipkgdiff.
(Brew.getRPM): Fix string format with incorrect argument.
(Brew.select_rpms_from_a_build): Return instance of
RPMCollection.
(abipkgdiff): If there is no debuginfo or development package,
just ignore it and leave a warning. If --error-on-warning is
specified, raise an exception instead. Arguments are modified
to represent the new name ComparisonHalf, and relative docstring
is also updated.
(magic_construct): Removed.
(run_abipkgdiff): Rewrite.
(make_rpms_usable_for_abipkgdiff): Removed.
(diff_local_rpm_with_latest_rpm_from_koji): Rewrite by using
RPMCollection.
(diff_latest_rpms_based_on_distros): Likewise.
(diff_two_nvras_from_koji): Likewise.
(diff_from_two_rpm_files): New method to compare two local RPMs.
(build_commandline_args_parser): Add new option
--error-on-warning.
(main): Add support to compare local RPMs.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When wget is missing building the fedabipkgdiff tool is disabled.
This patch fixes diagnostics in that case.
* configure.ac: When wget is missing then make the disabling of
the building of the fedabipkgdiff tool show up in the
configuration summary and emit a notice.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
There is a missing space around the "=" operator in the conditional
expression of the test below:
if test x$FOUND_DWARF_GETALT_IN_LIBDW=xyes; then
AC_DEFINE([LIBDW_HAS_DWARF_GETALT], 1,
[Defined if libdw has the function dwarf_getalt])
fi
This patch fixes that. Oops.
* configure.ac: Add missing spaces around the "=" of a conditional
expression.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Even when the configure script is executed without the
--enable-fedabipkgdiff switch, if one of the dependencies of
fedabipkgdiff is missing (e.g, python), it fails with a fatal error.
It should rather just disable fedabipkgdiff in that case.
This patch fixes this behaviour. It makes it so that it's only when
the --enable-fedabipkgdiff switch provided that a missing dependency
results in a fatal hard error.
* configure.ac: It's only when --enable-fedabipkgdiff is provided
that a missing dependency of the fedabipkgdiff program results in
a fatal error. Otherwise, building fedabipkgdiff is just
disabled.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Symbols of pretty much all member functions of types that are meant to
be "private" to translation units that contribute to libabigail.so
were exported because we didn't do much to prevent that.
This patch starts controlling the set of symbols that are exported.
By default, symbols of any entity declared in a translation unit that
contributes to libabigail.so are hidden by default. Only symbols of
entities declared in public headers (headers in include/*.h) are
exported.
There are many ways to achieve that. This patch chooses to avoid
cluttering declarations of entities in the public header by adding
__attribute__((visibility="default")) to every declared type of
function in there.
Rather, the patch uses "#pragma GCC visibility push(default)" before
entities declared on those headers. By doing so, all those entities
have their symbol marked as "visible" by the compiler. Once the
header are #included, the #pragma GCC visibility pop" is used, so that
anything else has its symbol be hidden from that point on.
Note that for ease of maintenance the patch uses the macros
ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS rather
than using the pragma directive directly.
I believe this is a more elegant way of handling visibility, compared
to cluttering every single declaration in public headers with a
"__attribute__((visibility=("default")))" or with a macro which
expands to it.
This reduces the the set of symbols exported by libabigail.so from
20000+ to less than 5000.
* VISIBILITY: New documentation about this visiblity business.
* CONTRIBUTING: Update the "contributing guide" to refer to symbol
visibility issues.
* configure.ac: Define a variable VISIBILITY_FLAGS that is set to
the -fvisibility=hidden flag to pass to GCC, when its available.
* src/Makefile.am: Add VISIBILITY to source distribution. Also
add COMPILING and COMMIT-LOG-GUIDELINES that were missing.
* src/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding
the library.
* tests/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding
tests.
* tools/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding
tools.
* src/abg-comp-filter.cc: Enclose inclusion of public headers in
ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS to
export the symbols of entities declared in there.
* src/abg-comparison.cc: Likewise.
* src/abg-config.cc: Likewise.
* src/abg-corpus.cc: Likewise.
* src/abg-diff-utils.cc: Likewise.
* src/abg-dwarf-reader.cc: Likewise.
* src/abg-hash.cc: Likewise.
* src/abg-ini.cc: Likewise.
* src/abg-ir.cc: Likewise.
* src/abg-libxml-utils.cc: Likewise.
* src/abg-libzip-utils.cc: Likewise.
* src/abg-reader.cc: Likewise.
* src/abg-suppression.cc: Likewise.
* src/abg-tools-utils.cc: Likewise.
* src/abg-traverse.cc: Likewise.
* src/abg-viz-common.cc: Likewise.
* src/abg-viz-dot.cc: Likewise.
* src/abg-viz-svg.cc: Likewise.
* src/abg-workers.cc: Likewise.
* src/abg-writer.cc: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
While working on something else, I started to prepare the support for
visibility control in the library. This patch detects that we are
using a compiler that supports GCC's visibility control attributes and
defines macros ABG_HIDDEN, ABG_EXPORTED,
ABG_{BEGIN,END}_EXPORT_DECLARATIONS to control the visibility of
declarations accordingly. These are not yet used but using them
should now be easy.
* configure.ac: Detect compiler support for
__attribute__((visibility("hidden")) and define the
HAS_GCC_VISIBILITY_ATTRIBUTE macro accordingly. Update the
configuration report.
* src/abg-internal.h: New internal header file that defines macros
to be used in the source code to control declaration visibility.
* src/Makefile.am: Add abg-internal.h to source distribution. Add
src/ to the include search path.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
In the libabigail project, almost all the tests for the tools follow a
similar pattern. The test contains a set of input files to compare.
The result of the comparison is thus compared to a set of reference
comparison result.
This approach is already documented in the CONTRIBUTING file.
There are several interesting properties with this scheme. First, it
capture the behaviour of the tools, including what is shown to the
user.
Second, it eases the job of a hacker who wants to add a new test for a
new behaviour of a given tool. The user just has to provide:
1/ A new reference output of the new use case of the tool (that is easily
constructed by using the tool itself and saving its output) and add an
entry to array of entries that describe what to compare
2/ A new set of inputs to the tool
And voila.
Unfortunately, fedabipkgdiff tests don't follow this scheme. That
make them surprising to hackers who read the source code of the
existing tests, at very least. Also, the fedabipkgdiff tests were
only unit tests. They were not testing the tool as used by users in
general.
This patch makes the fedabipkgdiff tests follow the general approach
of the tests of the other Libabigail tools.
The patch first craetes a program names tests/mockfedabipkgdiff. It's
a wrapper around tools/fedabipkgdiff. It overloads the Koji client of
fedabipkgdiff with a fake Koji client that gets the Fedora packages
locally, from tests/data/test-fedabipkgdiff/packages. In other words,
mockfedabipkgdiff is fedabipkgdiff without going to the network.
I believe that in the future, tests/mockfedabipkgdiff should be killed
when fedabipkgdiff is able to cache a local description of a local
partial view of a Koji repository, along with the build packages that
were already downloaded.
That way, calling fedabipkgdiff twice with the same set of option
should make the tool perform correctly without going to the netword on
the second invocation. We should be able to save the local partial
view of the Koji repository under e.g,
tests/data/test-fedabipkgdiff/local-koji and tell fedabipkgdiff to use
that, instead of using the network. But we are not there yet. So for
now, I am using mockfedabipkgdiff.
Then, tests/runtestfedabipkdiff.py.in has been re-written to use
tests/mockfedabipkgdiff and to look like what is described in
CONTRIBUTING as far as how Libabigail tools' tests are organized:
mockfedabipkgdiff is called to perform a comparison. The result of
the comparison is then compared (using GNU diff) to a reference
comparison result file.
Please note that tests/runtestfedabipkdiff.py is relatively fast for
the moment. But when it contains much more tests and start becoming
slow, then we'll need to change the code to run several comparisons in
parallel, just like we do today in tests/test-diff-filter.cc. At that
point, I believe I'll just re-write this in C++, just like
tests/test-diff-filter.cc because that will allow us to have true
concurrent code based on the abigail:workers API. For now, I am
keeping this in Python also because I think that keeps Chenxiong happy
;-)
To be sure that fedabipkgdiff (and its underlying abipkgdiff) are
really comparing all the packages they are supposed to compare and
also all the binaries in those packages, I have added a new
--show-identical-binaries to abipkgdiff and fedabipkgdiff. That
option shows the name of the binaries (and packages) that are
compared, *even if* the ABI of those binaries are identical. Because
otherwise, today, if two binaries (or packages) have the same ABI,
nothing is displayed.
For instance, here is the result of comparing a package against
itself, using this new --show-identical-binaries options:
dodji@adjoa:patches$ ./tools/fedabipkgdiff --abipkgdiff ./build/tools/abipkgdiff --show-identical-binaries dbus-glib-0.80-3.fc12.x86_64.rpm dbus-glib-0.80-3.fc12.x86_64.rpm
Comparing the ABI of binaries between dbus-glib-0.80-3.fc12.x86_64.rpm and dbus-glib-0.80-3.fc12.x86_64.rpm:
================ changes of 'dbus-binding-tool'===============
No ABI change detected
================ end of changes of 'dbus-binding-tool'===============
================ changes of 'libdbus-glib-1.so.2.1.0'===============
No ABI change detected
================ end of changes of 'libdbus-glib-1.so.2.1.0'===============
dodji@adjoa:patches$
And here is what this command before that patch would do:
dodji@adjoa:patches$ ./tools/fedabipkgdiff --abipkgdiff ../master/build/tools/abipkgdiff dbus-glib-0.80-3.fc12.x86_64.rpm dbus-glib-0.80-3.fc12.x86_64.rpm
Comparing the ABI of binaries between dbus-glib-0.80-3.fc12.x86_64.rpm and dbus-glib-0.80-3.fc12.x86_64.rpm:
dodji@adjoa:patches$
The rest of the patch is mostly new test inputs material and the
necessary adjustments following all the changes above.
* configure.ac: Do not require Python dependencies itertools,
unittest and StringIO anymore as they are not used anymore.
Require new module tempfile now. Generate new executable script
tests/mockfedabipkgdiff from tests/mockfedabipkgdiff.in.
* doc/manuals/abipkgdiff.rst: Add doc for new option
--show-identical-binaries to abipkgdiff
* doc/manuals/fedabipkgdiff.rst: Add doc for new options
--show-identical-binaries to fedabipkgdiff.
* tools/abipkgdiff.cc (options::show_identical_binaries): New data
member.
(options::options): Initialize new data member.
(display_usage): Add a new help string for the new
--show-identical-binaries option.
(parse_command_line): Parse the newq --show-identical-binaries
command line switch.
(pthread_routine_compare): When the comparison of two binaries is
empty, if --show-identical-binaries was provided, then emit some
output saying the comparison did yield the empty set.
* tools/fedabipkgdiff (DEFAULT_ABIPKGDIFF): Store the default path
to abipkgdiff in this new global variable. Naming this default
path is useful because it can then be cleanly overloaded when
using mock.patch.
(build_path_to_abipkgdiff): Return the new DEFAULT_ABIPKGDIFF
global variable.
(cmd): Parse the new --show-identical-binaries command line
switch.
* tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt:
New reference output.
* tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt:
Likewise.
* tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt:
Likewise.
* tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt:
Likewise.
* tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt:
Likewise.
* tests/mockfedabipkgdiff.in: New uninstalled script template.
* tests/runtestfedabipkgdiff.py.in (counter)
(temp_file_or_dir_prefix, UtilsTest, RPMTest, LocalRPMTest)
(RunAbipkgdiffTest, GetPackageLatestBuildTest, DownloadRPMTest)
(BrewListRPMsTest, AssertionHelper, MockGlobalConfig)
(BUILT_ABIPKGDIFF, CompareABIFromCommandLineTest): Remove these
classes, global variables and functions.
(FEDABIPKGDIFF, TEST_SRC_DIR, TEST_BUILD_DIR, INPUT_DIR)
(OUTPUT_DIR, FEDABIPKGDIFF_TEST_SPECS): New global variables.
(ensure_output_dir_created, run_fedabipkgdiff_tests, main): New
functions.
* tests/test-diff-pkg.cc (in_out_specs): Add
tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt
to the set of reference outputs to consider.
* tests/Makefile.am: Add non-installed script mockfedabipkgdiff to
source distribution. Also added
tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt,
tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt,
tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt,
tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt
and
tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt
to source distribution.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
When sorting two packages by their {Name Value Release} triplet to
select the latest one, just doing a string comparison of the NVRs is
wrong. Take for example the packages foo-0.10-1.fc25 and
foo-0.2-1.fc25. A basic string comparison will result in the string
"foo-0.10-1.fc25" being less than "foo-0.2-1.fc25", and thus
foo-0.2-1.fc25 will be selected as the latest package. And that is
wrong, because the latest one is obviously foo-0.10-1.fc25.
So, after some research on this, I figured rpm.labelCompare is a
better choice to appropriately compare two NVRs.
Another reason why I chose rpm.labelCompare is because the latest
build in fedabipkgdiff means a build with the latest version.release
within a specific Fedora distribution such as fc23 or fc25.
* configure.ac: Add new dependency.
* tests/runtestfedabipkgdiff.py.in (builds): Add new builds for
running tests to test selecting latest build from a package.
(packages): Add new package gnutls.
(GetPackageLatestBuildTest.{test_get_latest_one,
test_cannot_find_a_latest_build_with_invalid_distro}): Use new
builds of package gnutls to run tests.
* tools/fedabipkgdiff (cmp_nvr): New function used to compare nvrs
by Python built-in function sorted.
(Brew.listBuilds): Use the new cmp_nvr function.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
After I tried to build libabigail on Debian, I realized the detection
of python modules wasn't that great. The koji module wasn't present
and yet the detection system tried to launch fedabipkgdiff regression
tests. Woops.
I was thinking about coming up with something easier to to update to
add new modules to check for anyway, so I just dived in. I came up
with a new autoconf macro of my own, AX_CHECK_PYTHON_MODULES, that
lets you check for the presence of several python modules at once.
This is more handy than having to call AX_PYTHON_MODULE for each
module we want to detect. This fixes the detection issue I found and
simplifies configure.ac.
* configure.ac: Include
autoconf-archive/ax_check_python_modules.m4 rather than
autoconf-archive/ax_python_module.m4. Use AX_CHECK_PYTHON_MODULES
rather than AX_PYTHON_MODULE.
* Makefile.am: Add the new file
autoconf-archive/ax_check_python_modules.m4 to source distribution
and remove the older autoconf-archive/ax_python_module.m4 one.
* autoconf-archive/ax_check_python_modules.m4: New file.
* autoconf-archive/ax_python_module.m4: Remove.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
A new test case class is introduced as integration tests, that is able to
test fedabipkgdiff ability against supported use cases and with other
command line options. Currently, integration tests only aim to ensure
whether expected comparison against rpms and binaries really happen.
* configure.ac: do not detect shutil module.
* tests/runtestfedabipkgdiff.py.in: do not import shutil
anymore.
(BUILT_ABIPKGDIFF): new global variable to reference the
abipkgdiff built from source code, as the new test case' tests
require this command directly rather than mocking the
global_config.
(test_data_dir): convert variable name to uppercase,
reference to the test data directory by absolute path instead of
relative path.
(TEST_TOPDIR): new global variable to use data directory as the
topdir passed to fedabpkgdiff to download rpms.
(TEST_DOWNLOAD_CACHE_DIR): new global variable referencing a
fake download cache directory for tests only.
(packages, builds, rpms): new global variables as a fake
storage holding packages, builds and rpms.
(AssertionHelper): new class helping to assert abipkgdiff
result easily.
(MockClientSession): new class to mock koji.ClientSession.
(MockGlobalConfig.abipkgdiff): set this option to global
variable BUILT_ABIPKGDIFF.
(MockKojiClientSessin): removed.
(mock_get_session): removed.
(GetPackageLatestBuildTest.{test_get_latest_one,
test_cannot_find_a_latest_build_with_invalid_distro,
test_cannot_find_a_latest_build_with_invalid_distro}): mock
koji.ClientSession with new class MockClientSession. Remove
invalid documentation from docstring. Use new package rather
than httpd.
(DownloadRPMTest.setUp): remove self.download_dir and use global
TEST_DOWNLOAD_CACHE_DIR.
(DownloadRPMTest.tearDown): do not remove download cache
directory.
(DownloadRPMTest.make_remote_file_url): do not omit positional
argument specifiers in string format.
(DownloadRPMTest.{test_succeed_to_download_a_rpm,
test_failed_to_download_a_rpm}): set fake download cache
directory to mocked get_download_dir in mock.patch decorator.
(BrewListRPMsTest.test_select_specific_rpms): use new
MockClientSession to mock koji.ClientSession. Rewrite test by
using the new package listed in global variable packages.
(RunAbipkgdiffWithDSOOnlyOptionTest.{test_abipkgdiff_with_dso_only,
test_abipkgdiff_without_dso_only}): set fake download cache
directory to mocked get_download_dir in mock.patch decorator.
(CompareABIFromCommandLineTest): new integration test case.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/
i686/dbus-glib-0.100.2-2.fc20.i686.rpm: new rpm for running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/
i686/dbus-glib-debuginfo-0.100.2-2.fc20.i686.rpm: new rpm for
running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/
i686/dbus-glib-devel-0.100.2-2.fc20.i686.rpm: new rpm for
running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/
x86_64/dbus-glib-0.100.2-2.fc20.x86_64.rpm: new rpm for running
tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/
x86_64/dbus-glib-debuginfo-0.100.2-2.fc20.x86_64.rpm: new rpm
for running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/
x86_64/dbus-glib-devel-0.100.2-2.fc20.x86_64.rpm: new rpm for
running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/
i686/dbus-glib-0.106-1.fc23.i686.rpm: new rpm for running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/
i686/dbus-glib-debuginfo-0.106-1.fc23.i686.rpm: new rpm for
running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/
i686/dbus-glib-devel-0.106-1.fc23.i686.rpm: new rpm for running
tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/
x86_64/dbus-glib-0.106-1.fc23.x86_64.rpm: new rpm for running
tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/
x86_64/dbus-glib-debuginfo-0.106-1.fc23.x86_64.rpm: new rpm for
running tests.
* tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/
x86_64/dbus-glib-devel-0.106-1.fc23.x86_64.rpm: new rpm for
running tests.
* tests/data/Makefile.am: add new rpms.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch adds support for loading system and user level suppression
specifications for libabigail tools.
At launch time, relevant libabigail tools (abidiff, abipkgdiff
fedabipkgdiff for now) read the default system suppression
specification file, if it's present, from a file which path is the
value of the environment variable
LIBABIGAIL_DEFAULT_SYSTEM_SUPPRESSION_FILE, if set, or from the file
$libdir/libabigail/default.abignore.
Then it reads the user system suppression specification file, if it's
present, from a file which path is the value of the environment
variable LIBABIGAIL_DEFAULT_USER_SUPPRESSION_FILE, if set, or from the
file $HOME/.abignore.
The content of the user system suppression file is merged with the
content of default system suppression file.
That content is also merged with the content of the suppression
specification files that might be provided by the --suppressions
command line option of the invoked tools.
The resulting set of all these suppression specifications is thus used
to filter the ABI change reports that are emitted.
abidiff, abipkgdiff and abipkgdiff gain a --no-default-suppression
option to avoid loading any of these default suppression specification
files.
The patch also installs a default.abignore file into $(pkglibdir).
Note that on x86_64, that directory is /usr/lib64/libabigail. Now we
just need to think about the content of that default.abignore file.
* doc/manuals/abidiff.rst: Document the default suppression
scheme, its interaction with the --supprs option and the new
--no-default option.
* doc/manuals/abipkgdiff.rst: Likewise.
* doc/manuals/fedabipkgdiff.rst: Likewise.
* configure.ac: Generate the tests/runtestdefaultsupprs.py file
from the new tests/runtestdefaultsupprs.py.in template.
* default.abignore: New file.
* Makefile.am: Add it to source distribution.
* src/Makefile.am: Define the ABIGAIL_ROOT_SYSTEM_LIBDIR
preprocessor macro that is set the value of the $libdir autotools
macro.
* include/abg-tools-utils.h: Update copyright years.
(get_system_libdir, get_default_system_suppression_file_path)
(get_default_user_suppression_file_path)
(load_default_system_suppressions)
(load_default_user_suppressions): Declare new functions
* src/abg-tools-utils.cc (get_system_libdir)
(get_default_system_suppression_file_path)
(get_default_user_suppression_file_path)
(load_default_system_suppressions)
(load_default_user_suppressions): Define new functions.
(is_regular_file): Amend this so that it return true for symlinks
to regular files too.
(is_dir): Amend this so that it returns true for symlinks to
directories too.
* tools/abidiff.cc (options::no_default_supprs): New data member.
(options::options): Initialize the new data member.
(display_usage): Display a new help string for the new
--no-default-suppression command line option.
(parse_command_line): Parse this new command line option.
(set_diff_context_from_opts): Load the default suppression
specifications, unless --no-default-suppression or --supprs was
provided.
* tools/abipkgdiff.cc (options::no_default_supprs): New data
member.
(options::options): Initialize the new data member.
(parse_command_line): Parse the new --no-default-suppression
command line option.
(main): Load the default suppression specifications, unless
--no-default-suppression or --supprs was provided.
* tools/fedabipkgdiff (abipkgdiff): Add --no-default-suppression
to the invocation of abipkgdiff if it was provided on the command
line.
(build_commandline_args_parser): Parse the new
--no-default-suppression command line option.
* tests/runtestdefaultsupprs.py.in: New test harness template.
* tests/Makefile.am: Add the new runtestdefaultsupprs.py to the
set of tests.
* tests/data/test-default-supprs/test0-type-suppr-0.suppr: New
test input.
* tests/data/test-default-supprs/test0-type-suppr-report-0.txt: Likewise.
* tests/data/test-default-supprs/test0-type-suppr-v0.o: Likewise.
* tests/data/test-default-supprs/test0-type-suppr-v1.o: Likewise.
* tests/data/test-default-supprs/dirpkg-1-dir-report-0.txt:
Likewise.
* tests/data/test-default-supprs/dirpkg-1-dir1: Likewise.
* tests/data/test-default-supprs/dirpkg-1-dir2: Likewise.
* tests/data/Makefile.am: Add new the new tests input above to
Makefile.am.
* tests/runtestcanonicalizetypes.sh.in: Pass
--no-default-suppression to abidiff invocations.
* tests/runtestdefaultsupprs.py.in: Likewise.
* tests/test-abidiff-exit.cc: Likewise.
* tests/test-diff-dwarf-abixml.cc: Likewise.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abidiff.cc: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
abipkgdiff supports --dso-only to compare only ABI of shared libraries
instead of all binaries. So, with adding this option to fedabipkgdiff,
its user is also able to let fedabipkgdiff compare ABI of shared
libraries, or not.
* tools/fedabipkgdiff: Do not import shlex anymore.
(ABIDIFF_OK, ABIDIFF_ERROR, ABIDIFF_USAGE_ERROR)
(ABIDIFF_ABI_CHANGE): New global constant variables.
(abipkgdiff): Pass the --dso-only option to the abipkgdiff command
line tool, if that option was passed to fedabipkgdiff. Build this
abipkgdiff command invocation from an array of strings, rather
than from formatting a string. This makes us get rid of the shlex
module. Fix typo in dry-run logged string. If there was an
internal error reported by abipkgdiff, report it to stderr.
(build_commandline_args_parser): Parse the --dso-only command line
option.
* tests/runtestfedabipkgdiff.py.in (fedabipkgdiff_mod): Fix a typo
in initializing this global variable.
(test_data_dir): New global variable, that is used to reference
tests/data/test-fedabipkgdiff/.
(RunAbipkgdiffTest.{test_all_success, test_partial_failure}): Fix
typo.
(Mockglobalconfig.{koji_topdir, dso_only}): New data members.
(GetPackageLatestBuildTest.{test_get_latest_one,
test_cannot_find_a_latest_build_with_invalid_distro,
test_succeed_to_download_a_rpm, test_failed_to_download_a_rpm}):
Fix typo.
(BrewListRPMsTest.test_select_specific_rpms): Fix typo.
(RunAbipkgdiffWithDSOOnlyOptionTest): New test case class.
* doc/manuals/fedabipkgdiff.rst: update document for this new
--dso-only option.
* tests/data/test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm:
New symbolic link to
test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm.
* tests/data/test-fedabipkgdiff/dbus-glib-0.80-3.fc12.x86_64.rpm:
New symbolic link to
test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm.
* tests/data/test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm:
New symbolic link to
test-diff-pkg/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm.
* tests/data/test-fedabipkgdiff/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm:
New symbolic link to
test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm.
* tests/data/Makefile.am: add tests/data/test-fedabipkgdiff so
that this data directory and all things within it can be included
in tarball.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
On recent elfutils where the libdw's function dwarf_getalt exists, we
don't need to try and find the alternate debug info file ourselves by
using the function dwfl_standard_find_debuginfo. Furthermore, when we
use that function on those recent elfutils versions, we leak the elf
resources allocated in the debug info resources; we also leak the file
descriptor to access the alternate debug info sections.
More generally, we also leak debug info handles used to access debug
info when using get_soname_of_elf_file and get_type_of_elf_file.
This patch plugs those leaks.
In the first case, if the function dwarf_getalt exists, the patch just
uses it to get the alternate debug info. Otherwise, the patch uses
the dwfl_standard_find_debuginfo function like we used to, but then it
tries hard to free the file descriptor and debuginfo memory of the
alternate debug info.
* configure.ac: Check the presence of dwarf_getalt in libdw. If
it's present, define the preprocessor macro
LIBDW_HAS_DWARF_GETALT. Update the autoconf configuration
summary.
* src/abg-dwarf-reader.cc: Add config.h.
(find_alt_debug_info_location): Factorize this out of ...
(find_alt_debug_info): ... this function. Use dwarf_getalt if
present, otherwise, keep using dwfl_standard_find_debuginfo. In
the later case, return the file descriptor opened to access the
alternate debug info, by parameter, so that the caller can fclose
it.
(read_context::alt_fd_): New data member.
(read_context::read_context): Initialize the new alt_fd_ data
member.
(read_context::load_debug_info): Store the file descriptor used to
access the alternate debug info into the new alt_fd_ data member.
(read_context::~read_context): New desctructor.
(get_soname_of_elf_file, get_type_of_elf_file): Free the elf
handle.
(read_context::load_debug_info): Be paranoid in making sure we
never override alt_dwarf_.
* tests/data/test-alt-dwarf-file/test0-report.txt: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch allows maintainers to run:
make -C <builddir>/tests check-valgrind
This runs the test suite under the Valgrind memory checker.
It also adds this target:
make -C <builddir>/tests check-valgrind-memcheck-recursive
It runs the memcheck tool on the tests so that programs forked by them
are memchecked too. This is to allow to memcheck the libabigail tools
that are forked by the individual tests.
* autoconf-archive/ax_valgrind_check.m4: Add new file. Copied it
from http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html.
* configure.ac: Include the new ax_valgrind_check.m4 file.
Initialize the valgrind checking on tests. Update the configure
status.
* tests/test-valgrind-suppressions.supp: New valgrind suppression
file to silence memcheck leak errors from python.
* tests/Makefile.am: Add test-valgrind-suppressions.supp to source
distribution. Add check-valgrind-memcheck-recursive target.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
fedabipkgdiff is a convenient way to compare the ABI of Fedora
packages easily.
The first version of fedabipkgdiff introduced by this patch lets users
perform operations like:
fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm
fedabipkgdiff --from fc23 --to fc24 foo
fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24
fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686
fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24
* autoconf-archive/ax_compare_version.m4: New file copied from the
autoconf-archive project.
* autoconf-archive/ax_prog_python_version.m4: Likewise.
* autoconf-archive/ax_python_module.m4: Likewise.
* Makefile.am: Add the new files above to the source distribution.
* configure.ac: Include the new m4 macros from the autoconf
archive. Add a new --enable-fedabipkgdiff option. Update the
report at the end of the configure process to show the status of
the fedabipkgdiff feature. Add check for prerequisite python
modules argparse, glob, logging, os, re, shlex, subprocess, sys,
itertools, urlparse, itertools, shutil, unittest, xdg, koji and
mock. These are necessary for the unit test of
fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the
build directory, from the tests/runtestfedabipkgdiff.py.in input
file.
* tools/Makefile.am: Include the fedabipkgdiff to the source
distribution and install it if the "fedabipkgdiff" feature is
enabled.
* tests/Makefile.am: Rename runtestfedabipkgdiff.sh into
runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in
autoconf template file in here.
* tests/runtestfedabipkgdiff.py.in: New unit test file.
* tools/fedabipkgdiff: New fedabipkgdiff tool.
* doc/manuals/fedabipkgdiff.rst: New manual.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch changed the revision number of the libabigail library to
make it reflect the fact that we are not in "release candidate" mode,
before the first 1.0 release. So the revision number is now "rc0".
The configuration manager has been updated to support version numbers
that are strings, so that it can supports things like "rc0".
Then, several libabigail tools have been modified to support the
--version option to display their version number.
* configure.ac: Set the version revision to "rc0".
* doc/manuals/abicompat.rst: Adjust manual for new --version
option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abilint.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-config.h (config::{m_format_minor, m_format_major}):
Make these be strings.
(config::{get,set}_format_minor_version_number): Make these return
strings.
(config::{get,set}_format_major_version_number): Make these return
or take strings.
(abigail_get_library_version): Make this take strings.
* src/abg-config.cc (config::config): Adjust.
(config::{get,set}_format_major_version_number): Make these return
or take strings.
(config::{get,set}_format_minor_version_number): Make these return
strings.
(abigail_get_library_version): Make this take strings.
* include/abg-version.h.in: Make the version variables be strings.
* src/abg-writer.cc (write_translation_unit): The version numbers
are now strings so adjust.
* tools/{abicompat,abidiff,abidw,abilint,abipkgdiff,abisym}.cc
(options::display_version): New data member.
(options::options): Initialize it.
(display_usage): Add documentation for new --version option.
(parse_command_line): Parse new --version option.
(main): Support --version.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch adds support for comparing the ABI of binaries contained in
a tar archive.
If the archive is compressed with gzip, bzip2, lzip, lzma or xz, then
abipkgdiff recognizes the usual relevant file extensions and lets the
GNU tar program handle the decompression.
If the archive is not compressed, abipkgdiff recognizes the UStar
(Uniform Standard Tape ARchive) format, even if the archive file name
doesn't end with the .tar extension, and lets the GNU tar program
handle the extraction. If the file ends up with the .tar extension
anyway (even if it's not in the UStar format, abipkgdiff lets the GNU
tar program handle its extraction.
* config.h.in (WITH_TAR): New configuration preprocessor macro.
* configure.ac: Add a new --enable-tar option. It's turned on
automatically if the tar program is found in the PATH. Adjust the
build configuration report to add the tar archive support.
* include/abg-tools-utils.h (string_ends_with): Declare new
function.
(enum file_type): Add a new FILE_TYPE_TAR enumerator.
* src/abg-tools-utils.cc (string_ends_with): Define new function.
(operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR
enumerator.
(guess_file_type): Detect UStar format file by reading its magic
number. Detect compressed tar files based on the file path
extension.
* tools/abipkgdiff.cc (extract_tar): Define new function.
(extract_package): Handle tar packages.
(main): Handle tar archives.
* tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR
enumerator.
* tools/abilint.cc (main): Likewise.
* tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New
test input tarballs.
* tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output
reference.
* tests/data/Makefile.am: Add the new test data file above to
source distribution.
* tests/test-diff-pkg.cc (in_out_specs): Add new tests cases.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
If at configure time the libabigail source tarball detects that
rpm2cpio and cpio are present then it enables the support for rpm
files. Users can explicitly enable or disable that support by passing
--enable-rpm or --disable-rpm to configure.
Similarly if it detects that dpkg is present at configure time then it
enables the support for deb files. Users can explicitly enable or
disable that support by passing --enable-deb or --disable-deb to
configure.
* config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros.
* configure.ac: Add --enable-{rpm,deb} switches. Check for
rpm2cpio and cpio programs, unless --disable-rpm was provided. If
they are found and if --enable-rpm=auto was provided, then
consider that --enable-rpm=yes was provided. In that case, set
the WITH_RPM macro to 1. Otherwise, undefine that macro.
Similarly, check for dpkg unless --disable-deb was provided. If
it's found and if --enable-deb=auto was provided, consider that
--enable-deb=yes was provided. In that case, set the WITH_DEB
macro to 1. Otherwise, undefine that macro. Define the
ENABLE_RPM and ENABLE_DEB conditional automake variables, if the
rpm resp. deb support is enabled. Emit a notice about the rpm and
deb features being enabled or not, at the end of the configure
process.
* tests/test-diff-pkg.cc: Include the config.h header.
(in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly,
guard deb tests by the WITH_DEB macro.
* tools/abipkgdiff.cc: Include the config.h header.
(extract_rpm): Guard this function definition with the WITH_RPM
macro.
(extract_deb): Guard this function definition with the WITH_DEB
macro.
(extract_package): Guard the handling of rpm packages with the
WITH_RPM macro and the handling of deb package with the WITH_DEB
macro. If a package not-support package format is encountered,
emit an appropriate error message and error out.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>