zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: [EXTERNAL] Re: Unexpected installation of SQLite during "sudo dnf autoremove" command
Date: Tue, 11 Jul 2023 19:17:28 +0900	[thread overview]
Message-ID: <1A6F7F91-221C-465E-B630-99FADFD8DDC7@kba.biglobe.ne.jp> (raw)
In-Reply-To: <BE1P281MB2593EBF3C354B13BB73BF4A3DC31A@BE1P281MB2593.DEUP281.PROD.OUTLOOK.COM>


> 2023/07/11 17:12、Mirko Matošin <mirko.matosin@zimmer-group.com>のメール:
> 
> As soon as i hit tab after autoremove it wants to install sqlite

In my case I get:

Install package 'sqlite' to provide command 'sqlite3'? [N/y]

and just hitting RETURN does not install sqlite
(although the screen is rather cluttered).

> 2023/07/11 17:46、Roman Perepelitsa <roman.perepelitsa@gmail.com>のメール:
> 
> I see that Completion/Redhat/Command/_dnf invokes sqlite3
> conditionally if /var/cache/dnf/packages.db exists.

So we can avoid calling sqlite3 if the command is not available,
as in the patch below.

But the completion is somewhat faster if you have sqlite3 command
(one or two seconds vs. almost instant?).

What is the best way to inform users that installing sqlite package
will make the completion (somewhat) faster?

Or is the completion reasonably fast even without sqlite3?

# If I remember correctly, a few or several years ago, completing
# package names without sqlite3 was much slower (this may be just my
# wrong memory). But anyway it is still slower 


diff --git a/Completion/Redhat/Command/_dnf b/Completion/Redhat/Command/_dnf
index ce111f38f..3fbd73352 100644
--- a/Completion/Redhat/Command/_dnf
+++ b/Completion/Redhat/Command/_dnf
@@ -40,7 +40,7 @@ _dnf_packages() {
   selected=$selected[2]
   if [[ $selected = upgradable ]]; then
     pkgs=( $(_dnf_helper upgrade) )
-  elif [[ -r $cache_file ]]; then
+  elif [[ -r $cache_file && -n $commands[sqlite3] ]]; then
     local table=$selected
     # 'available' table contains both 'available' and 'installed' packages
     [[ $selected = all ]] && table=available



  parent reply	other threads:[~2023-07-11 10:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <66435637-82c1-464e-85fb-bd3cd485052e.f0af137d-67f0-47ab-b7f8-5e0e70df6b34.3dfd4d24-34e4-4553-a1f5-ce63b21694b3@emailsignatures365.codetwo.com>
     [not found] ` <66435637-82c1-464e-85fb-bd3cd485052e.95e17f34-409d-4b8c-b99b-e6635451f7ff.245922ee-0718-4a4c-94a2-58ad892ba0fd@emailsignatures365.codetwo.com>
2023-07-11  8:02   ` Mirko Matošin
2023-07-11  8:08     ` Roman Perepelitsa
2023-07-11  8:09       ` AW: [EXTERNAL] " Mirko Matošin
2023-07-11  8:12       ` Mirko Matošin
2023-07-11  8:46         ` Roman Perepelitsa
2023-07-11 10:17         ` Jun T [this message]
2023-07-11 10:23           ` Jun T
2023-07-11 16:25         ` Bart Schaefer
2023-07-11 20:53           ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1A6F7F91-221C-465E-B630-99FADFD8DDC7@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).