From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH cygport 3/3] Don't allow SRC_URI or PATCH_URI to depend on ARCH
Date: Tue, 13 Feb 2018 13:13:00 -0000 [thread overview]
Message-ID: <20180213131251.80368-4-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2018-02-13 13:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 13:13 [PATCH cygport 0/3] Don't allow source packages to differ by arch Jon Turney
2018-02-13 13:13 ` Jon Turney [this message]
2018-02-13 13:13 ` [PATCH cygport 2/3] Add src_patch_apply_hook Jon Turney
2018-02-13 13:13 ` [PATCH cygport 1/3] Document src_unpack_hook and src_patch_hook Jon Turney
2020-03-24 3:06 ` [PATCH cygport 0/3] Don't allow source packages to differ by arch Yaakov Selkowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180213131251.80368-4-jon.turney@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).