From d9b7a36268af2e9891add4563318641ae00518da Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 31 Jan 2018 16:31:37 -0600 Subject: [PATCH] bin/suricata-update: handle non-standard install prefixes. Look to see if the modules are in a known location relative to the location of suricata-update and to the sys.path if found. Allows suricata-update to be installed with non-standard --prefixes. --- bin/suricata-update | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/suricata-update b/bin/suricata-update index e8230cfb..f2e85577 100755 --- a/bin/suricata-update +++ b/bin/suricata-update @@ -19,6 +19,13 @@ import sys import os +exec_dir = os.path.dirname(__file__) +version_info = sys.version_info +pyver = "%d.%d" % (version_info.major, version_info.minor) +site_path = "%s/../lib/python%s/site-packages" % (exec_dir, pyver) + +if os.path.exists("%s/suricata/update" % (site_path)): + sys.path.insert(0, site_path) sys.path.insert( 0, os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))))