From: Prarit Bhargava <pra...@redhat.com>

redhat/configs/generate_all_configs.sh: Fix config naming

The existing config naming hardcoded the number of hyphens in the config
string name, causing SPECPACKAGE_NAME strings with hyphens to fail.

Fix the config naming to allow for hyphens in the package name.

Signed-off-by: Prarit Bhargava <pra...@redhat.com>

diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -19,18 +19,19 @@ else
        SECONDARY=fedora
 fi
 
-for i in kernel-*-"$FLAVOR".config; do
-       NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed 
s/-"$FLAVOR"//)
-       #echo $NEW
+# The +1 is to remove the - at the end of the SPECPACKAGE_NAME string
+specpackage_name_len=$((${#SPECPACKAGE_NAME} + 1))
+for i in ${SPECPACKAGE_NAME}*-"$FLAVOR".config; do
+       NEW=${SPECPACKAGE_NAME}-"$SPECVERSION"-$(echo 
${i:$specpackage_name_len} | sed s/-"$FLAVOR"//)
        mv "$i" "$NEW"
 done
 
 rm -f kernel-*-"$SECONDARY".config
 
 if [ "$DEBUGBUILDSENABLED" -eq 0 ]; then
-       for i in kernel-*debug*.config; do
+       for i in ${SPECPACKAGE_NAME}-*debug*.config; do
                base=$(echo "$i" | sed -r s/-?debug//g)
-               NEW=kernel-$(echo "$base" | cut -d - -f2-)
+               NEW=${SPECPACKAGE_NAME}-$(echo "$base" | cut -d - -f2-)
                mv "$i" "$NEW"
        done
 fi

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2253
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to