It seems like mlocate uses PATH_MAX, which isn't defined on the hurd. Attached you'll find a patch that fixes this.
This is also Debian bug #610209, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610209
remove PATH_MAX usage mlocate-fix-unconditional-PATH_MAX-use.patch
Thanks for the patch.
mlocate is trying hard to be portable:
pathconf (_PC_PATH_MAX,
)
size
PATH_MAX
BUFSIZ
#ifdef
realpath (
, NULL)
canonicalize_file_name ()
?:
if ()
else
Could you send an updated patch that was tested on Hurd, please?
attachment fix_FTBFS4Hurd.patch
Attaching a new patch for GNU/Hurd. The patched mlocate has been running on GNU/Linux amd64 and on GNU/Hurd for a week now. No problems so far.
Avoid use of PATH_MAX hurd.patch
Thanks for the patch. canonicalize_file_name is already provided to mlocate by gnulib, and the resulting path needs to be freed.
canonicalize_file_name
Please test the attached patch on Hurd and tell me whether it works fine.
I will test your patch and will report soon. Thanks!
There are two instances of buf that need to be changed from readline to canonicalize_file_name. The second one is in function rebuild_bind_mount_paths:
--- updatedb.c.patched 2011-12-10 18:17:16.000000000 +0100 +++ updatedb.c.new 2011-12-11 10:44:14.000000000 +0100 @@ -379,9 +379,8 @@ if (hasmntopt (me, "bind") != NULL && strcmp (me->mnt_fsname, me->mnt_dir) != 0) { - char dbuf[PATH_MAX], dir; - - dir = realpath (me->mnt_dir, dbuf); + char dir; + dir = canonicalize_file_name (me->mnt_dir); if (dir == NULL) dir = me->mnt_dir; if (conf_debug_pruning != false)
And that one has to be freed too??
attachment hurd_new.patch
Sorry, the posting above was scrambled. I have attached a complete updated patch. It it OK with you?
Replying to [comment:6 svantes]:
Sorry, the posting above was scrambled. I have attached a complete updated patch. Is it OK with you?
Sorry, I forgot the first part of the patch: src/conf.c. Of course it has to be included too.
Thanks for testing. The patch was against the upstream development tree, which does not use PATH_MAX in rebuild_bind_mount_paths any more, I apologize for the confusion.
rebuild_bind_mount_paths
I have applied the "hurd.patch".
Replying to [comment:8 mitr]:
Released in mlocate-0.25; please reopen if this is insufficient.
Thanks again for the patches.
Metadata Update from @svantes: - Issue assigned to mitr