Skip to content

Commit

Permalink
bin/suricata-update: handle non-standard install prefixes.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jasonish committed Feb 4, 2018
1 parent 0deb1af commit d9b7a36
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/suricata-update
Expand Up @@ -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]))))

Expand Down

0 comments on commit d9b7a36

Please sign in to comment.