Open camoz opened 2 years ago
Similarly, xbps-install has at least four output formats.
The problem with changing defaults is that it will break lots of tools parsing xbps output. Is there any gain besides consistency of not quite the same data?
$ xbps-install --repository=https://alpha.de.repo.voidlinux.org/current nawk -r /tmp/ -S
Name Action Version New version Download size
glibc install - 2.32_2 8586KB
nawk install - 20210110_1 67KB
Size to download: 8655KB
Size required on disk: 33MB
Space available on disk: 16GB
$ xbps-install --repository=https://alpha.de.repo.voidlinux.org/current nawk -r /tmp/ -S | cat
2 packages will be downloaded:
glibc-2.32_2
nawk-20210110_1
2 packages will be installed:
glibc-2.32_2
nawk-20210110_1
Size to download: 8655KB
Size required on disk: 33MB
Space available on disk: 16GB
$ xbps-install --repository=https://alpha.de.repo.voidlinux.org/current nawk -r /tmp/ -S
2 packages will be downloaded:
glibc-2.32_2 nawk-20210110_1
2 packages will be installed:
glibc-2.32_2 nawk-20210110_1
Size to download: 8655KB
Size required on disk: 33MB
Space available on disk: 16GB
$ xbps-install --repository=https://alpha.de.repo.voidlinux.org/current nawk -r /tmp/ -S -n
glibc-2.32_2 install x86_64 https://alpha.de.repo.voidlinux.org/current 34384831 8792402
nawk-20210110_1 install x86_64 https://alpha.de.repo.voidlinux.org/current 156769 68850
Similarly, xbps-install has at least four output formats.
Thanks for the illustrations, I didn't know that!
The problem with changing defaults is that it will break lots of tools parsing xbps output.
Yes. I'm not really used to developing/deploying such big software projects with many users, so I may be not paying enough attention to that. But sometimes I think you have to make some changes, even if they break something, to move forward. But the gains of what I proposed here are probably not high enough to justify that.
Is there any gain besides consistency of not quite the same data?
What comes to my mind:
sed
lines, but it's still a bit simpler. Ultimately, if someday a --format=...
option will be implemented, tools should probably use that, to have 100% reliable formats.-v|--verbose
and -q|--quiet
) to easily switch between a quiet and verbose format, which may improve interactive usage of xbps-query.
xbps-query -O
outputs only package names. Now before removing them I want to know what they are good for, maybe they're useful and optional for other programs -> could quickly run xbps-query -Ov
for more verbose output.xbps-query -mv
could be useful which includes the short description of the package. If one wants to replicate a setup on another machine, the short output of xbps-query -mq
could be useful to feed into xbps-install
.xbps-query -x
is quiet -> could quickly add -v
to see what the dependencies are used for.
Right now,
xbps-query
has different default output formats (or even only one output format) for some commands.Multiple columns:
Single column:
I think it would be nice if the first two examples (
-l
and-s
) had the same output format. Maybe we can introduce a new "package state descriptor" likenn
or--
for "currently not installed" packages? Right now we have, according toxbps-query(1)
:Overall, I think it would be useful to have two different easily reachable output formats (by easily reachable I mean e.g. a simple flag, not a complete
--format=...
specifier). Often, e.g. when searching packages via-s
, additional information like the short description and package version is useful. But often it is also useful to just have a list of package names (without any version string etc.) for batch processing, e.g. saving a list of all manually installed packages to be later fed intoxbps-install
on another system. I think these are two common scenarios, and having only two default output formats for the various package listing options ofxbps-query
will make it easier (because more predictable) to use. The flags could be named-v|--verbose
(already exists, but maybe it could be used for this) and-q|--quiet
. Some modes, like-s
, are verbose by default and can be made shorter using-q
. And some modes, like-m
, are short by default and can be made more verbose using-v
.There was also the (IMO great) idea of adding a
--format=...
option, however I'm talking about the default output format and perhaps an easily reachable secondary one, for the most common cases.Related issues/PRs: