[applied] abipkgdiff: Don't use user-specific filesystem info in error msg

Message ID 87lej6l3em.fsf@redhat.com
State New
Headers
Series [applied] abipkgdiff: Don't use user-specific filesystem info in error msg |

Commit Message

Dodji Seketeli April 5, 2023, 4:06 p.m. UTC
  Hello,

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>
---
 .../libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt    | 2 +-
 tools/abipkgdiff.cc                                           | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt b/tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt
index 0188bc9b..951c66c7 100644
--- a/tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt
+++ b/tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt
@@ -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' ====
diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc
index d10706a9..69661c5b 100644
--- a/tools/abipkgdiff.cc
+++ b/tools/abipkgdiff.cc
@@ -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();
 }