[OS-BUILD PATCH] redhat: remove update_scripts.sh

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

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

redhat: remove update_scripts.sh

Remove update_scripts.sh and incorporate it as a function in the Makefile.

Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -691,7 +691,6 @@ sources-rh: $(TARBALL) generate-testpatch-tmp setup-source dist-configs-check
 		configs/$(SPECPACKAGE_NAME)-*.config \
 		configs/partial*.config \
 		scripts/gating/gating.yaml \
-		scripts/update_scripts.sh \
 		scripts/mod/mod-denylist.sh \
 		scripts/mod/mod-internal.list \
 		scripts/mod/mod-partner.list \
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -919,8 +919,6 @@ Source77: partial-clang_lto-aarch64-debug-snip.config
 Source80: generate_all_configs.sh
 Source81: process_configs.sh
 
-Source82: update_scripts.sh
-
 Source84: mod-internal.list
 Source85: mod-partner.list
 
@@ -1859,20 +1857,27 @@ done
 %endif
 RHJOBS=$RPM_BUILD_NCPUS SPECPACKAGE_NAME=%{name} ./process_configs.sh $OPTS %{specrpmversion}
 
-cp %{SOURCE82} .
-RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh %{primary_target}
-
 # We may want to override files from the primary target in case of building
 # against a flavour of it (eg. centos not rhel), thus override it here if
 # necessary
+update_scripts() {
+	TARGET="$1"
+
+	for i in "$RPM_SOURCE_DIR"/*."$TARGET"; do
+		NEW=${i%."$TARGET"}
+		cp "$i" "$(basename "$NEW")"
+	done
+}
+
+update_target=%{primary_target}
 if [ "%{primary_target}" == "rhel" ]; then
+: # no-op to avoid empty if-fi error
 %if 0%{?centos}
   echo "Updating scripts/sources to centos version"
-  RPM_SOURCE_DIR=$RPM_SOURCE_DIR ./update_scripts.sh centos
-%else
-  echo "Not updating scripts/sources to centos version"
+  update_target=centos
 %endif
 fi
+update_scripts $update_target
 
 # end of kernel config
 %endif
diff --git a/redhat/scripts/update_scripts.sh b/redhat/scripts/update_scripts.sh
deleted file mode 100755
index blahblah..blahblah 0
--- a/redhat/scripts/update_scripts.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-if [ -z "$1" ]; then
-	exit 1
-fi
-
-TARGET="$1"
-
-for i in "$RPM_SOURCE_DIR"/*."$TARGET"; do
-	NEW=${i%."$TARGET"}
-	cp "$i" "$(basename "$NEW")"
-done

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2769
_______________________________________________
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