[Git][NTPsec/ntpsec][master] Use a set instead of a list for python_scripts so we don't have duplicates

Matt Selsky gitlab at mg.gitlab.com
Fri May 1 16:17:21 UTC 2020



Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
574d871e by Matt Selsky at 2020-05-01T00:45:43-04:00
Use a set instead of a list for python_scripts so we don't have duplicates

build() is called by both the "build" and "install" commands. So if
python_scripts is a list, then we actually insert each script into the list
twice and we end up attempting to install each script twice.  This is likely a
problem in the "pages" CI job failing periodically because we create some of
the install products more than once.

- - - - -


1 changed file:

- wscript


Changes:

=====================================
wscript
=====================================
@@ -976,7 +976,7 @@ def afterparty(ctx):
                 os.symlink(relpath, path_source.abspath())
 
 
-python_scripts = [
+python_scripts = {
     "ntpclients/ntpdig.py",
     "ntpclients/ntpkeygen.py",
     "ntpclients/ntpq.py",
@@ -984,7 +984,7 @@ python_scripts = [
     "ntpclients/ntptrace.py",
     "ntpclients/ntpwait.py",
     "ntpclients/ntpsnmpd.py",
-]
+}
 
 
 def build(ctx):
@@ -1017,12 +1017,12 @@ def build(ctx):
     ctx.recurse("tests")
 
     if ctx.env['PYTHON_ARGPARSE']:
-        python_scripts.append("ntpclients/ntplogtemp.py")
-        python_scripts.append("ntpclients/ntpviz.py")
+        python_scripts.add("ntpclients/ntplogtemp.py")
+        python_scripts.add("ntpclients/ntpviz.py")
     if ctx.env['PYTHON_ARGPARSE'] and ctx.env['PYTHON_GPS']:
-        python_scripts.append("ntpclients/ntploggps.py")
+        python_scripts.add("ntpclients/ntploggps.py")
     if ctx.env['PYTHON_CURSES']:
-        python_scripts.append("ntpclients/ntpmon.py")
+        python_scripts.add("ntpclients/ntpmon.py")
 
     # Make sure the python scripts compile, but don't install them
     ctx(
@@ -1031,7 +1031,7 @@ def build(ctx):
         install_path=None,
     )
 
-    scripts = ["ntpclients/ntpleapfetch"] + python_scripts
+    scripts = ["ntpclients/ntpleapfetch"] + list(python_scripts)
 
     ctx(
         features="subst",



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/574d871ed8aa44f04b6bbad0220773475ebf55db

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/574d871ed8aa44f04b6bbad0220773475ebf55db
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/20200501/47251ef9/attachment-0001.htm>


More information about the vc mailing list