From 35df744355671d87e951e4c61e71c464fd517619 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 18 Nov 2017 17:32:46 +0100 Subject: [PATCH] Add SPDX license headers to python scripts --- test/create-sys-script.py | 2 ++ test/networkd-test.py | 1 + test/rule-syntax-check.py | 2 ++ test/sys-script.py | 1 + test/sysv-generator-test.py | 1 + test/test-exec-deserialization.py | 2 +- tools/catalog-report.py | 1 + tools/gdb-sd_dump_hashmaps.py | 1 + tools/make-directive-index.py | 1 + tools/make-man-index.py | 1 + tools/make-man-rules.py | 1 + tools/xml_helper.py | 3 +++ 12 files changed, 16 insertions(+), 1 deletion(-) diff --git a/test/create-sys-script.py b/test/create-sys-script.py index a4f1f302f60..e25f3b4f8f0 100755 --- a/test/create-sys-script.py +++ b/test/create-sys-script.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1+ OUTFILE_HEADER = """#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1+ # # create-sys-script.py # diff --git a/test/networkd-test.py b/test/networkd-test.py index 5760ca5137a..3918d85ef0a 100755 --- a/test/networkd-test.py +++ b/test/networkd-test.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1+ # # networkd integration test # This uses temporary configuration in /run and temporary veth devices, and diff --git a/test/rule-syntax-check.py b/test/rule-syntax-check.py index 14739df4932..4f27fb015b4 100755 --- a/test/rule-syntax-check.py +++ b/test/rule-syntax-check.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1+ +# # Simple udev rules syntax checker # # (C) 2010 Canonical Ltd. diff --git a/test/sys-script.py b/test/sys-script.py index 2de7d7ea309..468c1dc9724 100755 --- a/test/sys-script.py +++ b/test/sys-script.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1+ # # sys-script.py # diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py index 18bb40f8128..0b4710aeabd 100755 --- a/test/sysv-generator-test.py +++ b/test/sysv-generator-test.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1+ # # systemd-sysv-generator integration test # diff --git a/test/test-exec-deserialization.py b/test/test-exec-deserialization.py index c3fe0824c7d..1b8863746ce 100755 --- a/test/test-exec-deserialization.py +++ b/test/test-exec-deserialization.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 - +# SPDX-License-Identifier: LGPL-2.1+ # # Copyright 2017 Michal Sekletar # diff --git a/tools/catalog-report.py b/tools/catalog-report.py index 357e498cdcf..426ea0d8916 100755 --- a/tools/catalog-report.py +++ b/tools/catalog-report.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ +# SPDX-License-Identifier: MIT # # This file is part of systemd. It is distrubuted under the MIT license, see # below. diff --git a/tools/gdb-sd_dump_hashmaps.py b/tools/gdb-sd_dump_hashmaps.py index 62ce8006f53..b3c356b5791 100644 --- a/tools/gdb-sd_dump_hashmaps.py +++ b/tools/gdb-sd_dump_hashmaps.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ +# SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py index f9203ddd1a5..fb2b0b7c6fd 100755 --- a/tools/make-directive-index.py +++ b/tools/make-directive-index.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ +# SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # diff --git a/tools/make-man-index.py b/tools/make-man-index.py index 0618e2e677f..5ff36166526 100755 --- a/tools/make-man-index.py +++ b/tools/make-man-index.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ +# SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py index e0f18d6fbee..444d4a6ee45 100755 --- a/tools/make-man-rules.py +++ b/tools/make-man-rules.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ +# SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # diff --git a/tools/xml_helper.py b/tools/xml_helper.py index 0088be5bd9e..47434c7156d 100755 --- a/tools/xml_helper.py +++ b/tools/xml_helper.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ +# SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # @@ -27,9 +28,11 @@ class CustomResolver(tree.Resolver): _parser = tree.XMLParser() _parser.resolvers.add(CustomResolver()) + def xml_parse(page): doc = tree.parse(page, _parser) doc.xinclude() return doc + def xml_print(xml): return tree.tostring(xml, pretty_print=True, encoding='utf-8') -- 2.39.2