FILE_TYPE_SRPM,
/// An DEB (.deb) binary file
FILE_TYPE_DEB,
+ /// A plain directory
+ FILE_TYPE_DIR
};
/// Exit status for abidiff and abicompat tools.
case FILE_TYPE_DEB:
repr = "Debian binary file type";
break;
+ case FILE_TYPE_DIR:
+ repr = "Directory type";
+ break;
}
output << repr;
file_type
guess_file_type(const string& file_path)
{
+ if (is_dir(file_path))
+ return FILE_TYPE_DIR;
+
ifstream in(file_path.c_str(), ifstream::binary);
file_type r = guess_file_type(in);
in.close();
test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt \
test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64.deb \
test-diff-pkg/libsigc++-2.0-0v5-dbgsym_2.4.1-1ubuntu2_amd64.ddeb \
-test-diff-pkg/libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64.deb
+test-diff-pkg/libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64.deb \
+test-diff-pkg/dirpkg-0-dir1/libobj-v0.so \
+test-diff-pkg/dirpkg-0-dir2/libobj-v0.so \
+test-diff-pkg/dirpkg-0-report-0.txt \
+test-diff-pkg/dirpkg-0-dir1/obj-v0.cc \
+test-diff-pkg/dirpkg-0-dir2/obj-v0.cc
--- /dev/null
+// Compile with:
+// g++ -g -shared -o libobj-v0.so obj-v0.cc
+
+struct S
+{
+ int mem0;
+
+ S()
+ : mem0()
+ {}
+};
+
+void
+bar(S&)
+{}
--- /dev/null
+// Compile with:
+// g++ -g -shared -o libobj-v0.so obj-v0.cc
+
+struct S
+{
+ int mem0;
+ char mem1;
+
+ S()
+ : mem0(),
+ mem1()
+ {}
+};
+
+void
+bar(S&)
+{}
--- /dev/null
+================ changes of 'libobj-v0.so'===============
+ Functions changes summary: 0 Removed, 1 Changed, 0 Added function
+ Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+ 1 function with some indirect sub-type change:
+
+ [C]'function void bar(S&)' has some indirect sub-type changes:
+ parameter 1 of type 'S&' has sub-type changes:
+ in referenced type 'struct S':
+ type size changed from 32 to 64 bits
+ 1 data member insertion:
+ 'char S::mem1', at offset 32 (in bits)
+
+
+================ end of changes of 'libobj-v0.so'===============
+
static InOutSpec in_out_specs[] =
{
+ {
+ "data/test-diff-pkg/dirpkg-0-dir1",
+ "data/test-diff-pkg/dirpkg-0-dir2",
+ "",
+ "",
+ "",
+ "data/test-diff-pkg/dirpkg-0-report-0.txt",
+ "output/test-diff-pkg/dirpkg-0-report-0.txt"
+ },
#ifdef WITH_RPM
// Two RPM packages with debuginfo available and have ABI changes
{
break;
case abigail::tools_utils::FILE_TYPE_DEB:
break;
+ case abigail::tools_utils::FILE_TYPE_DIR:
+ break;
}
switch (t2_type)
break;
case abigail::tools_utils::FILE_TYPE_DEB:
break;
+ case abigail::tools_utils::FILE_TYPE_DIR:
+ break;
}
if (!t1 && !c1)
break;
case abigail::tools_utils::FILE_TYPE_DEB:
break;
+ case abigail::tools_utils::FILE_TYPE_DIR:
+ break;
}
if (!tu && !corp)
is_debug_info_(is_debug_info)
{
type_ = guess_file_type(path);
- extracted_dir_path_ = extracted_packages_parent_dir() + "/" + dir;
+ if (type_ == abigail::tools_utils::FILE_TYPE_DIR)
+ extracted_dir_path_ = path;
+ else
+ extracted_dir_path_ = extracted_packages_parent_dir() + "/" + dir;
}
/// Getter of the path of the package.
void
erase_extraction_directory() const
{
+ if (type() == abigail::tools_utils::FILE_TYPE_DIR)
+ // If we are comparing two directories, do not erase the
+ // directory as it was provided by the user; it's not a
+ // temporary directory we created ourselves.
+ return;
+
if (verbose)
cerr << "Erasing temporary extraction directory "
<< extracted_dir_path()
return false;
#endif // WITH_DEB
break;
+
+ case abigail::tools_utils::FILE_TYPE_DIR:
+ // The input package is just a directory that contains binaries,
+ // there is nothing to extract.
+ break;
+
default:
return false;
}
}
break;
+ case abigail::tools_utils::FILE_TYPE_DIR:
+ if (second_package->type() != abigail::tools_utils::FILE_TYPE_DIR)
+ {
+ cerr << opts.package2 << " should be a directory\n";
+ return 1;
+ }
+ break;
+
default:
cerr << opts.package1 << " should be a valid package file \n";
return 1;