GNU bug report logs -
#77037
[PATCH] services: `file-database-mcron-jobs' search updatedb in package field
Previous Next
Full log
Message #11 received at 77037 <at> debbugs.gnu.org (full text, mbox):
`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' in 'sbin/updatedb'.
Fallback to 'sbin/' if 'updatedb' is not found in 'bin/'.
* gnu/services/admin.scm (file-database-mcron-jobs): locate 'updatedb' binary.
Change-Id: Ic741716044be3a8f51a157510f9f923bd66c41d7
---
gnu/services/admin.scm | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm
index e4737940438..0eb38555951 100644
--- a/gnu/services/admin.scm
+++ b/gnu/services/admin.scm
@@ -448,8 +448,8 @@ (define-configuration/no-serialization file-database-configuration
(if target
findutils
(canonical-package findutils))))
- "The GNU <at> tie{}Findutils package from which the @command{updatedb} command
-is taken.")
+ "The package from which the @command{updatedb} command is taken.
+Examples of such packages are GNU <at> tie{}Findutils and Plocate.")
(schedule
(string-or-gexp %default-file-database-update-schedule)
"String or G-exp denoting an mcron schedule for the periodic
@@ -468,15 +468,20 @@ (define (file-database-shepherd-services configuration)
(let ((updatedb (program-file
"updatedb"
#~(begin
+ (define updatedb
+ (let ((try (lambda (file)
+ (and (file-exists? file) file))))
+ (or (try #$(file-append package "/bin/updatedb"))
+ (try #$(file-append package "/sbin/updatedb")))))
;; 'updatedb' is a shell script that expects various
;; commands in $PATH.
(setenv "PATH"
- (string-append #$package "/bin:"
+ (string-append (dirname updatedb) ":"
#$(canonical-package coreutils)
"/bin:"
#$(canonical-package sed)
"/bin"))
- (execl #$(file-append package "/bin/updatedb")
+ (execl updatedb
"updatedb"
#$(string-append "--prunepaths="
(string-join
base-commit: 71ae6f2a191e715c96b02e876f5e40e4932debd8
--
2.49.0
This bug report was last modified 108 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.