[PATCH cygport 2/3] Don't allow SRC_URI or PATCH_URI to depend on ARCH

Jon Turney jon.turney@dronecode.org.uk
Tue May 2 13:14:00 GMT 2017


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



More information about the Cygwin-apps mailing list