Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 746902

Summary: sys-apps/portage: option to show starting datetime in emerge output
Product: Portage Development Reporter: Erik Quaeghebeur <gentoo>
Component: Enhancement/Feature RequestsAssignee: Portage team <dev-portage>
Status: UNCONFIRMED ---    
Severity: enhancement CC: reagentoo, tonyrsim
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Erik Quaeghebeur 2020-10-06 10:26:38 UTC
I would be convenient to have an option for emerge that makes it show the starting datetime of performed and current actions. Because this datetime info is available to emerge directly, it would be a light but convenient alternative to commands like qlop -t and genlop -c that need to be run in a separate shell.

For an illustration of what the output could look like, see the forum post <https://forums.gentoo.org/viewtopic-p-8509777.html>.

Reproducible: Always
Comment 1 Tony Sim 2023-04-03 03:28:42 UTC
I use the following patch.
--------------------------------

$ cat /etc/portage/patches/sys-apps/portage/timestamp.patch
diff --git a/lib/_emerge/JobStatusDisplay.py b/lib/_emerge/JobStatusDisplay.py
index 33e9551..33bb983 100644
--- a/lib/_emerge/JobStatusDisplay.py
+++ b/lib/_emerge/JobStatusDisplay.py
@@ -127,7 +127,7 @@ class JobStatusDisplay:
         return True
 
     def _format_msg(self, msg):
-        return f">>> {msg}"
+        return f">>> {time.strftime('%H:%M:%S',time.localtime())} {msg}"
 
     def _erase(self):
         self._write(self._term_codes["carriage_return"] + self._term_codes["clr_eol"])

--------------------------------
Then running emerge with the -q option I get output as follows :

>>> 10:08:07 Verifying ebuild manifests
>>> 10:08:07 Emerging (1 of 4) dev-ruby/power_assert-1.2.0-r2::gentoo
>>> 10:08:17 Installing (1 of 4) dev-ruby/power_assert-1.2.0-r2::gentoo
>>> 10:08:31 Emerging (2 of 4) dev-db/mysql-connector-c-8.0.32-r1::gentoo
>>> 10:14:26 Installing (2 of 4) dev-db/mysql-connector-c-8.0.32-r1::gentoo
>>> 10:14:42 Emerging (3 of 4) net-analyzer/nmap-7.93-r3::gentoo
>>> 10:16:38 Installing (3 of 4) net-analyzer/nmap-7.93-r3::gentoo
>>> 10:16:53 Emerging (4 of 4) net-print/cups-2.4.2-r7::gentoo
>>> 10:18:37 Installing (4 of 4) net-print/cups-2.4.2-r7::gentoo
>>> 10:18:53 Jobs: 4 of 4 complete                           Load avg: 1.73, 1.90, 1.04