[Git][NTPsec/ntpsec][fixinstall] Restored PYTHONPATH warnings

Ian Bruene gitlab at mg.gitlab.com
Mon Dec 11 18:48:18 UTC 2017


Ian Bruene pushed to branch fixinstall at NTPsec / ntpsec


Commits:
6ed790db by Ian Bruene at 2017-12-11T12:47:49-06:00
Restored PYTHONPATH warnings

- - - - -


10 changed files:

- INSTALL
- contrib/ntpheat
- contrib/ntpheatusb
- devel/testing.txt
- ntpclients/ntpdig.py
- ntpclients/ntploggps.py
- ntpclients/ntplogtemp.py
- ntpclients/ntpmon.py
- ntpclients/ntpq.py
- wscript


Changes:

=====================================
INSTALL
=====================================
--- a/INSTALL
+++ b/INSTALL
@@ -50,6 +50,14 @@ Python 2.x, x >= 6, or Python 3.x, x >= 3::
    Python 3.  Note that you will need both the ordinary Python
    installation and Python dev tools, if your OS makes such a
    distinction.
+   
+   Some OS distros won't find our installed python libraries.
+   Your shell may need something like this:
+     export PYTHONPATH=/usr/local/lib/python2.7/site-packages
+   CentOS 6 is using python 2.6
+     export PYTHONPATH=/usr/local/lib/python2.6/site-packages
+   (I put it in my .bashrc)
+
 
 argparse::
    Required for ntpviz when using Python version 2.6


=====================================
contrib/ntpheat
=====================================
--- a/contrib/ntpheat
+++ b/contrib/ntpheat
@@ -24,7 +24,8 @@ import time
 try:
     import ntp.util
 except ImportError as e:
-    sys.stderr.write("ntpheat: can't find Python NTP modules.\n%s\n" % e)
+    sys.stderr.write("ntpheat: can't find Python NTP modules. "
+                     "-- check PYTHONPATH.\n%s\n" % e)
     sys.exit(1)
 
 # Work with argvars


=====================================
contrib/ntpheatusb
=====================================
--- a/contrib/ntpheatusb
+++ b/contrib/ntpheatusb
@@ -37,7 +37,8 @@ import time
 try:
     import ntp.util
 except ImportError as e:
-    sys.stderr.write("ntpheatusb: can't find Python NTP modules.\n%s\n" % e)
+    sys.stderr.write("ntpheatusb: can't find Python NTP modules. "
+                     "-- check PYTHONPATH.\n%s\n" % e)
     sys.exit(1)
 
 


=====================================
devel/testing.txt
=====================================
--- a/devel/testing.txt
+++ b/devel/testing.txt
@@ -13,7 +13,7 @@ directory to build/main/ntpclients/ and run ./ntpq there. If you get a message
 that says
 
 ---------------------------------------------------------------------
-ntpq: can't find Python NTP library.
+ntpq: can't find Python NTP library. -- check PYTHONPATH.
 ---------------------------------------------------------------------
 
 you *may* have a problem.  A lot of what was C code in legacy versions


=====================================
ntpclients/ntpdig.py
=====================================
--- a/ntpclients/ntpdig.py
+++ b/ntpclients/ntpdig.py
@@ -52,7 +52,7 @@ try:
     import ntp.magic
 except ImportError as e:
     sys.stderr.write(
-        "ntpdig: can't find Python NTP library.\n")
+        "ntpdig: can't find Python NTP library -- check PYTHONPATH.\n")
     sys.stderr.write("%s\n" % e)
     sys.exit(1)
 


=====================================
ntpclients/ntploggps.py
=====================================
--- a/ntpclients/ntploggps.py
+++ b/ntpclients/ntploggps.py
@@ -33,7 +33,8 @@ try:
     package = 'NTP'  # pylint: disable=invalid-name
     import ntp.util
 except ImportError as e:
-    sys.stderr.write("ntploggps: can't find Python %s modules.\n" % package)
+    sys.stderr.write("ntploggps: can't find Python %s modules "
+                     "-- check PYTHONPATH.\n" % package)
     sys.stderr.write("%s\n" % e)
     sys.exit(1)
 


=====================================
ntpclients/ntplogtemp.py
=====================================
--- a/ntpclients/ntplogtemp.py
+++ b/ntpclients/ntplogtemp.py
@@ -34,7 +34,8 @@ import time
 try:
     import ntp.util
 except ImportError as e:
-    sys.stderr.write("ntplogtemp: can't find Python NTP modules.\n%s\n" % e)
+    sys.stderr.write("ntplogtemp: can't find Python NTP modules "
+                     "-- check PYTHONPATH.\n%s\n" % e)
     sys.exit(1)
 
 


=====================================
ntpclients/ntpmon.py
=====================================
--- a/ntpclients/ntpmon.py
+++ b/ntpclients/ntpmon.py
@@ -40,7 +40,7 @@ try:
     import ntp.magic
 except ImportError as e:
     sys.stderr.write(
-        "ntpmon: can't find Python NTP library.\n")
+        "ntpmon: can't find Python NTP library -- check PYTHONPATH.\n")
     sys.stderr.write("%s\n" % e)
     sys.exit(1)
 


=====================================
ntpclients/ntpq.py
=====================================
--- a/ntpclients/ntpq.py
+++ b/ntpclients/ntpq.py
@@ -30,7 +30,7 @@ try:
     import ntp.version
 except ImportError as e:
     sys.stderr.write(
-        "ntpq: can't find Python NTP library.\n")
+        "ntpq: can't find Python NTP library -- check PYTHONPATH.\n")
     sys.stderr.write("%s\n" % e)
     sys.exit(1)
 


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -1120,9 +1120,9 @@ def build(ctx):
         Options.options.no_tests = True
 
     if ctx.cmd == "build":
-        if "PYTHONPATH" in os.environ:
-            print("--- PYTHONPATH is set, "
-                  "this may mask or cause library-related problems ---")
+        if "PYTHONPATH" not in os.environ:
+            print("--- PYTHONPATH is not set, "
+                  "loading the Python ntp library may be troublesome ---")
 
 #
 # Boot script setup



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6ed790db519c6a0bfae547e785fcd4698a48d5d8

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6ed790db519c6a0bfae547e785fcd4698a48d5d8
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/20171211/840b3532/attachment.html>


More information about the vc mailing list