Ticket #999 (closed enhancement: fixed)
|Reported by:||eternaleye||Owned by:|
|Priority:||Sometime||Milestone:||cave Long Term Extras|
Add cave subcommand 'parse-spec', with usage:
cave parse-spec [--format 'foo'] spec1 [spec2...]
It will take the specs given as arguments, parse them, and then format them according to the format string. If given no format, it is the identity function. If the format requires more data than is present in the spec, it should error out. This command will allow elimination of most icky seds used when scripting with cave, like the oneliner used to reinstall Perl modules after upgrading the interpreter. That specific example would change from
"cave resolve -1 `cave print-owners /usr/lib64/perl5/vendor_perl/5.12.0|grep -v dev-lang/perl|sed 's/^/>=/' |sed 's/::installed//'`"
"cave print-owners /usr/lib64/perl5/vendor_perl/5.12.0 | xargs cave parse-spec --format '%c/%p:%s\n' | grep -v dev-lang/perl | xargs cave resolve -1"
Possible problems: EAPIs may mean that version parsing rules change. Perhaps have an --eapi flag?