Web lists-archives.com

apt-* family: apt-cache pkgnames Easter Egg? (Was: need sources.list example [...])




Hi... By the time I worked my way through a response, I realize it was
too far off-topic for the subject line so it's its own thing now. :)


On 3/26/19, David <bouncingcats@xxxxxxxxx> wrote:
>
> The intention of apt is to provide an easier-to-use human interface
> to the most common operations, but its interface might
> be improved from time to time, so don't rely on it in scripts.
>
> Whereas the apt-* tools are intended to be powerful
> low-level tools to use in scripts, so their interfaces never change
> and they provide all functionality, but consequently they have many
> complex options.


PPS up top here... Actually... as I think on it some MORE... what I
just found (last part of what I wrote here)... is a little scary...
kinda-sorta. It hints that it's possible for everything like "apt-*
[operation]" (AND WHO KNOWS WHAT ALL ELSE) to be manipulated...
without User knowledge that it's even a possibility that needs
conscious security protection considerations at all times.

*hm... sorry.* :)

PPPS Some MORE thinking while repeatedly proofreading (to see what
common sense point I may be overlooking): Perhaps "apt-cache pkgnames"
is drawing from and then somehow expanding upon the functions of its
fellow family member, apt-file.

The original first part of the email...

VERY COOL. Your timing is impeccable. About 3 hours ago, I decided
it's time to buckle down and finally self-educate toward creating my
own first "real" script. Apt-get is my target. I'm going to take this
thread as a good sign. :)

As for the apt-* family, I spend *a lot* of time with apt-cache via
search, show, policy, and occasionally pkgnames (after it was
referenced on Debian-User at some point).

Also, the other day, I actively noticed that apt-listbugs has been
VERY quiet on Buster *for months*. Yay, Developers, because I remember
it often being quite chatty for Stretch!

Exiting Stage Right now... with an odd find that has happened more
than once recently...

I just accidentally tabbed twice instead of hitting "Enter" while
"apt-cache pkgnames apt" was on the command line. It happened because
I had just double-tabbed seconds before while only "apt" was on the
command line.

Upon double-tabbing, the "apt-cache pkgnames apt" query output was a
list of all the *personal, user-only generated text* files that begin
with "apt" within the directory where that command was (erroneously)
issued.

So I tried a different directory by testing it with a different file
name I knew was in there, i.e. "apt-cache pkgnames aaa".

On the *FIRST* double-tab clicks, pkgnames amended itself to and then
*HALTED* at "apt-cache pkgnames aaaBBBccc0"..

So I played along and double-tabbed again. "apt-cache pkgnames" then
provided all the files that started with its suggested "aaaBBBccc0" in
that second directory.

After thinking on it a second, I created a few more files named
aaaBBBcccXXX01.jpg, aaaBBBcccYYY02.jpg, and aaaBBBcccZZZ03.jpg. In
response to those new additions, "apt-cache pkgnames aaa" amended its
secondarily proffered query to a slightly shorter "aaaBBBccc" to
account for those new files.

What THAT does is additionally exhibit that "apt-cache pkgnames" flies
by the seat of its pants during double-tabbing. In other words, it
doesn't need another command, e.g. "updatedb", to be run first in
order to present all accurate possibilities at any given second in
Time.

That's a bit wicked strange. Kind of feels a little bit like a
seasonally appropriate Easter Egg, but I figure my not knowing about
it is possibly just me arriving at the party fashionably late as
usual. *grin*

PS Double-tabbing "apt-cache pkgnames aaaBBBccc" didn't send those
text file results to a ">" text file when asked to do so. A query
results filled text file *was* created when "Enter" was clicked
instead of double tabbing.

Cindy :)
-- 
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* what'd I break THIS time? *