Resolution of the library-path mess

Eric S. Raymond esr at thyrsus.com
Mon Oct 2 03:43:20 UTC 2017


Fred Wright via devel <devel at ntpsec.org>:
> 
> On Sun, 1 Oct 2017, Eric S. Raymond via devel wrote:
> 
> > Gary E. Miller via devel <devel at ntpsec.org>:
> > > How do you plan that a local NTPsec install from source does not
> > > overwite an NTPsec install from the native OS repositories?
> >
> > That now will never happen if the /usr/local/lb/python-X.Y directory exists;
> > the install logic will notice that.
> 
> That of course assumes that if the directory exists, it's in sys.path.
> Perhaps that's a reasonable assumption, though it's hard to be sure.

Duh.  I should have added that check.  Doing it now.

> > I'll add language to INSTALL that one should make sure this directory
> > exists so as not to step on any distribution copy of the ntp library.
> 
> Looking at:
> 
> +Thw function get_python_lib() in the Python distutils library is the
> +only reliable way to know where in fact the ntp Python librarty can
> +installed; it normally returns sometyhing under /usr/lib.
> 
> Aside from the typos, the last statement only seems to be true of Linux;
> *BSD returns something under /usr/local/lib, and OSX uses something
> totally different.  So get_python_lib() has no FHS issues outside Linux.

I've notes that in the documentation.

> Note that both the original and updated versions of massage() replace
> BSD's /usr/local/lib with /usr/local/local/lib, which is certainly
> undesirable, though I suppose the existence test will probably fail on the
> result.  It might be better to test for /usr/<not local>/ before munging
> anything.

Hm, I just realized that what I should be checking there isn't /usr
but sys.prefix - which will normally be /usr under Linux, but might be
/usr/local under *BSD.  That should make the transformation into a no-op
in the case you just pointed out.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.




More information about the devel mailing list