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.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 28847 invoked from network); 31 Mar 2021 19:33:50 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 31 Mar 2021 19:33:50 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id fb85fece for ; Wed, 31 Mar 2021 14:33:48 -0500 (EST) Received: from mail1.systemli.org (mail1.systemli.org [212.103.72.247]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id f92650e2 for ; Wed, 31 Mar 2021 14:33:47 -0500 (EST) Subject: Re: [PATCH makewhatis] add NIXSTOREDIR configuration variable to support NixOS DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemli.org; s=default; t=1617219225; bh=VIU/V6gvxtXOMUEZfo2c4n+EyfHSZIWAayhTCz3JwUg=; h=Subject:To:References:From:Date:In-Reply-To:From; b=lRYXIJ1hhbvD/luEAUT+myZcgsYOQkNnXRoAWkv/EZAzfHVdRmn2KmEooFkqxJyQy cpkk+q5n49nMVmv8bJvFvi8Zt8K/36sHZzljmpuhDaCVdseRRERVkori7GcJ2tBb/n iz5lnxiz5MZu0kZ/dUF91fUhWkMiFuEmrVsBa5V6ZfBevmjLDZhZFW+BoaM+BEU9uh BUn64dy41ouZTbIeGfm+Kc6aC/7EFtVr9ccXSHYLP3oOUSsq0YA6qAEfB+ThYSeSxj EdTx7ir+0grBFSXfsWB0jRbOETiouf9Uu1VrpCF4XIMEV7gfnpnbFGZ2wVV44jtKJN 8KQ+mxczlhN/g== To: tech@mandoc.bsd.lv References: <8bce7cc9-954e-1c28-ee25-13969f66eb20@systemli.org> <20210330203020.GA94101@athene.usta.de> <060f9222-a388-a9fa-dc34-8f1981f8bf65@systemli.org> <20210331173434.GA57338@athene.usta.de> From: sternenseemann Message-ID: Date: Wed, 31 Mar 2021 21:33:43 +0200 X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 In-Reply-To: <20210331173434.GA57338@athene.usta.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Ingo, On 3/31/21 7:34 PM, Ingo Schwarze wrote: > 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; > } I really like that idea! I initially considered something like this, but shied away from it as it requires you to make some implementation choice and having proper arrays in preprocessor macros is never nice. It adds some extra overhead, I guess, but in comparison to all the IO makewhatis has to do this should be practically nothing. > 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? Seems concise and expressive enough. However I feel like it may hinder discoverability of this option if it doesn't refer to makewhatis at all. > 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. Sounds like a good idea! If everything goes according to (my) plan, it should be possible to configure mandoc as default viewer and searcher just as easily as man-db. I can offer to report back at some point when the dust has settled, so you don't have to dig through unfamiliar documentation etc. Cheers, Lukas -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv