public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH cygport 2/2] Add provides: and conflicts: hints
Date: Sat, 08 Feb 2020 13:47:00 -0000	[thread overview]
Message-ID: <20200208134634.58200-3-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20200208134634.58200-1-jon.turney@dronecode.org.uk>

Add the ability to specify provides: and conflicts: hints in the
cygport.
---
 lib/pkg_pkg.cygpart                           | 74 ++++++++++++++++++-
 .../libmultiple1/libmultiple1-3.14-1.hint     |  2 +
 testsuite/hints/multiple/multiple.cygport     |  2 +
 .../dist/single/single-2.3.4-1.hint           |  2 +
 testsuite/hints/single/single.cygport         |  2 +
 5 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 2566190..753de9e 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -648,12 +648,56 @@ __pkg_dist() {
 #  package replaces.  An empty package will be created for each listed
 #  obsoletion which will cause PKG to be installed in its place.
 #
-#  Note that the PKG_REQUIRES name is descriptive rather than literal,
+#  Note that the PKG_OBSOLETES name is descriptive rather than literal,
 #  where "PKG" should be substituted with the name of the binary package
 #  whose contents it describes.  When a package contains a character which
 #  cannot be used in a shell variable name (namely '+', '-', and '.'),
 #  that character must be substituted with an underscore ('_'), e.g.
 #  libfoo-devel will use libfoo_devel_OBSOLETES.
+#****
+#****v* Packaging/PROVIDES
+#  DESCRIPTION
+#  A single-line string containing a list of names which this package also
+#  provides.
+#  NOTE
+#  If there is more than one package in PKG_NAMES, this variable will be
+#  ignored; you must use PKG_PROVIDES instead.
+#  SEE ALSO
+#  PKG_PROVIDES
+#****
+#****v* Packaging/PKG_PROVIDES
+#  DESCRIPTION
+#  A single-line string containing a list of names which this package also
+#  provides.
+#
+#  Note that the PKG_PROVIDES name is descriptive rather than literal,
+#  where "PKG" should be substituted with the name of the binary package
+#  whose contents it describes.  When a package contains a character which
+#  cannot be used in a shell variable name (namely '+', '-', and '.'),
+#  that character must be substituted with an underscore ('_'), e.g.
+#  libfoo-devel will use libfoo_devel_PROVIDES.
+#****
+#****v* Packaging/CONFLICTS
+#  DESCRIPTION
+#  A single-line string containing a comma-separated list of packages, possibly
+#  with version relations which this package conflicts with.
+#  NOTE
+#  If there is more than one package in PKG_NAMES, this variable will be
+#  ignored; you must use PKG_CONFLICTS instead.
+#  SEE ALSO
+#  PKG_CONFLICTS
+#****
+#****v* Packaging/PKG_CONFLICTS
+#  DESCRIPTION
+#  A single-line string containing a comma-separated list of packages, possibly
+#  with version relations which this package conflicts with.
+#
+#  Note that the PKG_CONFLICTS name is descriptive rather than literal,
+#  where "PKG" should be substituted with the name of the binary package
+#  whose contents it describes.  When a package contains a character which
+#  cannot be used in a shell variable name (namely '+', '-', and '.'),
+#  that character must be substituted with an underscore ('_'), e.g.
+#  libfoo-devel will use libfoo_devel_CONFLICTS.
 #****
 
 	n=0;
@@ -665,6 +709,8 @@ __pkg_dist() {
 		pkg_description_var=${pkg_name[${n}]//[-+\.]/_}_DESCRIPTION;
 		pkg_message_var=${pkg_name[${n}]//[-+\.]/_}_MESSAGE;
 		pkg_obsoletes_var=${pkg_name[${n}]//[-+\.]/_}_OBSOLETES;
+		pkg_provides_var=${pkg_name[${n}]//[-+\.]/_}_PROVIDES;
+		pkg_conflicts_var=${pkg_name[${n}]//[-+\.]/_}_CONFLICTS;
 		dbg_obsoletes_var=${PN//[-+\.]/_}_debuginfo_OBSOLETES;
 
 		case ${pkg_name[${n}]} in
@@ -672,7 +718,7 @@ __pkg_dist() {
 			*)      distsubdir=${pkg_name[${n}]} ;;
 		esac
 
-		# allow REQUIRES and OBSOLETES only for single packages
+		# allow REQUIRES, OBSOLETES etc. only for single packages
 		if [ -z "${distsubdir}${!pkg_requires_var}" -a -n "${REQUIRES+yes}" ]
 		then
 			declare ${pkg_requires_var}="${REQUIRES}"
@@ -681,6 +727,15 @@ __pkg_dist() {
 		then
 			declare ${pkg_obsoletes_var}="${OBSOLETES}"
 		fi
+		if [ -z "${distsubdir}${!pkg_provides_var}" -a -n "${PROVIDES+yes}" ]
+		then
+			declare ${pkg_provides_var}="${PROVIDES}"
+		fi
+
+		if [ -z "${distsubdir}${!pkg_conflicts_var}" -a -n "${CONFLICTS+yes}" ]
+		then
+			declare ${pkg_conflicts_var}="${CONFLICTS}"
+		fi
 
 		if [ -f ${C}/${pkg_hint[${n}]%.hint}.hint ]
 		then
@@ -710,6 +765,21 @@ _EOF
 obsoletes: ${!pkg_obsoletes_var}
 _EOF
 			fi
+
+			if [ -n "${!pkg_provides_var}" ]
+			then
+				cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
+provides: ${!pkg_provides_var}
+_EOF
+			fi
+
+			if [ -n "${!pkg_conflicts_var}" ]
+			then
+				cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
+conflicts: ${!pkg_conflicts_var}
+_EOF
+			fi
+
 			if defined distsubdir
 			then
 				cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
index 989bfb1..90f0f57 100644
--- a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
@@ -2,5 +2,7 @@ category: Base
 requires:  cygwin
 sdesc: "Summary of hints for multiple package test"
 ldesc: "Description of hints for multiple package test"
+provides: also-provides
+conflicts: conflicts-with
 external-source: multiple
 
diff --git a/testsuite/hints/multiple/multiple.cygport b/testsuite/hints/multiple/multiple.cygport
index b269ff5..ab6ade9 100644
--- a/testsuite/hints/multiple/multiple.cygport
+++ b/testsuite/hints/multiple/multiple.cygport
@@ -13,6 +13,8 @@ multiple_CATEGORY="Base"
 libmultiple1_CONTENTS=""
 libmultiple1_CATEGORY="Base"
 libmultiple1_REQUIRES="cygwin"
+libmultiple1_PROVIDES="also-provides"
+libmultiple1_CONFLICTS="conflicts-with"
 
 libmultiple_devel_CONTENTS="usr/include"
 libmultiple_devel_CATEGORY="Devel"
diff --git a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
index aa534a0..a59628c 100644
--- a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
+++ b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
@@ -3,4 +3,6 @@ requires:  cygwin
 sdesc: "Summary of hints for single package test"
 ldesc: "Description of hints for single package test"
 obsoletes: obsoleted-by-single
+provides: also-provides
+conflicts: conflicts-with
 
diff --git a/testsuite/hints/single/single.cygport b/testsuite/hints/single/single.cygport
index fca0706..9908a70 100644
--- a/testsuite/hints/single/single.cygport
+++ b/testsuite/hints/single/single.cygport
@@ -7,6 +7,8 @@ DESCRIPTION="Description of hints for single package test"
 CATEGORY="Base"
 REQUIRES="cygwin"
 OBSOLETES="obsoleted-by-single"
+PROVIDES="also-provides"
+CONFLICTS="conflicts-with"
 
 src_compile() {
   :
-- 
2.21.0

  reply	other threads:[~2020-02-08 13:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08 13:47 [PATCH cygport 0/2] Add provides: and conflicts: Jon Turney
2020-02-08 13:47 ` Jon Turney [this message]
2020-02-08 13:47 ` [PATCH cygport 1/2] Add test which compares hints with expected Jon Turney
2020-02-22 14:48 ` [PATCH cygport] Generate a separate .hint for the source package Jon Turney
2020-02-22 14:48 ` [PATCH cygport 3/2] " Jon Turney
2020-03-24  3:07 ` [PATCH cygport 0/2] Add provides: and conflicts: Yaakov Selkowitz
2020-04-05 14:17   ` Jon Turney
2020-04-06 23:11     ` Yaakov Selkowitz
2020-04-06 23:11     ` 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=20200208134634.58200-3-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).