abipkgdiff: Don't use user-specific filesystem info in error msg
authorDodji Seketeli <dodji@redhat.com>
Tue, 4 Apr 2023 13:27:22 +0000 (15:27 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 5 Apr 2023 15:01:48 +0000 (17:01 +0200)
The recent patch "Bug rhbz#2182807 --  abipkgdiff crashes on missing debuginfo package"
inadvertently introduced user-specific filesystem information in error
messages, making tests/runtestdiffpkg be non-deterministic.  Fixed
thus.

* tools/abipkgdiff.cc (get_pretty_printed_list_of_packages): Emit
base names of packages, not the absolute filesystem path.
* tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt:
Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt
tools/abipkgdiff.cc

index 0188bc9be2098df9a3090d39e185f56da223548e..951c66c79983afc546ca7268508029b92f72c984 100644 (file)
@@ -1,6 +1,6 @@
 abipkgdiff: ==== Error happened during processing of 'libxfce4uiglade.so' ====
 abipkgdiff: could not find alternate debug info:
-abipkgdiff: While reading elf file 'libxfce4uiglade.so', could not find alternate debug info in provided debug info package(s) '/home/dodji/git/libabigail/fixes/tests/data/test-diff-pkg/libxfce4ui-devel-debuginfo-4.12.1-8.fc27.ppc64.rpm'
+abipkgdiff: While reading elf file 'libxfce4uiglade.so', could not find alternate debug info in provided debug info package(s) 'libxfce4ui-devel-debuginfo-4.12.1-8.fc27.ppc64.rpm'
 abipkgdiff: The alternate debug info file being looked for is: ../../../../.dwz/libxfce4ui-4.12.1-8.fc27.ppc64
 abipkgdiff: You must provide the additional debug info package that contains that alternate debug info file, using an additional --d1/--d2 switch
 abipkgdiff: ==== End of error for 'libxfce4uiglade.so' ====
index d10706a9cafb88c67da26b2a78eaa4736f95682c..69661c5b61b77af6ab63440a09e95b17895da2ca 100644 (file)
@@ -2421,11 +2421,13 @@ get_pretty_printed_list_of_packages(const vector<string>& packages)
   std::stringstream o;
   for (auto p : packages)
     {
+      string filename;
+      tools_utils::base_name(p, filename);
       if (need_comma)
        o << ", ";
       else
        need_comma = true;
-      o << "'" << p << "'";
+      o << "'" << filename << "'";
     }
   return o.str();
 }