This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH cygport 3/3] Don't allow SRC_URI or PATCH_URI to depend on ARCH
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: cygwin-apps at cygwin dot com
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Tue, 13 Feb 2018 13:12:51 +0000
- Subject: [PATCH cygport 3/3] Don't allow SRC_URI or PATCH_URI to depend on ARCH
- Authentication-results: sourceware.org; auth=none
- References: <20180213131251.80368-1-jon.turney@dronecode.org.uk>
The values which SRC_URI and PATCH_URI evaluate to should not change
depending on ARCH, as this will make the source package arch-dependent
---
bin/cygport.in | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/bin/cygport.in b/bin/cygport.in
index c3370e1..2b603d4 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -411,6 +411,32 @@ then
error "${cygportfile} not found.";
fi
+### perform some validation on the .cygport
+
+# SRC_URI and PATCH_URI should not change depending on ARCH, as this will make
+# the source package arch-dependent
+declare -i n
+declare -a VALUE
+ARCHES=("i686" "x86_64" "noarch")
+for VAR in "SRC_URI" "PATCH_URI"
+do
+ n=0
+ while (( n < ${#ARCHES[*]} ))
+ do
+ read -r < <(declare ARCH=${ARCHES[$n]}; declare ARCH_${ARCH}=1; source ${top}/${cygportfile}; eval echo "\$${VAR}")
+ VALUE[$n]=${REPLY}
+ if (( n > 0 ))
+ then
+ if [ "x${VALUE[0]}" != "x${VALUE[$n]}" ]
+ then
+ error "${VAR} appears to depend on ARCH"
+ fi
+ fi
+ n+=1;
+ done
+done
+unset n VALUE ARCHES VAR
+
### load .cygport
source ${top}/${cygportfile} || error "could not read ${cygportfile}"
###
--
2.16.1