Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src: depuplicate output of setup_pkg_depends
@ 2020-04-30 19:54 Chocimier
  2020-11-22  5:18 ` the-maldridge
  0 siblings, 1 reply; 2+ messages in thread
From: Chocimier @ 2020-04-30 19:54 UTC (permalink / raw)
  To: ml

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

There is a new pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org deduplicate-depends
https://github.com/void-linux/void-packages/pull/21493

xbps-src: depuplicate output of setup_pkg_depends
Issue #21044 raised problem of setup_pkg_depends returning duplicate results after depends of subpackages were included. Specifically, problem was performance and triggering failures of xbps-fbulk.

I was unable to reproduce fbulk's misbehavior, as show_pkg_build_depends deduplicates its output. Yet I don't see reason for listing duplicates here.

Please merge if you find it good.

A patch file from https://github.com/void-linux/void-packages/pull/21493.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-deduplicate-depends-21493.patch --]
[-- Type: text/x-diff, Size: 2405 bytes --]

From 2006142d5b6a4c957ebad731261ec8e2aa34b6b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Thu, 30 Apr 2020 21:40:02 +0200
Subject: [PATCH] xbps-src: depuplicate output of setup_pkg_depends

---
 common/xbps-src/shutils/build_dependencies.sh | 20 ++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh
index ebf5a0bc131..6ac86857173 100644
--- a/common/xbps-src/shutils/build_dependencies.sh
+++ b/common/xbps-src/shutils/build_dependencies.sh
@@ -1,7 +1,8 @@
 # vim: set ts=4 sw=4 et:
 #
 setup_pkg_depends() {
-    local pkg="$1" out="$2" with_subpkgs="$3" j _rpkgname _depname _pkgname foo _deps collected
+    local pkg="$1" out="$2" with_subpkgs="$3" j _rpkgname _depname _pkgname foo dep
+    local -A collected
 
     if [[ $pkg ]]; then
         # subpkg
@@ -9,15 +10,20 @@ setup_pkg_depends() {
             ${pkg}_package
         fi
     elif [[ $with_subpkgs ]]; then
-        collected="${depends}"
+        for dep in $depends; do
+            collected["${dep}"]="${dep}"
+        done
         for pkg in $subpackages; do
             [[ $pkg ]] || continue
             ${pkg}_package
-            collected+=" ${depends}"
+            for dep in $depends; do
+                collected["${dep}"]="${dep}"
+            done
         done
-        depends="${collected}"
+        depends="${collected[@]}"
     fi
 
+    collected=()
     for j in ${depends}; do
         _rpkgname="${j%\?*}"
         _depname="${j#*\?}"
@@ -32,19 +38,19 @@ setup_pkg_depends() {
             if [ -z "$foo" ]; then
                 msg_error "$pkgver: failed to resolve virtual dependency for '$j' (missing from etc/virtual)\n"
             fi
-            _deps+="$foo "
+            collected["$foo"]="$foo"
         else
             foo="$($XBPS_UHELPER_CMD getpkgdepname ${_depname} 2>/dev/null)"
             if [ -z "$foo" ]; then
                 foo="$($XBPS_UHELPER_CMD getpkgname ${_depname} 2>/dev/null)"
                 [ -z "$foo" ] && foo="${_depname}"
             fi
-            _deps+="$foo "
+            collected["$foo"]="$foo"
         fi
         run_depends+="${_depname} "
     done
 
-    [[ $out && $_deps ]] && echo "$_deps"
+    [[ $out && "${collected[@]}" ]] && echo "${collected[@]}"
     return 0
 }
 

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

* Re: xbps-src: depuplicate output of setup_pkg_depends
  2020-04-30 19:54 [PR PATCH] xbps-src: depuplicate output of setup_pkg_depends Chocimier
@ 2020-11-22  5:18 ` the-maldridge
  0 siblings, 0 replies; 2+ messages in thread
From: the-maldridge @ 2020-11-22  5:18 UTC (permalink / raw)
  To: ml

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

New comment by the-maldridge on void-packages repository

https://github.com/void-linux/void-packages/pull/21493#issuecomment-731700012

Comment:
@Duncaen I am satisfied with this PR, but I would like you to take a look as well.

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

end of thread, other threads:[~2020-11-22  5:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 19:54 [PR PATCH] xbps-src: depuplicate output of setup_pkg_depends Chocimier
2020-11-22  5:18 ` the-maldridge

Github messages for voidlinux

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/voidlinux-github

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 voidlinux-github voidlinux-github/ http://inbox.vuxu.org/voidlinux-github \
		voidlinux-github@inbox.vuxu.org
	public-inbox-index voidlinux-github

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.github.voidlinux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git