2015-07-16 09:05:04 +00:00
|
|
|
// -*- Mode: C++ -*-
|
|
|
|
//
|
|
|
|
// Copyright (C) 2013-2015 Red Hat, Inc.
|
|
|
|
//
|
|
|
|
// This file is part of the GNU Application Binary Interface Generic
|
|
|
|
// Analysis and Instrumentation Library (libabigail). This library is
|
|
|
|
// free software; you can redistribute it and/or modify it under the
|
|
|
|
// terms of the GNU Lesser General Public License as published by the
|
|
|
|
// Free Software Foundation; either version 3, or (at your option) any
|
|
|
|
// later version.
|
|
|
|
|
|
|
|
// This library is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Lesser Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this program; see the file COPYING-LGPLV3. If
|
|
|
|
// not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
// Author: Sinny Kumari
|
|
|
|
|
|
|
|
/// @file
|
|
|
|
///
|
|
|
|
/// This test harness program fetch ABI diff between ELF binaries present inside
|
|
|
|
/// input packages with optional debuginfo packages.
|
|
|
|
/// Resulting ABI diff report is compared with reference one.
|
|
|
|
///
|
|
|
|
/// The set of input files and reference reports to consider should be
|
|
|
|
/// present in the source distribution.
|
|
|
|
|
Make the support of RPM and DEB package formats conditional
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>
2015-08-14 10:49:57 +00:00
|
|
|
// For package configuration macros.
|
|
|
|
#include "config.h"
|
2015-07-16 09:05:04 +00:00
|
|
|
#include <cstring>
|
|
|
|
#include <string>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <iostream>
|
|
|
|
#include "test-utils.h"
|
|
|
|
#include "abg-tools-utils.h"
|
|
|
|
|
|
|
|
using std::string;
|
|
|
|
using std::cerr;
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
using abigail::tests::get_src_dir;
|
2015-07-16 09:05:04 +00:00
|
|
|
|
|
|
|
struct InOutSpec
|
|
|
|
{
|
|
|
|
const char* first_in_package_path;
|
|
|
|
const char* second_in_package_path;
|
2015-08-06 11:56:48 +00:00
|
|
|
const char* prog_options;
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
const char* suppression_path;
|
2015-07-16 09:05:04 +00:00
|
|
|
const char* first_in_debug_package_path;
|
|
|
|
const char* second_in_debug_package_path;
|
|
|
|
const char* ref_report_path;
|
|
|
|
const char* out_report_path;
|
|
|
|
};// end struct InOutSpec
|
|
|
|
|
|
|
|
static InOutSpec in_out_specs[] =
|
|
|
|
{
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
// dir1 contains a suppr spec - it should be ignored.
|
2015-08-22 09:44:08 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dirpkg-0-dir1",
|
|
|
|
"data/test-diff-pkg/dirpkg-0-dir2",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-08-22 09:44:08 +00:00
|
|
|
"data/test-diff-pkg/dirpkg-0-report-0.txt",
|
|
|
|
"output/test-diff-pkg/dirpkg-0-report-0.txt"
|
|
|
|
},
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
// dir2 contains a suppr spec - it should be recognized.
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dirpkg-1-dir1",
|
|
|
|
"data/test-diff-pkg/dirpkg-1-dir2",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/dirpkg-1-report-0.txt",
|
|
|
|
"output/test-diff-pkg/dirpkg-1-report-0.txt"
|
|
|
|
},
|
|
|
|
// dir2 contains a suppr spec but --no-abignore is specified,
|
|
|
|
// the file should be ignored.
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dirpkg-1-dir1",
|
|
|
|
"data/test-diff-pkg/dirpkg-1-dir2",
|
|
|
|
"--no-abignore",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/dirpkg-1-report-1.txt",
|
|
|
|
"output/test-diff-pkg/dirpkg-1-report-1.txt"
|
|
|
|
},
|
|
|
|
// dir2 contains several suppr spec files, ".abignore" and
|
|
|
|
// "dir.abignore", so the specs should be merged.
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dirpkg-2-dir1",
|
|
|
|
"data/test-diff-pkg/dirpkg-2-dir2",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/dirpkg-2-report-0.txt",
|
|
|
|
"output/test-diff-pkg/dirpkg-2-report-0.txt"
|
|
|
|
},
|
|
|
|
// dir2 contains a suppr spec file, ".abignore" and
|
|
|
|
// an additional suppr file is specified on the command line,
|
|
|
|
// so the specs should be merged.
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dirpkg-3-dir1",
|
|
|
|
"data/test-diff-pkg/dirpkg-3-dir2",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/dirpkg-3.suppr",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/dirpkg-3-report-0.txt",
|
|
|
|
"output/test-diff-pkg/dirpkg-3-report-0.txt"
|
|
|
|
},
|
|
|
|
// dir2 contains a suppr spec file, ".abignore", which should
|
|
|
|
// be ignored because of the program options and
|
|
|
|
// an additional suppr file is specified on the command line,
|
|
|
|
// which should be recognized.
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dirpkg-3-dir1",
|
|
|
|
"data/test-diff-pkg/dirpkg-3-dir2",
|
|
|
|
"--no-abignore",
|
|
|
|
"data/test-diff-pkg/dirpkg-3.suppr",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/dirpkg-3-report-1.txt",
|
|
|
|
"output/test-diff-pkg/dirpkg-3-report-1.txt"
|
|
|
|
},
|
Make abipkgdiff compare tar archives containing binaries
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>
2015-08-22 11:59:18 +00:00
|
|
|
|
|
|
|
#if WITH_TAR
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir1.tar",
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir2.tar",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
Make abipkgdiff compare tar archives containing binaries
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>
2015-08-22 11:59:18 +00:00
|
|
|
"data/test-diff-pkg/tarpkg-0-report-0.txt",
|
|
|
|
"output/test-diff-pkg/tarpkg-0-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir1.ta",
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir2.ta",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
Make abipkgdiff compare tar archives containing binaries
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>
2015-08-22 11:59:18 +00:00
|
|
|
"data/test-diff-pkg/tarpkg-0-report-0.txt",
|
|
|
|
"output/test-diff-pkg/tarpkg-0-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir1.tar.gz",
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir2.tar.gz",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
Make abipkgdiff compare tar archives containing binaries
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>
2015-08-22 11:59:18 +00:00
|
|
|
"data/test-diff-pkg/tarpkg-0-report-0.txt",
|
|
|
|
"output/test-diff-pkg/tarpkg-0-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir1.tar.bz2",
|
|
|
|
"data/test-diff-pkg/tarpkg-0-dir2.tar.bz2",
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
Make abipkgdiff compare tar archives containing binaries
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>
2015-08-22 11:59:18 +00:00
|
|
|
"data/test-diff-pkg/tarpkg-0-report-0.txt",
|
|
|
|
"output/test-diff-pkg/tarpkg-0-report-0.txt"
|
|
|
|
},
|
|
|
|
#endif //WITH_TAR
|
|
|
|
|
Make the support of RPM and DEB package formats conditional
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>
2015-08-14 10:49:57 +00:00
|
|
|
#ifdef WITH_RPM
|
2015-07-16 09:05:04 +00:00
|
|
|
// Two RPM packages with debuginfo available and have ABI changes
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm",
|
2015-08-06 11:56:48 +00:00
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-07-16 09:05:04 +00:00
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/test-rpm-report-0.txt",
|
|
|
|
"output/test-diff-pkg/test-rpm-report-0.txt"
|
|
|
|
},
|
|
|
|
// Two RPM packages with 2nd package debuginfo missing
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm",
|
2015-08-06 11:56:48 +00:00
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-07-16 09:05:04 +00:00
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/test-rpm-report-1.txt",
|
|
|
|
"output/test-diff-pkg/test-rpm-report-1.txt"
|
|
|
|
},
|
2015-08-22 12:27:37 +00:00
|
|
|
|
2015-07-16 09:05:04 +00:00
|
|
|
// Two RPM packages with first package debuginfo missing
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm",
|
|
|
|
"",
|
2015-08-06 11:56:48 +00:00
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-07-16 09:05:04 +00:00
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/test-rpm-report-2.txt",
|
|
|
|
"output/test-diff-pkg/test-rpm-report-2.txt"
|
|
|
|
},
|
2015-08-22 12:27:37 +00:00
|
|
|
|
2015-07-16 09:05:04 +00:00
|
|
|
// Two RPM packages with missing debuginfo
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm",
|
|
|
|
"",
|
|
|
|
"",
|
2015-08-06 11:56:48 +00:00
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-07-16 09:05:04 +00:00
|
|
|
"data/test-diff-pkg/test-rpm-report-3.txt",
|
|
|
|
"output/test-diff-pkg/test-rpm-report-3.txt"
|
|
|
|
},
|
2015-08-22 12:27:37 +00:00
|
|
|
|
2015-07-16 09:05:04 +00:00
|
|
|
// Two RPM packages with no ABI change
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm",
|
2015-08-06 11:56:48 +00:00
|
|
|
"",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-07-16 09:05:04 +00:00
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/test-rpm-report-4.txt",
|
|
|
|
"output/test-diff-pkg/test-rpm-report-4.txt"
|
|
|
|
},
|
2015-08-06 11:56:48 +00:00
|
|
|
// Two RPM packages with debuginfo available and we don't want to
|
|
|
|
// see added symbols.
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm",
|
|
|
|
"--no-added-syms",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-08-06 11:56:48 +00:00
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm",
|
|
|
|
"data/test-diff-pkg/test-rpm-report-5.txt",
|
|
|
|
"output/test-diff-pkg/test-rpm-report-5.txt"
|
|
|
|
},
|
2015-11-12 12:44:59 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm",
|
|
|
|
"data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm",
|
|
|
|
"--no-added-syms",
|
|
|
|
"",
|
|
|
|
"data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm",
|
|
|
|
"data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm",
|
|
|
|
"data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt",
|
|
|
|
"output/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt"
|
|
|
|
},
|
Make the support of RPM and DEB package formats conditional
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>
2015-08-14 10:49:57 +00:00
|
|
|
#endif //WITH_RPM
|
|
|
|
|
|
|
|
#ifdef WITH_DEB
|
2015-08-07 08:48:17 +00:00
|
|
|
// Two debian packages.
|
|
|
|
{
|
|
|
|
"data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64.deb",
|
|
|
|
"data/test-diff-pkg/libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64.deb",
|
|
|
|
"--fail-no-dbg",
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
"",
|
2015-08-07 08:48:17 +00:00
|
|
|
"data/test-diff-pkg/libsigc++-2.0-0c2a-dbgsym_2.4.0-1_amd64.ddeb",
|
|
|
|
"data/test-diff-pkg/libsigc++-2.0-0v5-dbgsym_2.4.1-1ubuntu2_amd64.ddeb",
|
|
|
|
"data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt",
|
|
|
|
"output/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt"
|
|
|
|
},
|
Make the support of RPM and DEB package formats conditional
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>
2015-08-14 10:49:57 +00:00
|
|
|
#endif // WITH_DEB
|
2015-07-16 09:05:04 +00:00
|
|
|
// This should be the last entry.
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
{0, 0, 0, 0, 0, 0, 0, 0}
|
2015-07-16 09:05:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
using abigail::tests::get_build_dir;
|
|
|
|
using abigail::tools_utils::ensure_parent_dir_created;
|
|
|
|
|
|
|
|
bool is_ok = true;
|
|
|
|
string first_in_package_path, second_in_package_path,
|
2015-08-06 11:56:48 +00:00
|
|
|
prog_options,
|
2015-07-16 09:05:04 +00:00
|
|
|
ref_abi_diff_report_path, out_abi_diff_report_path, cmd, abipkgdiff,
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
first_in_debug_package_path, second_in_debug_package_path,
|
|
|
|
suppression_path;
|
2015-07-16 09:05:04 +00:00
|
|
|
for (InOutSpec *s = in_out_specs; s->first_in_package_path; ++s)
|
|
|
|
{
|
|
|
|
first_in_package_path =
|
|
|
|
get_src_dir() + "/tests/" + s->first_in_package_path;
|
|
|
|
second_in_package_path =
|
|
|
|
get_src_dir() + "/tests/" + s->second_in_package_path;
|
2015-08-06 11:56:48 +00:00
|
|
|
|
|
|
|
prog_options = s->prog_options;
|
|
|
|
|
2015-07-16 09:05:04 +00:00
|
|
|
if (s->first_in_debug_package_path
|
|
|
|
&& strcmp(s->first_in_debug_package_path, ""))
|
|
|
|
first_in_debug_package_path =
|
|
|
|
get_src_dir() + "/tests/" + s->first_in_debug_package_path;
|
|
|
|
else
|
|
|
|
first_in_debug_package_path.clear();
|
|
|
|
|
|
|
|
if (s->second_in_debug_package_path
|
|
|
|
&& strcmp(s->second_in_debug_package_path, ""))
|
|
|
|
second_in_debug_package_path =
|
|
|
|
get_src_dir() + "/tests/" + s->second_in_debug_package_path;
|
|
|
|
else
|
|
|
|
second_in_debug_package_path.clear();
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
|
|
|
|
if (s->suppression_path
|
|
|
|
&& strcmp(s->suppression_path, ""))
|
|
|
|
suppression_path =
|
|
|
|
get_src_dir() + "/tests/" + s->suppression_path;
|
|
|
|
else
|
|
|
|
suppression_path.clear();
|
|
|
|
|
2015-07-16 09:05:04 +00:00
|
|
|
ref_abi_diff_report_path = get_src_dir() + "/tests/" + s->ref_report_path;
|
|
|
|
out_abi_diff_report_path =
|
|
|
|
get_build_dir() + "/tests/" + s->out_report_path;
|
|
|
|
|
|
|
|
if (!ensure_parent_dir_created(out_abi_diff_report_path))
|
|
|
|
{
|
|
|
|
cerr << "could not create parent directory for "
|
|
|
|
<< out_abi_diff_report_path;
|
|
|
|
is_ok = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
abipkgdiff = get_build_dir() + "/tools/abipkgdiff";
|
2015-08-06 11:56:48 +00:00
|
|
|
|
|
|
|
if (!prog_options.empty())
|
|
|
|
abipkgdiff += " " + prog_options;
|
|
|
|
|
2015-07-16 09:05:04 +00:00
|
|
|
if (!first_in_debug_package_path.empty())
|
|
|
|
abipkgdiff += " --d1 " + first_in_debug_package_path;
|
|
|
|
if (!second_in_debug_package_path.empty())
|
|
|
|
abipkgdiff += " --d2 " + second_in_debug_package_path;
|
|
|
|
|
Bug 19082 - Recognize suppression spec files
When abipkgdiff is invoked on a set of packages, the newer (second) one is also
inspected for files matching the pattern '*.abignore', whose contents are read
and interpreted as suppression specifications.
* tests/data/Makefile.am: Add new test material to the build system.
* tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore:
A test suppression specification.
* tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise.
* tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New
binary test inputs.
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test
source files
* tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New
reference outputs
* tests/test-diff-pkg.cc: Adjust to run the new tests.
* tools/abipkgdiff.cc (prog_options): New static pointer to struct
opts.
(file_tree_walker_callback_fn): Rename to
first_package_tree_walker_callback_fn.
(second_package_tree_walker_callback_fn): Check for ELF files just
like the previous function but additionally check for files
ending with ".abignore", unless disabled from the command line.
({create_maps_of_package,extract_package_and_map_its}_content):
Add a callback as a new argument.
(main) handle the new "--no-abignore" option, which turns off
the search for suppression files within the new package.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-10-13 07:19:47 +00:00
|
|
|
if (!suppression_path.empty())
|
|
|
|
abipkgdiff += " --suppressions " + suppression_path;
|
|
|
|
|
2015-07-16 09:05:04 +00:00
|
|
|
cmd =
|
|
|
|
abipkgdiff + " " + first_in_package_path + " " + second_in_package_path;
|
|
|
|
cmd += " > " + out_abi_diff_report_path;
|
|
|
|
|
|
|
|
bool abipkgdiff_ok = true;
|
|
|
|
if (system(cmd.c_str()) & 255)
|
|
|
|
abipkgdiff_ok = false;
|
|
|
|
|
|
|
|
if (abipkgdiff_ok)
|
|
|
|
{
|
|
|
|
cmd = "diff -u " + ref_abi_diff_report_path + " "
|
|
|
|
+ out_abi_diff_report_path;
|
|
|
|
if (system(cmd.c_str()))
|
|
|
|
is_ok = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
is_ok = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
return !is_ok;
|
|
|
|
}
|