[Git][NTPsec/ntpsec][master] Polish library path resolution and docs.

Eric S. Raymond gitlab at mg.gitlab.com
Mon Oct 2 04:19:12 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
5ae1ace5 by Eric S. Raymond at 2017-10-02T00:18:07-04:00
Polish library path resolution and docs.

- - - - -


3 changed files:

- INSTALL
- packaging/packaging.txt
- wafhelpers/fix_python_config.py


Changes:

=====================================
INSTALL
=====================================
--- a/INSTALL
+++ b/INSTALL
@@ -186,11 +186,11 @@ Due to a limitation of the Python distutils library, if you install
 from the source distribution with prefix set to a value other than
 /usr (in particular, if it's the default value /usr/local), that
 prefix will be honored *only if the corresponding Python library
-directory already exists*. Otherwise the install will drop the ntp
-Python library in /usr/lib. This layout may violate the Linux File
-Hierarchy Standard.
+directory already exists*. Otherwise, under Linux, the install will
+drop the ntp Python library in /usr/lib. This layout may violate the
+Linux File Hierarchy Standard.
 
-You should have neither issue if you installl from an OS distribution's
+You should have neither issue if you install from an OS distribution's
 binary package.
 
 == Caveat for Crossbuilders ==


=====================================
packaging/packaging.txt
=====================================
--- a/packaging/packaging.txt
+++ b/packaging/packaging.txt
@@ -14,11 +14,11 @@ or ntp.d in place. Your installable package should do this.
 The reason this is so is that NTPsec does not yet have an authorized
 pool group of its own. This may change in the future.
 
-== FHS noncompilance ==
+== FHS noncompliance under Linux ==
 
 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.
+only reliable way to know where in fact the ntp Python library can
+installed; Under Linux, it normally returns something under /usr/lib. 
 
 Thus, if you install from the source distribution with prefix set to
 a value other than /usr - in particular, if it's the default value
@@ -28,9 +28,9 @@ anyway, violating the Linux File Hierarchy Standard.
 We say 'may' because if the Python library directory corresponding
 to the prefixed library path already exists it will be used.
 
-Your installable package should arrange library installation to
-comply with the FHS.  If you are using --prefix=/usr this should
-not require special action.
+Your installable package should arrange library installation to comply
+with the FHS.  If you are using --prefix=/usr (or, more generally, rge
+default sys.prefix) this should not require special action.
 
 == Platforms without Python ==
 


=====================================
wafhelpers/fix_python_config.py
=====================================
--- a/wafhelpers/fix_python_config.py
+++ b/wafhelpers/fix_python_config.py
@@ -1,6 +1,6 @@
 """Work around waf bugs related to Python config setup."""
 
-import os
+import os, sys
 
 from waflib import Utils  # pylint: disable=import-error
 from waflib.Logs import pprint  # pylint: disable=import-error
@@ -55,10 +55,10 @@ class FixConfig(object):
 
     def massage(self, path):
         "Massage Python library path to get around upstream bug."
-        # This will produce an FHS-compliant insrallation if the
+        # This will produce an FHS-compliant installation if the
         # proper local path pre-exists.
-        localized = path.replace('/usr', self.conf.env.PREFIX)
-        if os.path.exists(localized):
+        localized = path.replace(sys.prefix, self.conf.env.PREFIX)
+        if os.path.exists(localized) and localized in sys.path:
             return localized
         else:
             return path



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/5ae1ace5aedd71b4ca9e2dcbd69e6f729f5f3747

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/5ae1ace5aedd71b4ca9e2dcbd69e6f729f5f3747
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20171002/a6c6272a/attachment.html>


More information about the vc mailing list