[OS-BUILD PATCHv7 5/7] redhat/configs/generate_all_configs.sh: Fix config naming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

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 <prarit@xxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux