This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH cygport 2/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, 2 May 2017 14:13:44 +0100
- Subject: [PATCH cygport 2/3] Don't allow SRC_URI or PATCH_URI to depend on ARCH
- Authentication-results: sourceware.org; auth=none
- References: <20170502131345.158584-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 6cf0122..25d7e94 100644
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -409,6 +409,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.12.2