#!/bin/bash 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 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 <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 <insights-client/ s/(insights-client<\/packagereq>)/\1<\/rhel_only>/g EOF sed -Ei "$mscript" "${COMPS_ROCKY}" echo "Making sure some packages are RHEL only" while read -r pattern; do bscript+="$pattern;" done <redhat-backgrounds<\/packagereq><\/rhel_only>/ s/$/\n rocky-backgrounds<\/packagereq><\/rocky_only>/g EOF sed -Ei "$bscript" "${COMPS_ROCKY}" #echo "Modifications to make sure certain scenarios work" #while read -r pattern; do # wscript+="$pattern;" #done <kmod-kvdovdo