From 048670796ad7f94af50f66b45156901646c1a7f2 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Mon, 24 Jun 2024 09:40:09 -0700 Subject: [PATCH] support *_only tags --- comps-rocky-10-lh.xml.in | 15 ++++++++++++--- scripts/Makefile | 34 ++++++++++++++++++++++++++++++++++ scripts/comps-distro-only.xsl | 32 ++++++++++++++++++++++++++++++++ scripts/update-comps | 13 +++++++++++-- 4 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 scripts/Makefile create mode 100644 scripts/comps-distro-only.xsl diff --git a/comps-rocky-10-lh.xml.in b/comps-rocky-10-lh.xml.in index 91c5e36..b31f11c 100644 --- a/comps-rocky-10-lh.xml.in +++ b/comps-rocky-10-lh.xml.in @@ -1,4 +1,4 @@ - + conflicts-baseos @@ -254,6 +254,7 @@ selinux-policy-targeted setup shadow-utils + subscription-manager sssd-common sssd-kcm sudo @@ -283,6 +284,8 @@ sg3_utils-libs initscripts-rename-device python3-libselinux + insights-client + rhc dracut-config-generic dracut-network libzfcphbaapi @@ -1059,6 +1062,8 @@ sos sssd strace + subscription-manager-cockpit + libdnf-plugin-subscription-manager time unzip usbutils @@ -1083,6 +1088,7 @@ wget vim-enhanced insights-client + rhc @@ -1162,6 +1168,8 @@ sos sssd strace + subscription-manager-cockpit + libdnf-plugin-subscription-manager time unzip usbutils @@ -1185,7 +1193,8 @@ tcpdump wget vim-enhanced - insights-client + insights-client + rhc @@ -2129,7 +2138,7 @@ perl-generators perl-Fedora-VSP pesign - source-highlight + source-highlight systemtap jna valgrind diff --git a/scripts/Makefile b/scripts/Makefile new file mode 100644 index 0000000..9ede2c9 --- /dev/null +++ b/scripts/Makefile @@ -0,0 +1,34 @@ +XMLINFILES=$(wildcard *.xml.in) +XMLFILES = $(patsubst %.xml.in,%.xml,$(XMLINFILES)) + +all: po $(XMLFILES) sort + +po: $(XMLINFILES) + make -C po -f Makefile || exit 1 + +clean: + @rm -fv *~ *.xml + +validate: $(XMLFILES) comps.rng + # Run xmllint on each file and exit with non-zero if any validation fails + RES=0; for f in $(XMLFILES); do \ + xmllint --noout --relaxng comps.rng $$f; \ + RES=$$(($$RES + $$?)); \ + done; exit $$RES + +sort: + @# Run xsltproc on each xml.in file and exit with non-zero if any sorting fails + @# The comps-eln.xml.in is not sorted alphabetically but manually + @# based on the need needs of Fedora ELN SIG. + @RES=0; for f in $(XMLINFILES); do \ + if [[ "$$f" == 'comps-eln.xml.in' ]]; then \ + continue; \ + fi; \ + xsltproc --novalid -o $$f comps-cleanup.xsl $$f; \ + RES=$$(($$RES + $$?)); \ + done; exit $$RES + +%.xml: %.xml.in + @xmllint --noout $< + @if test ".$(CLEANUP)" == .yes; then xsltproc --novalid -o $< comps-cleanup.xsl $<; fi + ./update-comps $@ $(DISTRO) diff --git a/scripts/comps-distro-only.xsl b/scripts/comps-distro-only.xsl new file mode 100644 index 0000000..26ebc55 --- /dev/null +++ b/scripts/comps-distro-only.xsl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/update-comps b/scripts/update-comps index b163e1c..de1fa06 100755 --- a/scripts/update-comps +++ b/scripts/update-comps @@ -1,3 +1,12 @@ #!/bin/bash -COMPS_FILE=$1 -LANG=C intltool-merge -x -u po/ $COMPS_FILE.xml.in $COMPS_FILE.xml + +COMPSFILE=$1 +DISTRO=$2 + +if [ -z "$COMPSFILE" ]; then + echo "Usage: $0 " + exit 1 +fi + +LANG=C intltool-merge -x -u po/ $COMPSFILE.in $COMPSFILE +xsltproc --stringparam distro $DISTRO --novalid -o $COMPSFILE comps-distro-only.xsl $COMPSFILE