public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: cygwin-apps@cygwin.com
Subject: [PATCH] cygport: suppress spurious package dependencies
Date: Wed, 03 Jun 2020 13:51:34 +0200	[thread overview]
Message-ID: <87367cv03d.fsf@Rainer.invalid> (raw)

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]


The automatically generated dependencies sometimes have unwanted
components.  This patch allows to suppress these on a per-package basis,
rather than requiring to patch the generated hint files after the fact.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-pkg_pkg-allow-suppression-of-spurious-package-depend.patch --]
[-- Type: text/x-patch, Size: 2591 bytes --]

From 009dbf010418afb873a75bdb204d77fdf1f83ac7 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Wed, 3 Jun 2020 13:41:18 +0200
Subject: [PATCH] pkg_pkg: allow suppression of spurious package dependencies

Allow suppression of spurious automatic package dependencies by
introducing a new variable PKG_REQUIRES_SUPPRESS, containing a
single-line string of space-separated package list.  Any of the
packages listed are automatically determined to be a requirement are
suppressed so that they do not show up in the generated hint file(s).
---
 lib/pkg_pkg.cygpart | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 7189f36..9603c1d 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -1,3 +1,4 @@
+# -*- mode: sh; sh-shell: bash -*-
 ################################################################################
 #
 # pkg_pkg.cygpart - cygport packaging functions
@@ -787,6 +788,7 @@ __pkg_dist() {
 	do
 		pkg_category_var=${pkg_name[${n}]//[-+\.]/_}_CATEGORY;
 		pkg_requires_var=${pkg_name[${n}]//[-+\.]/_}_REQUIRES;
+		pkg_requires_suppress_var=${pkg_name[${n}]//[-+\.]/_}_REQUIRES_SUPPRESS;
 		pkg_summary_var=${pkg_name[${n}]//[-+\.]/_}_SUMMARY;
 		pkg_description_var=${pkg_name[${n}]//[-+\.]/_}_DESCRIPTION;
 		pkg_message_var=${pkg_name[${n}]//[-+\.]/_}_MESSAGE;
@@ -806,6 +808,10 @@ __pkg_dist() {
 		then
 			declare ${pkg_requires_var}="${REQUIRES}"
 		fi
+		if [ -z "${distsubdir}${!pkg_requires_suppress_var}" -a -n "${REQUIRES_SUPPRESS+yes}" ]
+		then
+			declare ${pkg_requires_var}="${REQUIRES_SUPPRESS}"
+		fi
 		if [ -z "${distsubdir}${!pkg_obsoletes_var}" -a -n "${OBSOLETES+yes}" ]
 		then
 			declare ${pkg_obsoletes_var}="${OBSOLETES}"
@@ -827,9 +833,11 @@ __pkg_dist() {
 		then
 			if [ "${CBUILD##*-}" = "cygwin" ]
 			then
-				pkg_bin_requires=$(__list_deps $(sort -fu ${T}/.${pkg_name[${n}]}.lst | sed -e '\|/$|d;s| |^_^|g') \
-						   | sed -e "/^${pkg_name[${n}]}-[0-9].*$/d;s/-[0-9].*$//g" \
-						   | sort -fu | sed -e ':a;N;$!ba;s/\n/ /g' )
+			    pkg_bin_requires=$( echo ${!pkg_requires_suppress_var} ${!pkg_requires_suppress_var} \
+						$(__list_deps $(sort -fu ${T}/.${pkg_name[${n}]}.lst | sed -e '\|/$|d;s| |^_^|g') \
+						      | sed -e "/^${pkg_name[${n}]}-[0-9].*$/d;s/-[0-9].*$//g" \
+						      | sort -fu | sed -e ':a;N;$!ba;s/\n/ /g' ) \
+						    | tr ' ' '\n' | sort | uniq -u | tr '\n' ' ' )
 				__step "${pkg_name[${n}]} requires: ${pkg_bin_requires} ${!pkg_requires_var}"
 			else
 				pkg_bin_requires=
-- 
2.26.2


[-- Attachment #3: Type: text/plain, Size: 186 bytes --]



Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra

             reply	other threads:[~2020-06-03 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 11:51 Achim Gratz [this message]
2020-06-03 16:32 ` Yaakov Selkowitz
2020-06-03 17:56   ` Achim Gratz
2020-06-14 10:53     ` Achim Gratz

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=87367cv03d.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --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).