From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15238 invoked from network); 31 Mar 2021 17:34:41 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 31 Mar 2021 17:34:41 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 991fb0d2 for ; Wed, 31 Mar 2021 12:34:38 -0500 (EST) Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 3d65618f for ; Wed, 31 Mar 2021 12:34:38 -0500 (EST) Received: from hekate.asta.kit.edu ([141.3.145.153] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1lRejk-0000kM-Ou; Wed, 31 Mar 2021 19:34:37 +0200 Received: from donnerwolke.asta.kit.edu ([141.3.145.61] helo=donnerwolke.usta.de) by hekate.usta.de with esmtp (Exim 4.92.2) (envelope-from ) id 1lRejj-0004hc-1R; Wed, 31 Mar 2021 19:34:35 +0200 Received: from athene.asta.kit.edu ([141.3.145.60] helo=athene.usta.de) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1lReji-0000R1-T1; Wed, 31 Mar 2021 19:34:35 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 2f7fa7dd; Wed, 31 Mar 2021 19:34:34 +0200 (CEST) Date: Wed, 31 Mar 2021 19:34:34 +0200 From: Ingo Schwarze To: sternenseemann@systemli.org Cc: tech@mandoc.bsd.lv Subject: Re: [PATCH makewhatis] add NIXSTOREDIR configuration variable to support NixOS Message-ID: <20210331173434.GA57338@athene.usta.de> References: <8bce7cc9-954e-1c28-ee25-13969f66eb20@systemli.org> <20210330203020.GA94101@athene.usta.de> <060f9222-a388-a9fa-dc34-8f1981f8bf65@systemli.org> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <060f9222-a388-a9fa-dc34-8f1981f8bf65@systemli.org> User-Agent: Mutt/1.12.2 (2019-09-21) Hi Lukas, Earendil wrote on Tue, Mar 30, 2021 at 11:03:53PM +0200: > On 3/30/21 10:30 PM, Ingo Schwarze wrote: >> We could of course rename the variable to something more generic, >> *if* a generic name for this concepts exists or can be invented >> in a reasonable way. > That would of course be nice. Mayeb something along the lines of > EXTRA_BASEDIR I don't like that. The word "basedir" is jargon only used in the source code in the file mandocdb.c (admittedly, it also appears in an error message there, so the user may see it, which is probably not good). The documentation calls more or less the same thing "manpath", see the manual page man.conf(5), and the related environment variable MANPATH, see the manual pages man(1) and apropos(1). But the configuration variable we are trying to name does not point to a manpath, so its name should not contain the words "manpath" or "basedir". A manpath contains man[1-9] and optionally cat[1-9] subdirecties and nothing else, which is not the case for a homebrew cellar nor for /nix/store/. Yes, there may be some manual pages inside /nix/store/, among many other things, but not in a manpath structure. > or SYMLINK_TARGET_EXCEPTION? A bit better, yes. But even though already long, it doesn't say which rule is being flouted, nor what the exception is, and that symlinks are involved is, in my opinion, not the most relevant part of this makewhatis(8) feature, even though symlinks certainly are relevant for the way it is used in Homebrew and NixOS. > Seems hard to name in a concise way though. I had one other idea while considering the naming. Why not allow FOO_PATH="/Homebrew/Cellar:/nix/store" and parse it like so (untested): const char *pb; size_t len; *pb = FOO_PATH; while (*pb != '\0') { len = strcspn(pb, ":"); if (strncmp(buf, pb, len) == 0) break; pb += len; pb += strspn(pb, ":"); } if (*pb == '\0' && strncmp(buf, basedir, basedir_len) != 0) { say(...); continue; } Now, how should that variable be called? * The name should end with "_PATH". * The makewhatis(8) program is allowed to read any files below this path, so the name should include "READ" and some word indicating permission. * Mentioning makewhatis in the name does not seem important. It is more or less clear anyway that man(1) itself can read anything given on the command line or found in the database, subject to file system permissions, of course. So, maybe: READ_ALLOWED_PATH What do you think? > It's no matter and nothing really too interesting happens there, just > wanted to link it for reference. That's good. I should also update the NixOS entries on https://mandoc.bsd.lv/ports.html but maybe wait for the dust to settle first. Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv