BASH script to print info about all pakfire packages

cat /opt/bin/pakfire-info
#!/usr/bin/env bash

set -euo pipefail

BATCH_SIZE=100

mapfile -t all_packages < <(pakfire list --no-colors | grep Name | sed -e ‘s/Name: //’)
package_count=${#all_packages[@]}

for ((i = 0; i < package_count; i += BATCH_SIZE)); do
batch=( “${all_packages[@]:i:BATCH_SIZE}” )
pakfire info “${batch[@]}”
done

Just a quick hack.. Pretty slow on first run since it looks like the queries go up one by one to the upstream package repo?? Subsequent runs are very fast.. must be cached locally?

Is there a better way of getting info about pakfire packages?

What sort of info is it that you are trying to obtain?

The “summary” field from pakfire info

I want to know what eg. iftop actually is without having to google around.

Name: iftop
Summary: Real-Time Interface Bandwidth Usage

The simplest way is to look at the list of addons in the IPFire documentation.

https://www.ipfire.org/docs/addons

If you want to know the specific SUMMARY entry then the simplest way would be to clone the IPFire repo on a system and then use grep or awk or… on the files in the lfs/ directory to search for the files that contain PAK_VER (which means they are an addon) and then prints the SUMMARY line to a file.

3 Likes

Thanks. The addons link describes most of the packages.

The ones that it doesn’t describe are not intended to be addons in their own right. They will be dependencies for the intended addons.

2 Likes