[OS-BUILD PATCH 2/2] redhat: sanity check yaml files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Stancek <jstancek@xxxxxxxxxx>

redhat: sanity check yaml files

Signed-off-by: Jan Stancek <jstancek@xxxxxxxxxx>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -716,6 +716,11 @@ sources-rh: $(TARBALL) $(KABI_TARBALL) $(KABIDW_TARBALL) generate-testpatch-tmp
 		cp kabi/Module.kabi_$$KABIARCH $(SOURCES)/; \
 		cp kabi/Module.kabi_dup_$$KABIARCH $(SOURCES)/; \
 	done
+	@find $(SOURCES)/ -name "*.yaml" -o -name "*.yaml.fedora" -o -name "*.yaml.rhel" | \
+		xargs -i{} $(REDHAT)/scripts/yamlsanity.py {}
+	@echo Sanity checking filtermods configs
+	@$(REDHAT)/scripts/filtermods.py -q sort -c $(SOURCES)/def_variants.yaml.fedora -d /dev/null
+	@$(REDHAT)/scripts/filtermods.py -q sort -c $(SOURCES)/def_variants.yaml.rhel -d /dev/null
 
 dist-sources: dist-kabi dist-kabi-dup sources-rh
 
diff --git a/redhat/scripts/yamlsanity.py b/redhat/scripts/yamlsanity.py
new file mode 100755
index blahblah..blahblah 100755
--- /dev/null
+++ b/redhat/scripts/yamlsanity.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+import sys
+import yaml
+
+def default_ctor(loader, tag_suffix, node):
+    return None
+
+if __name__ == '__main__':
+    print('yaml sanity check', sys.argv[1], end=' ')
+
+    loader = yaml.SafeLoader
+    loader.add_multi_constructor('', default_ctor)
+
+    with open(sys.argv[1], 'r') as file:
+        yaml.load(file, Loader=loader)
+    print('OK')

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2943
--
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux