[applied] abipkgdiff: Do not erase working dirs before we are done using them

Message ID 8735pydk97.fsf@redhat.com
State New
Headers
Series [applied] abipkgdiff: Do not erase working dirs before we are done using them |

Commit Message

Dodji Seketeli Sept. 21, 2021, 3:24 p.m. UTC
  Hello,

abipkgdiff removes working directories too early when there is no ABI
change to report about any binary. In that case, we still need to access
the working directories so that we can access ELF properties like SONAME
and the like.  This is useful to report about binaries removed/added.

	* tools/abipkgdiff.cc (compare_prepared_userspace_packages):
	Removing working directories "early" prevents e.g,
	dwarf_reader::get_soname_of_elf_file from accessing those files.
	So do not remove them until the very end.
	* tests/data/test-diff-pkg/libxcrypt-4.1.1-6.el8.x86_64--libxcrypt-4.1.1-6.el8.x86_64-output-1.txt:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 ....1-6.el8.x86_64--libxcrypt-4.1.1-6.el8.x86_64-output-1.txt | 4 ++--
 tools/abipkgdiff.cc                                           | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
  

Patch

diff --git a/tests/data/test-diff-pkg/libxcrypt-4.1.1-6.el8.x86_64--libxcrypt-4.1.1-6.el8.x86_64-output-1.txt b/tests/data/test-diff-pkg/libxcrypt-4.1.1-6.el8.x86_64--libxcrypt-4.1.1-6.el8.x86_64-output-1.txt
index b428bcf9..f8218df0 100644
--- a/tests/data/test-diff-pkg/libxcrypt-4.1.1-6.el8.x86_64--libxcrypt-4.1.1-6.el8.x86_64-output-1.txt
+++ b/tests/data/test-diff-pkg/libxcrypt-4.1.1-6.el8.x86_64--libxcrypt-4.1.1-6.el8.x86_64-output-1.txt
@@ -1,4 +1,4 @@ 
 Removed binaries:
-  [D] /lib64/libcrypt.so.1.1.0, no SONAME
+  [D] /lib64/libcrypt.so.1.1.0, SONAME: libcrypt.so.1
 Added binaries:
-  [A] /usr/lib64/libcrypt.so.2.0.0, no SONAME
+  [A] /usr/lib64/libcrypt.so.2.0.0, SONAME: libcrypt.so.2
diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc
index 382cdfde..f90d5cb0 100644
--- a/tools/abipkgdiff.cc
+++ b/tools/abipkgdiff.cc
@@ -2702,9 +2702,6 @@  compare_prepared_userspace_packages(package& first_package,
 	}
     }
 
-  if (compare_tasks.empty())
-    maybe_erase_temp_dirs(first_package, second_package, opts);
-
   comparison_done_notify notifier(diff);
   if (!compare_tasks.empty())
     {