Folks,
I recently had to answer the question: "What does SUNWcs depend upon?"
That was hard to work out. So, I've recently been hacking on "pkg list"
and then "pkg search"; while these may not be ideal ways to answer this
question, they are a good place to start.
I'm hoping to get the thoughts of folks on the list about these
proposed changes.
In addition to everything below, I would also like to propose a rename of
"pkg list" to "pkg list-actions" or "pkg actions-list", or to "pkg
actions". And a rename of "pkg status" to "pkg list". I haven't
done that yet-- so the output you'll see doesn't reflect that.
Here is what we can now do, with my changes. (n.b. most of this isn't
actually new, but some of the new keywords are very useful). I'm sending
some sample output for your consideration-- the code still needs cleanup.
# pkg list -o :pkg.name,:action.name,:action.key -t depend
PKG.NAME ACTION.NAME ACTION.KEY
FSWxorg-clientlibs depend pkg:/[EMAIL PROTECTED]
FSWxorg-clientlibs depend pkg:/[EMAIL PROTECTED]
FSWxorg-clientlibs depend pkg:/[EMAIL PROTECTED]
FSWxorg-clientlibs depend pkg:/[EMAIL PROTECTED]
FSWxorg-clientlibs depend pkg:/[EMAIL PROTECTED]
FSWxorg-clientlibs depend pkg:/[EMAIL PROTECTED]
SUNWTiff depend pkg:/[EMAIL PROTECTED]
SUNWTiff depend pkg:/[EMAIL PROTECTED]
SUNWTiff depend pkg:/[EMAIL PROTECTED]
SUNWbzip depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
SUNWcs depend pkg:/[EMAIL PROTECTED]
:pkg.name is new; :pkg.fmri, :pkg.shortfmri, :pkg.authority are also
available. :action.name and :action.key were there before but are
renamed per Danek's suggestion. I also fixed the column width code to
account for the width of column headers. Obviously, negotiable if it
seems like it adds too much width.
Here's a form which I suspect could be readily fed into something like
graphviz with just a little more postprocessing.
# pkg list -H -o :pkg.shortfmri,:action.key -t depend
pkg://ipkg/[EMAIL PROTECTED] pkg:/[EMAIL PROTECTED]
pkg://ipkg/[EMAIL PROTECTED] pkg:/[EMAIL PROTECTED]
pkg://ipkg/[EMAIL PROTECTED] pkg:/[EMAIL PROTECTED]
pkg://ipkg/[EMAIL PROTECTED] pkg:/[EMAIL PROTECTED]
That is to say, the first column is the name of a package. The
second column represents something the package depends upon. It
would also be nice to have a way of having the fmri's be in the
same form...
Second, I am proposing to revise 'pkg search' as follows:
old # pkg search firefox
basename pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T153729Z
basename pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T153840Z
basename pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T173341Z
basename pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T173350Z
basename pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T173358Z
new # pkg search firefox
basename link usr/bin/firefox pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T153729Z
basename dir usr/lib/firefox pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T153840Z
basename dir usr/lib/firefox pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T173341Z
basename dir usr/lib/firefox pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T173350Z
basename dir usr/lib/firefox pkg:/[EMAIL PROTECTED],5.11-0.79:20080205T173358Z
While I'm not entirely happy with this output, at least it tells us
something more about what's going on when you do a search, and is
conceptually helpful to the human being who is interpreting the results.
pkg search -r is similarly revised-- and the depot search files will need
to be rebuilt to deal with this change. This part works but is less
well tested, so far. The big problem I see with search is that the
results are not really well integrated with the rest of the packaging
system-- from a client perspective, instead of a list of matching
"action" objects, you get a set of text strings. Additionally, we lack
the ability to do substring matching-- so a search for SUNWfirefox
doesn't really do what you might expect, since it won't find a depend
action which depends on pkg:/[EMAIL PROTECTED],5.11-0.79.
These are some things I think we should intend to fix.
Thanks,
-dp
--
Daniel Price - Solaris Kernel Engineering - [EMAIL PROTECTED] - blogs.sun.com/dp
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss