public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] cygport: suppress spurious package dependencies
@ 2020-06-03 11:51 Achim Gratz
  2020-06-03 16:32 ` Yaakov Selkowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2020-06-03 11:51 UTC (permalink / raw)
  To: cygwin-apps

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cygport: suppress spurious package dependencies
  2020-06-03 11:51 [PATCH] cygport: suppress spurious package dependencies Achim Gratz
@ 2020-06-03 16:32 ` Yaakov Selkowitz
  2020-06-03 17:56   ` Achim Gratz
  0 siblings, 1 reply; 4+ messages in thread
From: Yaakov Selkowitz @ 2020-06-03 16:32 UTC (permalink / raw)
  To: cygwin-apps

On Wed, 2020-06-03 at 13:51 +0200, Achim Gratz wrote:
> 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.

What exactly are you trying to "fix" with this?

--
Yaakov



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cygport: suppress spurious package dependencies
  2020-06-03 16:32 ` Yaakov Selkowitz
@ 2020-06-03 17:56   ` Achim Gratz
  2020-06-14 10:53     ` Achim Gratz
  0 siblings, 1 reply; 4+ messages in thread
From: Achim Gratz @ 2020-06-03 17:56 UTC (permalink / raw)
  To: cygwin-apps

Yaakov Selkowitz writes:
> On Wed, 2020-06-03 at 13:51 +0200, Achim Gratz wrote:
>> 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.
>
> What exactly are you trying to "fix" with this?

The same thing as always: perl getting pulled in as a dependency for
perl_base, which defeats the whole purpose of having a base package in
the first place.  Again, the dependency extraction just doesn't quite
work for things that have optional dependencies that are used if present
and do no harm if not: cygport will always pull them in and makes them a
hard requirement.

There's an obvious copy&paste bug in the patch, btw.


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

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cygport: suppress spurious package dependencies
  2020-06-03 17:56   ` Achim Gratz
@ 2020-06-14 10:53     ` Achim Gratz
  0 siblings, 0 replies; 4+ messages in thread
From: Achim Gratz @ 2020-06-14 10:53 UTC (permalink / raw)
  To: cygwin-apps

Achim Gratz writes:
>> What exactly are you trying to "fix" with this?
>
> The same thing as always: perl getting pulled in as a dependency for
> perl_base, which defeats the whole purpose of having a base package in
> the first place.  Again, the dependency extraction just doesn't quite
> work for things that have optional dependencies that are used if present
> and do no harm if not: cygport will always pull them in and makes them a
> hard requirement.
>
> There's an obvious copy&paste bug in the patch, btw.

The corrected patch can be had from:
https://repo.or.cz/cygport/rpm-style.git/commitdiff/46a1534b523ada57855f5412f683c77a29dbed00


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

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-14 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 11:51 [PATCH] cygport: suppress spurious package dependencies Achim Gratz
2020-06-03 16:32 ` Yaakov Selkowitz
2020-06-03 17:56   ` Achim Gratz
2020-06-14 10:53     ` Achim Gratz

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).