util: move gen_zipped_file into generic util and rename to gen_zipped_xml_file

Make the filename more descriptive and since the file is used by
multiple drivers, move it into appropriate util/ directory.

Cosmetics:
 - use SPDX license tag
 - add newline before main function

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27804>
This commit is contained in:
David Heidelberg
2024-02-27 00:09:39 +01:00
committed by Marge Bot
parent 16753bc2f1
commit d8f53f698c
3 changed files with 4 additions and 22 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ endforeach
v3d_xml_h = custom_target(
'v3d_xml.h',
input : ['../../intel/genxml/gen_zipped_file.py', v3d_xml_files],
input : ['../../util/gen_zipped_xml_file.py', v3d_xml_files],
output : 'v3d_xml.h',
command : [prog_python, '@INPUT@'],
capture : true,
+1 -1
View File
@@ -45,7 +45,7 @@ endforeach
genX_xml_h = custom_target(
'genX_xml.h',
input : ['gen_zipped_file.py', gen_xml_files],
input : ['../../util/gen_zipped_xml_file.py', gen_xml_files],
output : 'genX_xml.h',
command : [prog_python, '@INPUT@'],
capture : true,
@@ -1,31 +1,13 @@
#encoding=utf-8
#
# Copyright © 2017 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# SPDX-License-Identifier: MIT
import sys
import zlib
import xml.etree.ElementTree as et
def main():
if len(sys.argv) < 2:
print("No input xml file specified")