Continuing the discussion from How to know the list of files in a bundle (example: texlive):
If I want to know which bundle has a particular file I can do that with swupd search-file
. But it’s also quite often that I need to know what files are installed by a particular bundle.
And I wrote a bash
script and a zsh
script for this job.
Installation
- First you need to have
os-core-update-index
andjq
bundles installed - If you use zsh, you can download this and put it somewhere in your
fpath
, andautoload
it.
If you usebash
, then this one shall works. You just need to source it in your.bashrc
.
Usage
swupd-list [-o OUTPUTFILE] BUNDLE [...]
It must has at least one argument as the name of a bundle. If multiple bundles are given, they shall be separated by space.
It will looks for the information from /usr/share/clear/allbundles/BUNDLE
. If multiple bundles are provided, chances are there are some overlaps and the script will remove the duplicates and sort the result in alphabetical order.
If -o
option is not set, the result is piped to less
.
If -o
is set, its next argument would be treated as the name for the output file and the result is written to that file. If the file already exists and is readable, its contents would be replaced.