The officially official Devuan Forum!

You are not logged in.

#1 2024-11-05 09:26:11

chomwitt
Member
Registered: 2019-09-24
Posts: 130  

Better argument handling from apt-cache ?

I think there are various idiosyncracies in apt utilities that hinder their use.
I must do work(1) before using one tool or one of the tool options to be sure
if it uses glob or regex and if it tries to substitute the first with the latter
if the first wont be successfull. And of couse in doing that (using
a failed glob as a regex) more idiosyncracies creep in.

Also that is one class of idiosyncracies (argument type handling) .
I had (have) issues with not knowing what is exactly the search
space of a certain argument . Does it search the package name only
or also in other fields ? My experience again warns me to be
cautios and investigate further many times.

I would hope a utility could be more transparent toward
the sysadm about what type of argument it accepts and
what it does with that.
I wonder if such an endeavor would interest anyone. Also
i wonder if the language implementing the utilities hinders
or not a less frictioned use.

(1) And by work i hopped it meant just looking up the man page .
I find my self doing various tests to understand what happens
in each case.

--------- examples ---------
-------------- search space idiosyncracies ------

$ sudo apt-cache -n search  '.*aa$'      / although i used -n  apt-cache give me in the result package names not matching my regex.

-------------- pattern type handling idiosyncracies ------

$ sudo apt-cache  policy  'freeb.*'     / uses regex
$ sudo apt-cache  policy  'freeb*'      / uses glob
$ sudo apt-cache showpkg '*aaa*    /
$ sudo apt-cache showpkg '^aa.*' | grep '^Package'      // regex

$ sudo apt-get install pattern          / will report in its result if it uses the pattern as a glob or as a regex.  Which i found it helpfull.

Last edited by chomwitt (2024-11-05 14:48:59)


Devuan(Chimaera)(Daedalus)  DS+WM: XorgX11server+StumpVM

Offline

#2 2024-11-05 10:33:48

EDX-0
Member
Registered: 2020-12-12
Posts: 81  

Re: Better argument handling from apt-cache ?

apt-cache and apt search are annoying in their own way that usually searching through them fells tedious to pointless as it takes more time crafting a regex than it may be worth, that is a solid reason as for why i don't even bother using them directly anymore and simply use apt-ui from https://github.com/eylles/devuan-scripts it uses fzf to fuzzy filter by name AND description through all the packages apt-cache knows of.

Offline

#3 2024-11-05 11:07:21

stargate-sg1-cheyenne-mtn
Member
Registered: 2023-11-27
Posts: 190  

Re: Better argument handling from apt-cache ?


Be Excellent to each other and Party On!
https://www.youtube.com/watch?v=rph_1DODXDU
https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!

Offline

Board footer