<div dir="ltr"><div><br><br>On Sun, Oct 4, 2015 at 8:30 AM, Martin Landa <<a href="mailto:landa.martin@gmail.com">landa.martin@gmail.com</a>> wrote:<br>> when trying to fix all compilation and installation issues I replaced<br>> get_lib_path() by set_path() [1]. These functions are not used in<br>> GRASS core codebase. Their usage is not clear to me.<br><br></div><div>The replacement was probably a good choice. In theory they could be used in core, but core scripts are usually shorter, so they fit to one file. Addons are larger, so they need libraries/packages/modules.<br></div><div><br>> Fn get_lib_path() says "Return the path of the libname contained in<br>> the module". So I would expect that it checkd that `modname` is a<br>> directory and contains `libname` Python module. But 'libname' is just<br>> used to check if it's a directory [2].<br><br></div>Not sure if I can actually clarify. However, when running module which has libraries when running it directly from source, when using make, and when it is installed in addons one needs different path setup or imports. Theget_lib_path() finds where the library/package/module is. By itself get_lib_path(), it required still some set up, so set_path() was added. What the functions should be actually doing and what part of what they are doing is useless is unclear. All depends on also on makefiles and that's the reason for #2132 [1] as well as for r66411 [2], I suppose.<br><div><br>> Only one function calls get_lib_path() - set_path() [3].<br><br></div><div>That's right. There is no need to call it anywhere else. get_lib_path() is used to get the existing/right path to the library.<br></div><div><br>> Can anybody here to clarify their usage?<br><br></div><div>Every time I've tried to make to understand it I failed. I've tried to make it work for different published and unpublsised addons and what works on one occasion (e.g. local make) did not work in other (e.g. addons). I guess good example of the same is log of the r.modis addon makefiles [3, 4] as well as import changes.<br></div><div><br></div><div>Sorry,<br></div><div>Vaclav<br></div><div><br>[1] <a href="https://trac.osgeo.org/grass/ticket/2132">https://trac.osgeo.org/grass/ticket/2132</a><br>[2] <a href="https://trac.osgeo.org/grass/changeset/66411">https://trac.osgeo.org/grass/changeset/66411</a><br>[3] <a href="https://trac.osgeo.org/grass/log/grass-addons/grass7/raster/r.modis/Makefile">https://trac.osgeo.org/grass/log/grass-addons/grass7/raster/r.modis/Makefile</a><br>[4] <a href="https://trac.osgeo.org/grass/log/grass-addons/grass7/raster/r.modis/libmodis/Makefile">https://trac.osgeo.org/grass/log/grass-addons/grass7/raster/r.modis/libmodis/Makefile</a><br><br>> Thanks, Martin<br>><br>> [1] <a href="https://trac.osgeo.org/grass/changeset/66408">https://trac.osgeo.org/grass/changeset/66408</a><br>> [2] <a href="https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/utils.py#L303">https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/utils.py#L303</a><br>> [3] <a href="https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/utils.py#L319">https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/utils.py#L319</a><br><br><br></div></div>