7
0
mirror of https://git.rockylinux.org/rocky/comps.git synced 2024-12-22 01:38:30 +00:00

make sync script more robust

This commit is contained in:
Louis Abel 2024-08-20 02:14:31 -07:00
parent e6db5db863
commit 010c928496
Signed by: label
GPG Key ID: 2A6975660E424560
7 changed files with 106 additions and 24 deletions

View File

@ -1053,7 +1053,6 @@
<packagereq variant="AppStream" type="default">tcpdump</packagereq>
<packagereq variant="AppStream" type="default">wget</packagereq>
<packagereq variant="AppStream" type="default">vim-enhanced</packagereq>
<packagereq variant="AppStream" type="default">insights-client</packagereq>
</packagelist>
</group>
<group>
@ -2358,7 +2357,7 @@
<packagereq type="default">catatonit</packagereq>
<packagereq type="default">cglib</packagereq>
<packagereq type="default">cifs-utils-devel</packagereq>
<packagereq type="default" arch="x86_64">cxl-devel</packagereq>
<packagereq type="default">cxl-devel</packagereq>
<packagereq type="default">clucene-core-devel</packagereq>
<packagereq type="default">colord-devel</packagereq>
<packagereq type="default">colord-devel-docs</packagereq>

View File

@ -1058,7 +1058,7 @@
<packagereq type="default" variant="AppStream">tcpdump</packagereq>
<packagereq type="default" variant="AppStream">wget</packagereq>
<packagereq type="default" variant="AppStream">vim-enhanced</packagereq>
<packagereq type="default" variant="AppStream">insights-client</packagereq>
<rhel_only><packagereq type="default" variant="AppStream">insights-client</packagereq></rhel_only>
<rhel_only><packagereq type="default" variant="AppStream">rhc</packagereq></rhel_only>
</packagelist>
</group>
@ -1903,7 +1903,7 @@
<default>false</default>
<uservisible>false</uservisible>
<packagelist>
<!-- Disable java until we have Java 21 which is what we'll ship in RHEL
<!-- Disable java until we have Java 21 which is what we'll ship in Rocky Linux
<packagereq type="default">java-1.8.0-openjdk-devel</packagereq>
<packagereq type="default">java-1.8.0-openjdk-demo</packagereq>
<packagereq type="default">java-1.8.0-openjdk-javadoc</packagereq>
@ -1948,7 +1948,7 @@
<packagereq type="default">log4j-slf4j</packagereq>
</packagelist>
</group>
<!-- Disable java until we have Java 21 which is what we'll ship in RHEL
<!-- Disable java until we have Java 21 which is what we'll ship in Rocky Linux
<group variant="AppStream">
<id>java-platform</id>
<_name>Java Platform</_name>
@ -2583,7 +2583,7 @@
<packagereq type="default">catatonit</packagereq>
<packagereq type="default">cglib</packagereq>
<packagereq type="default">cifs-utils-devel</packagereq>
<packagereq type="default" arch="x86_64">cxl-devel</packagereq>
<packagereq type="default">cxl-devel</packagereq>
<packagereq type="default">clucene-core-devel</packagereq>
<packagereq type="default">colord-devel</packagereq>
<packagereq type="default">colord-devel-docs</packagereq>

View File

@ -3648,7 +3648,6 @@
<packagereq type="default">rasqal-devel</packagereq>
<packagereq type="default">redhat-sb-certs</packagereq>
<packagereq type="default">redland-devel</packagereq>
<packagereq type="default">rhc-devel</packagereq>
<packagereq type="default">rpcgen</packagereq>
<packagereq type="default">rpcsvc-proto-devel</packagereq>
<packagereq type="default">rrdtool-devel</packagereq>

View File

@ -1,4 +1,4 @@
<!DOCTYPE comps PUBLIC "-//Red Hat, Inc.//DTD Comps info//EN" "comps.dtd">
<!DOCTYPE comps PUBLIC "-//Rocky Enterprise Software Foundation//DTD Comps info//EN" "comps.dtd">
<comps>
<group variant="BaseOS">
<id>conflicts-baseos</id>
@ -3902,7 +3902,7 @@
<packagereq type="default">rasqal-devel</packagereq>
<packagereq type="default">redhat-sb-certs</packagereq>
<packagereq type="default">redland-devel</packagereq>
<packagereq type="default">rhc-devel</packagereq>
<rhel_only><packagereq type="default">rhc-devel</packagereq></rhel_only>
<packagereq type="default">rpcgen</packagereq>
<packagereq type="default">rpcsvc-proto-devel</packagereq>
<packagereq type="default">rrdtool-devel</packagereq>

View File

