Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3560

System and Network configuration • Apt-file search for multiple branches

$
0
0
Is there a way to make apt-file:
1) display the suite in the output line
2) display all the matching suites
Not that I am aware of.
apt-file is a perl script, so one could modify it to do that... Given sufficient motivation, which I most certainly do not have. :P

Ed. With other things done, I am now apparently bored enough for a bit of lazy brute-force POC bash though... Kinda slow since it runs apt-file for each suite, but meh, it's not something you're going to run often.

~./bash_aliases:

Code:

function apt-file-search_all() {    search=${1:?No search term}    for suite in $( apt-get indextargets --format '$(CODENAME)' "Identifier: Contents-deb" | uniq ); do        readarray -t matches < <( apt-file search ${search} --filter-suites=${suite} )        printf "${suite}: %s\n" "${matches[@]}"    done}
Result:

Code:

$ apt-file-search_all rtw8852b_fw-1.bindaedalus: daedalus-security: daedalus-updates: daedalus-backports: ceres: firmware-realtek: /usr/lib/firmware/rtw89/rtw8852b_fw-1.bin
Yes, I'm running Devuan. Deal with it. :P
Thanks :-) Nice hack. :D

Statistics: Posted by Aki — 2024-01-06 09:29 — Replies 4 — Views 193



Viewing all articles
Browse latest Browse all 3560

Trending Articles