2022-06-02 00:37:19 +00:00
|
|
|
#!/bin/bash
|
2024-08-20 09:14:31 +00:00
|
|
|
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."
|
2022-06-22 14:55:38 +00:00
|
|
|
fi
|
2022-06-02 00:37:19 +00:00
|
|
|
|
|
|
|
echo "Fetching from upstream"
|
2024-08-20 09:14:31 +00:00
|
|
|
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
|
|
|
|
|
2022-06-02 00:37:19 +00:00
|
|
|
echo "!! DIFF OF CHANGES !!"
|
|
|
|
git --no-pager diff HEAD
|
|
|
|
|
2024-08-20 09:14:31 +00:00
|
|
|
echo "You may now commit and push if there are any changes."
|