public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-apps@cygwin.com
Subject: [PATCH cygport 1/4] pkg_dist: use 'depends:' instead of 'requires:' in generated .hint files
Date: Mon, 25 Jun 2018 15:10:00 -0000	[thread overview]
Message-ID: <20180625151031.13164-2-kbrown@cornell.edu> (raw)
In-Reply-To: <20180625151031.13164-1-kbrown@cornell.edu>

This paves the way for supporting dependencies with version relations,
which are allowed in the 'depends:' field but not in the 'requires:'
field.
---
 lib/pkg_pkg.cygpart | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 3f9a9a7..91a0865 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -515,6 +515,7 @@ __pkg_dist() {
 	local distsubdir;
 	local obssubdir obspkg;
 	local pkg_category_var pkg_requires_var pkg_summary_var;
+	local pkg_bin_requires pkg_depends;
 	local pkg_description_var pkg_message_var pkg_obsoletes_var;
 	local pkg_tag=${1};
 
@@ -598,8 +599,8 @@ __pkg_dist() {
 #****
 #****v* Packaging/REQUIRES
 #  DESCRIPTION
-#  A single-line strings containing a list of packages on which this
-#  package depends. This will be added to the requires: field of the
+#  A single-line string containing a list of packages on which this
+#  package depends. This will be added to the depends: field of the
 #  auto-generated .hint file.
 #  NOTES
 #  * cygport attempts to automatically detect many types of package
@@ -614,8 +615,8 @@ __pkg_dist() {
 #****
 #****v* Packaging/PKG_REQUIRES
 #  DESCRIPTION
-#  A single-line strings containing a list of packages on which this
-#  package depends. This will be added to the requires: field of the
+#  A single-line string containing a list of packages on which this
+#  package depends. This will be added to the depends: field of the
 #  auto-generated .hint file.
 #
 #  Note that the PKG_REQUIRES name is descriptive rather than literal,
@@ -677,6 +678,7 @@ __pkg_dist() {
 		then
 			declare ${pkg_requires_var}="${REQUIRES}"
 		fi
+		declare ${pkg_requires_var}="$(echo ${!pkg_requires_var} | sed -e 's/ /, /g')"
 		if [ -z "${distsubdir}${!pkg_obsoletes_var}" -a -n "${OBSOLETES+yes}" ]
 		then
 			declare ${pkg_obsoletes_var}="${OBSOLETES}"
@@ -691,16 +693,22 @@ __pkg_dist() {
 			then
 				pkg_bin_requires=$(__list_deps $(sort -fu ${T}/.${pkg_name[${n}]}.lst | sed -e '\|/$|d;s| |^_^|g') \
 						   | sort -fu | sed -e "/^${pkg_name[${n}]}-[0-9].*$/d;s/-[0-9].*$//g" \
-						   | sed -e ':a;N;$!ba;s/\n/ /g')
-				__step "${pkg_name[${n}]} requires: ${pkg_bin_requires} ${!pkg_requires_var}"
+						   | sed -e ':a;N;$!ba;s/\n/, /g')
+				if [ -n  "${pkg_bin_requires}" -a -n "${!pkg_requires_var}" ]
+				then
+				    pkg_depends="${pkg_bin_requires}, ${!pkg_requires_var}"
+				else
+				    pkg_depends="${pkg_bin_requires}${!pkg_requires_var}"
+				fi
+				__step "${pkg_name[${n}]} requires: ${pkg_depends}"
 			else
-				pkg_bin_requires=
+				pkg_depends="${!pkg_requires_var}"
 				inform "ADD ${distsubdir:-${PN}} DLL DEPENDENCIES TO ${PN}${distsubdir:+/}${distsubdir}/${pkg_name[${n}]}-${PVR}.hint"
 			fi
 
 			cat > ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
 category: ${!pkg_category_var:-${CATEGORY}}
-requires: ${pkg_bin_requires} ${!pkg_requires_var}
+depends: ${pkg_depends}
 sdesc: "${!pkg_summary_var:-${SUMMARY}}"
 ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}"
 _EOF
-- 
2.17.0

  parent reply	other threads:[~2018-06-25 15:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 15:10 [PATCH cygport 0/4] Support dependencies with version relations Ken Brown
2018-06-25 15:10 ` [PATCH cygport 2/4] pkg_dist: add support for " Ken Brown
2018-06-25 15:10 ` [PATCH cygport 3/4] pkg_dist: record package versions in "depends:" Ken Brown
2018-06-25 15:10 ` Ken Brown [this message]
2018-06-25 15:10 ` [PATCH cygport 4/4] Update sample.cygport Ken Brown

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=20180625151031.13164-2-kbrown@cornell.edu \
    --to=kbrown@cornell.edu \
    --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).