From: Jason Ish Date: Tue, 29 Nov 2022 17:45:50 +0000 (-0600) Subject: index: embed pretty printed version of index X-Git-Tag: 1.3.0rc1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e2345010ddda321035afb1d9197d05eab98697a;p=thirdparty%2Fsuricata-update.git index: embed pretty printed version of index This will allow for easier reviewing of diffs. --- diff --git a/suricata/update/data/update.py b/suricata/update/data/update.py index e57c146..8b34c40 100644 --- a/suricata/update/data/update.py +++ b/suricata/update/data/update.py @@ -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()