====================
Summary
====================
At the moment, users wanting to obtain publisher, mirror, or origin information have to parse the printed output of the "pkg publisher" command. This isn't locale safe and is prone to break whenever the output format changes.

Since the output format was never intended as a stable interface for consumers, an advanced set of listing options is desirable.

========================================
Suggested Implementation
========================================

* Add -t and --type flags to allow specifying the type of information being requested. The -t option could only be specified once; possible values would be:

-- publisher
-- repository
-- origin
-- mirror

* Add -p --property flags that could be used with -t to allow a specific property value to be shown. Multiple properties could be specified by repeating the option, or by comma-separation of the values. The properties available would be dependent on the type of information being shown:

-- publisher: alias, client_uuid, disabled, prefix

-- repository: collection_type, description, refresh_seconds, registered, registration_uri, sort_policy

-- origin: ssl_cert, ssl_key, uri, priority

========================================
Possible example usages
========================================
$ pkg publisher -t publisher -p alias
ALIAS
os
extras

----------

$ pkg publisher -t publisher -p prefix
PREFIX
opensolaris.org
extras.pkg.sun.com

----------

$ pkg publisher -t repository -p name
NAME
OpenSolaris Development Repository
OpenSolaris Extras Repository

----------

$ pkg publisher -t origin -p uri
URI
http://pkg.opensolaris.org/dev/
https://pkg.sun.com/opensolaris/extra/

----------

$ pkg publisher -t origin -p uri os
URI
http://pkg.opensolaris.org/dev/

----------

$ pkg publisher -t origin -p uri extras
URI
https://pkg.sun.com/opensolaris/extra/

----------

$ pkg publisher -t origin -p uri,ssl_cert
URI                                     SSL Certificate
http://pkg.opensolaris.org/dev/
https://pkg.sun.com/opensolaris/extra/  /path/to/ssl_cert.pem

----------

$ pkg publisher -t origin -p uri,ssl_cert extras
URI                                     SSL Certificate
https://pkg.sun.com/opensolaris/extra/  /path/to/ssl_cert.pem

----------

Using -P with any of the above would only showed the preferred publisher's data. Using -H with any of the above would omit the column headers.

Yet to be decided would be if -t and -p would have to be used together or could be used separately.

Feedback welcome,
--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to