@ -1,14 +1,58 @@
#!/bin/bash
HOWMANY="-$1"
if [ -z $1 ]; then
HOWMANY="-1"
BRANCH=main
VERS=c9s
COMPS_FILE=comps-centos-stream-9.xml.in
COMPS_ROCKY=${COMPS_FILE/centos-stream-9/rocky-9-lh}
if [ ! -f "${COMPS_ROCKY}" ]; then
echo "Rocky Comps not found."
fi
echo "Fetching from upstream"
git fetch https://gitlab.com/redhat/centos-stream/release-engineering/comps.git main
echo "Formatting patch and applying..."
git format-patch --stdout ${HOWMANY} FETCH_HEAD | sed -e 's/centos-stream-9/rocky-9-lh/' | git apply
git clone https://gitlab.com/redhat/centos-stream/release-engineering/comps.git -b ${BRANCH} /var/tmp/${VERS}-comps
echo "Copying comps file over"
cp /var/tmp/${VERS}-comps/${COMPS_FILE} "./${COMPS_ROCKY}"
echo "Modifying file with Rocky Branding"
while read -r pattern; do
sscript+="$pattern;"
done <<EOF
s/>redhat-release/>rocky-release/g
s/Red Hat Enterprise Linux/Rocky Linux/g
s/RHEL/Rocky Linux/g
s/Red Hat, Inc./Rocky Enterprise Software Foundation/g
EOF
sed -i "$sscript" "${COMPS_ROCKY}"
echo "Making sure some packages are RHEL only"
while read -r pattern; do
mscript+="$pattern;"
done <<EOF
/>insights-client</ s/(<packagereq.*>insights-client<\/packagereq>)/<rhel_only>\1<\/rhel_only>/g
/>rhc</ s/(<packagereq.*>rhc<\/packagereq>)/<rhel_only>\1<\/rhel_only>/g
/>rhc-devel</ s/(<packagereq.*>rhc-devel<\/packagereq>)/<rhel_only>\1<\/rhel_only>/g
/>subscription-manager</ s/(<packagereq.*>subscription-manager<\/packagereq>)/<rhel_only>\1<\/rhel_only>/g
/>subscription-manager-cockpit</ s/(<packagereq.*>subscription-manager-cockpit<\/packagereq>)/<rhel_only>\1<\/rhel_only>/g
/>libdnf-plugin-subscription-manager</ s/(<packagereq.*>libdnf-plugin-subscription-manager<\/packagereq>)/<rhel_only>\1<\/rhel_only>/g
EOF
sed -Ei "$mscript" "${COMPS_ROCKY}"
echo "Modifications to make sure certain scenarios work"
while read -r pattern; do
wscript+="$pattern;"
done <<EOF
/>kmod-kvdo</ s/type="default"/type="default" arch="ppc64le,s390x,x86_64"/g
/>vdo</ s/type="default"/type="default" arch="ppc64le,s390x,x86_64"/g
EOF
sed -i "$wscript" "${COMPS_ROCKY}"
echo "Generating proper XML"
/bin/bash ./scripts/update-comps "${COMPS_ROCKY/.in/}" rocky
echo "Cleaning up upstream"
rm -rf /var/tmp/${VERS}-comps
echo "!! DIFF OF CHANGES !!"
git --no-pager diff HEAD
echo "You may now commit and push."
echo "You may now commit and push if there are any changes."

View File

@ -1,14 +1,53 @@
#!/bin/bash
HOWMANY="-$1"
if [ -z $1 ]; then
HOWMANY="-1"
BRANCH=c10s
VERS=c10s
COMPS_FILE=comps-centos-stream-10.xml.in
COMPS_ROCKY=${COMPS_FILE/centos-stream-10/rocky-10-lh}
if [ ! -f "${COMPS_ROCKY}" ]; then
echo "Rocky Comps not found."
fi
echo "Fetching from upstream"
git fetch https://gitlab.com/redhat/centos-stream/release-engineering/comps.git c10s
echo "Formatting patch and applying..."
git format-patch --stdout ${HOWMANY} FETCH_HEAD | sed -e 's/centos-stream-10/rocky-10-lh/' | git apply
git clone https://gitlab.com/redhat/centos-stream/release-engineering/comps.git -b ${BRANCH} /var/tmp/${VERS}-comps
echo "Copying comps file over"
cp /var/tmp/${VERS}-comps/${COMPS_FILE} "./${COMPS_ROCKY}"
echo "Modifying file with Rocky Branding"
while read -r pattern; do
sscript+="$pattern;"
done <<EOF
s/>redhat-release/>rocky-release/g
s/Red Hat Enterprise Linux/Rocky Linux/g
s/RHEL/Rocky Linux/g
s/Red Hat, Inc./Rocky Enterprise Software Foundation/g
EOF
sed -i "$sscript" "${COMPS_ROCKY}"
echo "Making sure some packages are RHEL only"
while read -r pattern; do
mscript+="$pattern;"
done <<EOF
/ <packagereq .*>insights-client/ s/(<packagereq.*>insights-client<\/packagereq>)/<rhel_only>\1<\/rhel_only>/g
EOF
sed -Ei "$mscript" "${COMPS_ROCKY}"
#echo "Modifications to make sure certain scenarios work"
#while read -r pattern; do
# wscript+="$pattern;"
#done <<EOF
#/>kmod-kvdo</ s/type="default"/type="default" arch="ppc64le,s390x,x86_64"/g
#/>vdo</ s/type="default"/type="default" arch="ppc64le,s390x,x86_64"/g
#EOF
#sed -i "$wscript" "${COMPS_ROCKY}"
echo "Generating proper XML"
/bin/bash ./scripts/update-comps "${COMPS_ROCKY/.in/}" rocky
echo "Cleaning up upstream"
rm -rf /var/tmp/${VERS}-comps
echo "!! DIFF OF CHANGES !!"
git --no-pager diff HEAD
echo "You may now commit and push."
echo "You may now commit and push if there are any changes."

View File

@ -2,6 +2,7 @@
COMPSFILE=$1
DISTRO=$2
CURDIR="${0%/*}"
if [ -z "$COMPSFILE" ] || [ -z "$DISTRO" ]; then
echo "Usage: $0 <compsfile> <distro>"
@ -9,7 +10,7 @@ if [ -z "$COMPSFILE" ] || [ -z "$DISTRO" ]; then
fi
LANG=C intltool-merge -x -u po/ $COMPSFILE.in $COMPSFILE
xsltproc --stringparam distro $DISTRO --novalid -o $COMPSFILE comps-distro-only.xsl $COMPSFILE
xsltproc --stringparam distro $DISTRO --novalid -o $COMPSFILE ${CURDIR}/comps-distro-only.xsl $COMPSFILE
echo "Cleaning up empty space left over"
sed -i '/^ $/d' "${COMPSFILE}"