]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
index: embed pretty printed version of index
authorJason Ish <jason.ish@oisf.net>
Tue, 29 Nov 2022 17:45:50 +0000 (11:45 -0600)
committerJason Ish <jason.ish@oisf.net>
Thu, 26 Jan 2023 22:38:10 +0000 (16:38 -0600)
This will allow for easier reviewing of diffs.

suricata/update/data/update.py

index e57c1469b096425b5f77b24b14d10174a6e96976..8b34c40d7f64ceb5507afb9a1afc2a81c40641d7 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Open Information Security Foundation
+# Copyright (C) 2018-2022 Open Information Security Foundation
 #
 # You can copy, redistribute or modify this Program under the terms of
 # the GNU General Public License version 2 as published by the Free
@@ -16,6 +16,7 @@
 
 import os.path
 import sys
+import pprint
 
 try:
     from urllib2 import urlopen
@@ -43,8 +44,10 @@ def embed_index():
     # sources to run the version check.
     del(index["versions"])
 
+    pp = pprint.PrettyPrinter(indent=4)
+
     with open(dist_filename, "w") as fileobj:
-        fileobj.write("index = %s" % (str(index)))
+        fileobj.write("index = {}".format(pp.pformat(index)))
     
 if __name__ == "__main__":
     embed_index()