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
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ 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] 8+ 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
  2020-12-20  2:04 ` ericonr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ 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] 8+ 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
@ 2020-12-20  2:04 ` ericonr
  2021-02-16  5:47 ` ericonr
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2020-12-20  2:04 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

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

Comment:
Ping @Duncaen 

^ permalink raw reply	[flat|nested] 8+ 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
  2020-12-20  2:04 ` ericonr
@ 2021-02-16  5:47 ` ericonr
  2022-04-16  2:02 ` github-actions
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2021-02-16  5:47 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

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

Comment:
Ping

^ permalink raw reply	[flat|nested] 8+ 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
                   ` (2 preceding siblings ...)
  2021-02-16  5:47 ` ericonr
@ 2022-04-16  2:02 ` github-actions
  2022-05-01  2:13 ` [PR PATCH] [Closed]: " github-actions
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: github-actions @ 2022-04-16  2:02 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

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

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [PR PATCH] [Closed]: xbps-src: depuplicate output of setup_pkg_depends
  2020-04-30 19:54 [PR PATCH] xbps-src: depuplicate output of setup_pkg_depends Chocimier
                   ` (3 preceding siblings ...)
  2022-04-16  2:02 ` github-actions
@ 2022-05-01  2:13 ` github-actions
  2022-05-01 19:07 ` ericonr
  2022-05-07 17:46 ` Chocimier
  6 siblings, 0 replies; 8+ messages in thread
From: github-actions @ 2022-05-01  2:13 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

xbps-src: depuplicate output of setup_pkg_depends
https://github.com/void-linux/void-packages/pull/21493

Description:
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.

^ permalink raw reply	[flat|nested] 8+ 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
                   ` (4 preceding siblings ...)
  2022-05-01  2:13 ` [PR PATCH] [Closed]: " github-actions
@ 2022-05-01 19:07 ` ericonr
  2022-05-07 17:46 ` Chocimier
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2022-05-01 19:07 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

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

Comment:
@Chocimier would you like to try merging this?

^ permalink raw reply	[flat|nested] 8+ 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
                   ` (5 preceding siblings ...)
  2022-05-01 19:07 ` ericonr
@ 2022-05-07 17:46 ` Chocimier
  6 siblings, 0 replies; 8+ messages in thread
From: Chocimier @ 2022-05-07 17:46 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

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

Comment:
Either way is good enough, feel free to merge if you find this useful.

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

end of thread, other threads:[~2022-05-07 17:46 UTC | newest]

Thread overview: 8+ 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
2020-12-20  2:04 ` ericonr
2021-02-16  5:47 ` ericonr
2022-04-16  2:02 ` github-actions
2022-05-01  2:13 ` [PR PATCH] [Closed]: " github-actions
2022-05-01 19:07 ` ericonr
2022-05-07 17:46 ` Chocimier

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 NNTP newsgroup(s).