GNU bug report logs - #77037
[PATCH] services: `file-database-mcron-jobs' search updatedb in package field

Previous Next

Package: guix-patches;

Reported by: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>

Date: Sat, 15 Mar 2025 14:20:03 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 77037 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
Cc: 77037 <at> debbugs.gnu.org
Subject: Re: [bug#77037] [PATCH] services: `file-database-mcron-jobs' search
 updatedb in package field
Date: Sat, 15 Mar 2025 22:35:10 +0100
Hello,

Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com> skribis:

> `file-database-service-type' appends 'bin/updatedb' path to the `package'
> field provided by `file-database-configuration'. This prevents users from
> using alternate packages which also provide 'updatedb' but in a different
> location.
>
> For example, the `plocate' package installs 'updatedb' it in 'sbin/updatedb'.

I didn’t know about ‘plocate’.  :-)

Could yoiu add a line in the doc explicitly mentioning that ‘plocate’ is
supported, in addition to Findutils?

> +                         (let ((updatedb-bin #$(find (cut executable-file? <>)
> +                                                     (find-files (package-output (open-connection)
> +                                                                                 package)
> +                                                                 "^updatedb$"))))

This wouldn’t work for instance if ‘package’ hasn’t been built yet, and
also, it opens an extra connection to the daemon, which should be
avoided.

Instead, I’d write something like:

  (define updatedb
    (let ((try (lambda (file)
                 (and (file-exists? file) file))))
      (or (try #$(file-append package "/bin/updatedb"))
          (try #$(file-append package "/sbin/updatedb")))))

Could you send an updated patch?

Thanks,
Ludo’.




This bug report was last modified 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.