On 30 January 2014 07:30, Gary V. Vaughan <g...@vaughan.pe> wrote:
> Hi Hisham,
>
> On Jan 30, 2014, at 9:26 AM, Hisham <h...@hisham.hm> wrote:
>> On 29 January 2014 18:12, Gary V. Vaughan <g...@vaughan.pe> wrote:
>>>> On Jan 30, 2014, at 5:19 AM, Hisham <h...@hisham.hm> wrote:
>>>>> On 26 January 2014 23:38, Gary V. Vaughan <g...@vaughan.pe> wrote:
>>>>> For rocks that provide scripts in bin, luarocks copies those out to 
>>>>> $TREE_ROOT/bin, but there's currently no way to add Unix man pages.  
>>>>> Rather than special-casing certain directories, such as 'man' in the 
>>>>> installed rock package trees (although that would be a useful feature in 
>>>>> itself for more than just manual page hierarchies) I think it would be 
>>>>> super-useful to have `luarocks path` set the MANPATH environment to 
>>>>> include any install luarocks with top-level `man` directories.
>>>>>
>>>>> As long as the installed rocks have `man` in install.copy_directories, 
>>>>> and run "eval `luarocks path`" anyway, this puts manual pages where the 
>>>>> `man` command can find them for free.
>>>>>
>>>>> Thoughts?
>>>>
>>>> The problem is that entries under bin/, share/lua/5.x/ and lib/lua/5.x
>>>> are deployed to common directories, so that a single entry for them
>>>> can be added to the appropriate path variables. Other files in the
>>>> rock are not deployed like that, they are stored separately per-rock
>>>> under lib/luarocks/rocks-5.x/<rock_name>/ so you have tens (or
>>>> hundreds) of doc (or man) directories. So, it's not feasible to add
>>>> them all to MANPATH one by one
>>>
>>> Why not? Only the rocks that ship man pages in a 'man' directory will need 
>>> to be added, and even a few dozen extra paths on MANPATH is better that not 
>>> being able to read man pages - except by writing a script to search rocks 
>>> trees manually and add those same paths to MANPATH by yourself.
>>>
>>>> (and the result of eval `luarocks path`
>>>> would be out of date as soon as you installed another rock, anyway).
>>>
>>> Until you run luarocks path again :-)
>>
>> That's not much better than having that extra script to scan and
>> update the MANPATH. It's the kind of thing that could exist outside of
>> LuaRocks.
>
> It's a lot better IMHO.
>
> The tool that everyone uses to set their paths up so that things work from 
> the command line normally is the right place to do this.  LuaRocks already 
> emits a unix shell eval-able snippet with `luarocks path`, and has all the 
> support code to find all the man directories in the installed rocks trees.
>
> To do it outside of luarocks is not only to rewrite all the rocks trees 
> digging code in order to find the man directories, and an extra command to 
> run after luarocks path to set up the MANPATH again, but is another tool that 
> has to be shared among luarocks users that want man to integrate with 
> luarocks, or worse rewritten several times by people who want it but don't 
> know someone else did it already.
>
> In principle, would you accept a pull request if I did the work (though I 
> know the internals of LuaRocks almost not at all, so I might need some 
> pointers and a bit of help here and there)?

And will you maintain it afterwards? (IOW, can I ping you if bug
reports about it come up?)

The way to go about it would be to add an optional flag `--man` to
luarocks/path.lua (like we have with `--bin`) and also, for
consistency, to add knowledge about man pages to luarocks/doc.lua
(though I really don't want to spread logic on finding the `man`
binary all over the place, the way we did it for the web browser. Just
assume you can os.execute("man ...") if cfg.is_platform("unix")
returns true).

-- Hisham

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to