public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] abipkgdiff: Emit better logs in verbose mode
Date: Tue, 28 Feb 2023 12:30:32 +0100	[thread overview]
Message-ID: <87k002rprb.fsf@redhat.com> (raw)

Hello,

When invoked with --verbose, abipkgdiff emits some logs that could use
better clarity.  Fixed thus.

	* tools/abipkgdiff.cc (package::erase_extraction_directory): Say
	explicitly what's DONE.
	(extract_rpm): Add newline to log.  Say explicitly what's DONE on
	which package.
	(extract_deb, extract_tar)
	(erase_created_temporary_directories_parent, compare_to_self)
	(create_maps_of_package_content): Say explicitly what's DONE on
	which package.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 tools/abipkgdiff.cc | 70 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 56 insertions(+), 14 deletions(-)

diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc
index c588481c..8383ae98 100644
--- a/tools/abipkgdiff.cc
+++ b/tools/abipkgdiff.cc
@@ -726,12 +726,16 @@ public:
     if (system(cmd.c_str()))
       {
 	if (opts.verbose)
-	  emit_prefix("abipkgdiff", cerr) << " FAILED\n";
+	  emit_prefix("abipkgdiff", cerr)
+	    << "Erasing temporary extraction directory"
+	    << " FAILED\n";
       }
     else
       {
 	if (opts.verbose)
-	  emit_prefix("abipkgdiff", cerr) << " DONE\n";
+	  emit_prefix("abipkgdiff", cerr)
+	    << "Erasing temporary extraction directory"
+	    << " DONE\n";
       }
   }
 
@@ -947,7 +951,7 @@ extract_rpm(const string& package_path,
       << package_path
       << " to "
       << extracted_package_dir_path
-      << " ...";
+      << " ...\n";
 
   string cmd = "test -d " + extracted_package_dir_path
     + " || mkdir -p " + extracted_package_dir_path + " ; cd " +
@@ -957,12 +961,22 @@ extract_rpm(const string& package_path,
   if (system(cmd.c_str()))
     {
       if (opts.verbose)
-	emit_prefix("abipkgdiff", cerr) << " FAILED\n";
+	emit_prefix("abipkgdiff", cerr)
+	  << "Extracting package "
+	  << package_path
+	  << " to "
+	  << extracted_package_dir_path
+	  << " FAILED\n";
       return false;
     }
 
   if (opts.verbose)
-    emit_prefix("abipkgdiff", cerr) << " DONE\n";
+    emit_prefix("abipkgdiff", cerr)
+      << "Extracting package "
+      << package_path
+      << " to "
+      << extracted_package_dir_path
+      << " DONE\n";
 
   return true;
 }
@@ -1000,13 +1014,22 @@ extract_deb(const string& package_path,
   if (system(cmd.c_str()))
     {
       if (opts.verbose)
-	emit_prefix("abipkgdiff", cerr) << " FAILED\n";
+	emit_prefix("abipkgdiff", cerr)
+	  << "Extracting package "
+	  << package_path
+	  << " to "
+	  << extracted_package_dir_path
+	  << " FAILED\n";
       return false;
     }
 
   if (opts.verbose)
-    emit_prefix("abipkgdiff", cerr) << " DONE\n";
-
+    emit_prefix("abipkgdiff", cerr)
+      << "Extracting package "
+      << package_path
+      << " to "
+      << extracted_package_dir_path
+      << " DONE\n";
   return true;
 }
 
@@ -1053,12 +1076,22 @@ extract_tar(const string& package_path,
   if (system(cmd.c_str()))
     {
       if (opts.verbose)
-	emit_prefix("abipkgdiff", cerr) << " FAILED\n";
+	emit_prefix("abipkgdiff", cerr)
+	  << "Extracting tar archive "
+	  << package_path
+	  << " to "
+	  << extracted_package_dir_path
+	  << " FAILED\n";
       return false;
     }
 
   if (opts.verbose)
-    emit_prefix("abipkgdiff", cerr) << " DONE\n";
+    emit_prefix("abipkgdiff", cerr)
+      << "Extracting tar archive "
+      << package_path
+      << " to "
+      << extracted_package_dir_path
+      << " DONE\n";
 
   return true;
 }
@@ -1097,12 +1130,18 @@ erase_created_temporary_directories_parent(const options &opts)
   if (system(cmd.c_str()))
     {
       if (opts.verbose)
-	emit_prefix("abipkgdiff", cerr) << "FAILED\n";
+	emit_prefix("abipkgdiff", cerr)
+	  << "Erasing temporary extraction parent directory "
+	  << package::extracted_packages_parent_dir()
+	  << "FAILED\n";
     }
   else
     {
       if (opts.verbose)
-	emit_prefix("abipkgdiff", cerr) << "DONE\n";
+	emit_prefix("abipkgdiff", cerr)
+	  << "Erasing temporary extraction parent directory "
+	  << package::extracted_packages_parent_dir()
+	  << "DONE\n";
     }
 }
 
@@ -1783,7 +1822,10 @@ compare_to_self(const elf_file&		elf,
   diff = compute_diff(corp, reread_corp, ctxt);
   if (opts.verbose)
     emit_prefix("abipkgdfiff", cerr)
-      << "... Comparing the ABIs: DONE\n";
+      << "Comparing the ABIs: of \n"
+      << "   '" << corp->get_path() << "' against \n"
+      << "   '" << abi_file_path << "':"
+      << "DONE\n";
 
   abidiff_status s = abigail::tools_utils::ABIDIFF_OK;
   if (diff->has_changes())
@@ -2381,7 +2423,7 @@ create_maps_of_package_content(package& package, options& opts)
       is_ok = true;
       if (opts.verbose)
 	emit_prefix("abipkgdiff", cerr)
-	  << " Analysis of " << package.path() << " DONE\n";
+	  << " Analysis of linux package " << package.path() << " DONE\n";
       return is_ok;
     }
 
-- 
2.39.2


-- 
		Dodji


                 reply	other threads:[~2023-02-28 11:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k002rprb.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).