Conversation
Previously, release info (setup.Release) parsing/reading logic was written in cmd/chisel/cmd_cut.go file. Being the only operation command before, it made sense to have it there. But, since there are incoming new commands, it is likely that this logic will be re-used. Thus, move it to a function, ``getRelease()``.
This commit adds functionalities to produce YAML outputs for ``setup.Package`` and ``setup.Slice`` objects.
This commit adds a new ``info`` command which shows detailed information
about package slices.
It accepts a white-space separated list of strings. The list can be
composed of package names, slice names, or a combination of both. The
default output format is YAML. When multiple package or slice names are
provided, the output is a list of YAML documents, separated by three
dashes (“---”).
Slice definitions are shown verbatim according to their definition in
the Chisel releases. For example, "globs" are not expanded.
---
Usage:
chisel info [info-OPTIONS] [<pkg|slice>...]
[info command options]
--release=<branch|dir> Chisel release branch or directory
|
ping @cjdcordeiro @woky @niemeyer |
woky
left a comment
There was a problem hiding this comment.
Can't find anything to nitpick on. LGTM.
benhoyt
left a comment
There was a problem hiding this comment.
Looks good. Just a few very nitty comments/suggestions.
cjdcordeiro
left a comment
There was a problem hiding this comment.
Noice :)
It lgtm but I'm just leaving a bunch of nitpicks :p
cjdcordeiro
left a comment
There was a problem hiding this comment.
Great, thanks for the changes. it lgtm
letFunny
left a comment
There was a problem hiding this comment.
Code looks very good. I left some small, mostly nitpicky, comments.
Instead of checking if the output YAML equals exactly to the expected YAML by string checking, parse both YAMLs instead. Then compare to see if they are equal.
letFunny
left a comment
There was a problem hiding this comment.
Some more minor comments
letFunny
left a comment
There was a problem hiding this comment.
Thanks for this Rafid, LGTM, only a couple of nitpicks based on the latest changes and what we discussed.
niemeyer
left a comment
There was a problem hiding this comment.
Thank you all. This is looking pretty good already, but a few details need addressing:
niemeyer
left a comment
There was a problem hiding this comment.
This is looking good. Only remaining question is the mutability question that was already in the previous review. It changed, but it's not clear what is the real intention or the current state yet.
letFunny
left a comment
There was a problem hiding this comment.
Thanks Rafid, one minor thing.
letFunny
left a comment
There was a problem hiding this comment.
Last minor things in the same spirit as one of the comments by Gustavo
This PR adds a new
infocommand which shows detailed information about package slices.It accepts a white-space-separated list of strings. The list can be composed of package names, slice names, or a combination of both. The default output format is YAML. When multiple package or slice names are provided, the output is a list of YAML documents, separated by three dashes (“---”).
Slice definitions are shown verbatim according to their definition in the Chisel releases. For example, "globs" are not expanded.
Expand to see full specification
Command
Usage
Description
The info command shows detailed information about package slices in a Chisel release. It accepts a white-space separated list of strings. The list can be composed of package names, slice names, or a combination of both.The package slices are then looked for within the upstream chisel-releases repository.
The default output format is YAML. When multiple package/slice names are provided, the output is a list of YAML documents, separated by three dashes (“---”).
If no pkgs/slices are provided, it returns an error. At least one pkg/slicename is required.
If one or more pkgs/slices are provided, it returns a list of their slice definitions.
For slice names, it returns the corresponding package’s SDF, excluding any other package slices which have not been requested.
If multiple slices of the same package are provided, it returns the corresponding package’s SDF just once (i.e. the output can only have one YAML document per package, regardless of how many slices are specified).
If not all pkgs/slices can be found, it returns a list with slice definitions AND an error (to stderr), listing the pkgs/slices that could not be found.
If no packages can be found, it returns an error.
Slice definitions are shown verbatim according to their definition in the Chisel releases. E.g. expressions like globs are not expanded.
[info-OPTIONS]
(Optional) The
--releaseoption filters the search. It behaves similar to the--releaseoption to chisel cut. If unspecified, the ubuntu release will be parsed from the host OS. If an ubuntu-release is passed as the argument, the find command only searches for slices in that release branch. If a path to a chisel-release directory is passed as the argument, it parses the directory as a chisel-release and only searches for available slices in that directory.Examples
Additional information