all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Pierre Neidhardt <mail@ambrevar.xyz>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Package file indexing
Date: Thu, 2 Jan 2020 23:50:30 +0100	[thread overview]
Message-ID: <CAJ3okZ1feq8tES+qk8=Cpv4ySVJ84g1-UFDPSFgreRU6BhODiA@mail.gmail.com> (raw)
In-Reply-To: <87imlt3hr2.fsf@ambrevar.xyz>

Hi,

On Thu, 2 Jan 2020 at 18:12, Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> Last but not least: previously we suggested adding a subcommand like
> "guix which" or "guix filesearch".  In another thread, Simon suggested
> that this would be a bad idea and factoring the file search into "guix
> search" is probably better.

It appears to me better for 2 reasons:
 1. because obviously "filesearch" is a kind of "search" ;-) so it
adds consistency.
 2. because it allows (in the near future) mixed research: "guix
search bin/hg python" applying the "python" filter only to the
packages returned by "bin/hg". And "guix search python bin/hg" search
the binary file "hg" only to the packages matching "python.


> For instance, we could do
>
>   guix search bin/foo
>
> and it would report the packages containing the "bin/foo" path.  This
> could mean that we need to adapt the output to display the file listing
> as well.  If listing all files would be too verbose, we can list only
> the matching files:
>
> --8<---------------cut here---------------start------------->8---
> name: jami

[...]

> filepaths:
> + bin/foo
> + share/bar/bin/foo-blah
> relevance: 24
> --8<---------------cut here---------------end--------------->8---

How do you compute the relevance/score?

Currently, when searching with regexp, the relevance is computed by
counting the number of matches applying different weights depending on
if the match is about name, synopsis, description, etc. It is not
perfect and there is room of improvements as discussed elsewhere, but
it works (nicely when you know what you are searching ;-).

For example, let consider 2 packages:

 a- 'bin/foo'
 b- 'share/baz/bin/foo'

How to do you order/score the result? What do you expect first? The
package a- I guess.
Therefore, weight should be applied, isn't it?



> That said, some terms may match too frequently.  For instance, "guix
> search lib" would match almost all packages that have libraries and
> result in a huge, useless output.
>
> I suggest the following:
>
> - Add a "--search-file-paths=[auto|on|off]" option.

I do not find this option name explaining by itself. Personally, I am
inclined to provide a path to the option and not a boolean.

> - When --search-file-paths is "auto", file paths are automatically
>   searched for against terms that contain a slash.  E.g. "lib" won't
>   return file paths but "lib/" will.

This should be cool.
With regexp too.

Time to time, I am looking for header C file or latex style but I do
not know the path. I would like to have something like:

  guix search gmsh.h
or
 guix search ieee*.sty


> Another feature that could be nice: list the file paths for the given
> packages.
> I think we need a separate subcommand for this, e.g. "guix list-files".

Yes, cool!


IMHO, it should be included under "guix package", i.e.,

  guix package gmsh --list-files

should returns something like:

--8<---------------cut here---------------start------------->8---
bin/gmsh
share/applications/gmsh.desktop
share/doc/gmsh/README.Debian
share/doc/gmsh/TODO.Debian
share/doc/gmsh/changelog.Debian.gz
share/doc/gmsh/changelog.gz
share/doc/gmsh/copyright
share/info/gmsh.info.gz
share/man/man1/gmsh.1.gz
share/pixmaps/gmsh_16x16.xpm
share/pixmaps/gmsh_32x32.xpm
--8<---------------cut here---------------end--------------->8---

(list from https://packages.debian.org/buster/amd64/gmsh/filelist)


All the best,
simon

  parent reply	other threads:[~2020-01-02 22:50 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 18:31 Improve package search mikadoZero
2019-03-14 20:49 ` Leo Famulari
2019-03-14 22:01   ` Tobias Geerinckx-Rice
2019-03-14 22:09     ` Tobias Geerinckx-Rice
2019-03-14 22:46     ` Pierre Neidhardt
2019-03-14 23:09       ` Tobias Geerinckx-Rice
2019-03-23 16:27       ` Package file indexing Ludovic Courtès
2019-03-25  8:46         ` Pierre Neidhardt
2019-03-26 12:41           ` Ludovic Courtès
2020-01-02 17:12             ` Pierre Neidhardt
2020-01-02 19:15               ` Christopher Baines
2020-01-03 11:26                 ` Ludovic Courtès
2020-01-09 11:19                   ` Pierre Neidhardt
2020-01-09 12:24                     ` zimoun
2020-01-09 13:01                       ` Pierre Neidhardt
2020-01-09 16:49                     ` Christopher Baines
2020-01-10 12:35                       ` Pierre Neidhardt
2020-01-10 13:30                         ` Christopher Baines
2020-01-11 18:26                           ` Pierre Neidhardt
2020-01-12 13:29                             ` Christopher Baines
2020-01-13 14:28                               ` Pierre Neidhardt
2020-01-13 17:57                                 ` Christopher Baines
2020-01-13 18:21                                   ` Pierre Neidhardt
2020-01-13 19:45                                     ` Christopher Baines
2020-01-14  9:21                                       ` Pierre Neidhardt
2020-01-02 22:50               ` zimoun [this message]
2020-01-03 16:00                 ` raingloom
2020-01-06 16:56                   ` zimoun
2020-01-09 13:01                     ` Pierre Neidhardt
2020-01-09 13:53                       ` zimoun
2020-01-09 14:14                         ` Pierre Neidhardt
2020-01-09 14:36                           ` zimoun
2020-01-09 15:38                             ` Pierre Neidhardt
2020-01-09 16:59                               ` zimoun
2020-01-09 12:57                   ` Pierre Neidhardt
2020-01-09 12:55                 ` Pierre Neidhardt
2020-01-09 14:05                   ` zimoun
2020-01-09 14:21                     ` Pierre Neidhardt
2020-01-09 14:51                       ` zimoun
2020-01-09 15:41                         ` Pierre Neidhardt
2020-01-09 17:04                           ` zimoun
2020-01-09 17:27                             ` Pierre Neidhardt
2020-01-15 16:23         ` Pierre Neidhardt
2020-01-15 17:27           ` Nicolò Balzarotti
2020-01-15 18:02             ` Pierre Neidhardt
2020-01-15 22:14               ` Ludovic Courtès
2019-03-16  2:11     ` Improve package search mikadoZero

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='CAJ3okZ1feq8tES+qk8=Cpv4ySVJ84g1-UFDPSFgreRU6BhODiA@mail.gmail.com' \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=mail@ambrevar.xyz \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.