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

Bug 481584

Summary: Repoman: Output is needlessly hard to parse
Product: Portage Development Reporter: Patrick Lauer <patrick>
Component: RepomanAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 484436    
Attachments: repoman-parseable.patch
repoman-parseable-v2.patch

Description Patrick Lauer gentoo-dev 2013-08-19 03:05:57 UTC
Sample output:

  LIVEVCS.unmasked              2
   www-apps/horizon/horizon-2013.1.9999.ebuild
   www-apps/trac-mercurial/trac-mercurial-1.0.0.3_pre20130206.ebuild
  inherit.deprecated            46

This is needlessly hard to parse in a sane way, I suggest a columnar format that is grep'able, like this:

NumberOf LIVEVCS.unmasked              2
LIVEVCS.unmasked www-apps/horizon/horizon-2013.1.9999.ebuild
LIVEVCS.unmasked www-apps/trac-mercurial/trac-mercurial-1.0.0.3_pre20130206.ebuild
NumberOf inherit.deprecated            46
inherit.deprecated www-apps/bitten/bitten-0.6-r1.ebuild: please migrate from 'distutils' to 'distutils-r1' on line: 15

Advantage:
repoman full | grep '^LIVECVS'  # this gives all matches, no need for heavy sed/awk/wtf magic

(Could be hidden behind a --machine-readable or similar command line toggle)
Comment 1 Chris Reffett (RETIRED) gentoo-dev Security 2014-02-10 20:42:27 UTC
Created attachment 370090 [details, diff]
repoman-parseable.patch

Working on this. Attached is a first shot at a patch; asked for feedback in #-portage, will post to the mailing list soon if there are no objections
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2014-02-10 20:46:29 UTC
machine parseable should be a choices (not a boolean).

for instance:

--machine_parseable=column
--machine_parseable=csv
--machine_parseable=json

and so forth.
Comment 3 Chris Reffett (RETIRED) gentoo-dev Security 2014-02-11 02:43:14 UTC
Created attachment 370114 [details, diff]
repoman-parseable-v2.patch

Updated for that and for other criticisms on the ML.
Comment 4 Chris Reffett (RETIRED) gentoo-dev Security 2014-02-12 00:58:08 UTC
Committed (with a few changes) as af0eca982f04409439e6310e602b55bed6cc623c
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2014-08-04 02:05:53 UTC
released in portage-2.2.11