Bash and zsh scripts to display list of files installed by given bundle(s)

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

  1. First you need to have os-core-update-index and jq bundles installed
  2. If you use zsh, you can download this and put it somewhere in your fpath, and autoload it.
    If you use bash, 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.

3 Likes

this might help https://github.com/intel/clear-linux-dissector/blob/master/README.md

1 Like