proj/portage:master commit in: bin/
"Matt Turner" <[email protected]>
| Newsgroups | gmane.linux.gentoo.cvs |
|---|---|
| Message-ID | <1785956473.13e7959ffe8d46b54f06731af0cd45643df5a398.mattst88@gentoo> |
commit: 13e7959ffe8d46b54f06731af0cd45643df5a398
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 3 15:58:53 2026 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed Aug 5 19:01:13 2026 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=13e7959f
portageq: hint about FEATURES=observability from "jobs" too
"emerge --status" and "portageq jobs" read the same status files, so
they should say the same thing when there is nothing to report and the
feature is not enabled. The hint goes to stderr, and --json still emits
an empty list, so stdout stays machine-readable either way.
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
bin/portageq | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/bin/portageq b/bin/portageq
index d684ef707..f520acc9a 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -221,20 +221,30 @@ try:
def jobs(argv):
import json as _json
- from _emerge._observability import read_snapshots, format_snapshots
+ from _emerge._observability import (
+ format_snapshots,
+ missing_feature_hint,
+ read_snapshots,
+ )
from portage.const import EPREFIX
snapshots = read_snapshots(EPREFIX)
+ hint = missing_feature_hint(snapshots)
+ if hint is not None:
+ sys.stderr.write(hint)
+
if "--json" in argv:
+ # Still valid JSON with nothing to report.
print(_json.dumps(snapshots, sort_keys=True, indent=2))
- else:
+ elif hint is None:
sys.stdout.write(format_snapshots(snapshots))
return 0
docstrings["jobs"] = """[--json]
Show packages currently being built/merged by running emerge
- processes (requires FEATURES="observability"). With --json, emit
- the raw status snapshots.
+ processes (requires the observed emerge to have been started with
+ FEATURES="observability"). With --json, emit the raw status
+ snapshots.
"""
jobs.__doc__ = docstrings["jobs"]