Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Use unique names for bulk update commands
@ 2022-10-15 13:45 heindsight
  2022-10-15 13:56 ` [PR PATCH] [Closed]: " Duncaen
  2022-10-15 13:57 ` Duncaen
  0 siblings, 2 replies; 3+ messages in thread
From: heindsight @ 2022-10-15 13:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/heindsight/void-packages fix-update-sys
https://github.com/void-linux/void-packages/pull/39969

Use unique names for bulk update commands
A regression introduced in 4c43245e0b (#37700) is causing the `xbps-src update-sys` command to skip the final step of installing the updated packages.

This happens because the `cmd` variable name clashes with a loop variable used in common/environment/setup/install.sh script [line 16](/void-linux/void-packages/blob/4c43245e0b989fa85fe57090a1a584d6e6650546/common/environment/setup/install.sh#L16). Thus the `"$cmd" == installed` comparison ([common/xbps-src/shutils/bulk.sh line 122](/void-linux/void-packages/blob/4c43245e0b989fa85fe57090a1a584d6e6650546/common/xbps-src/shutils/bulk.sh#L122)) fails and the installation step is skipped.

Using unique variable names in `bulk.sh` avoids this problem.

#### Testing the changes
- I tested the changes in this PR: **YES**

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fix-update-sys-39969.patch --]
[-- Type: text/x-diff, Size: 2202 bytes --]

From 234ab1e52ddadc89077a816434a20e9745ce208c Mon Sep 17 00:00:00 2001
From: Heinrich Kruger <heindsight@kruger.dev>
Date: Sat, 15 Oct 2022 14:24:37 +0100
Subject: [PATCH] Use unique names for bulk update commands

A regression introduced in 4c43245e0b is causing the 'xbps-src update-sys'
command to skip the final step of installing the updated packages.

This happens because the `cmd` variable name clashes with a loop
variable used in common/environment/setup/install.sh script (line 16).
Thus the `"$cmd" == installed` comparison
(common/xbps-src/shutils/bulk.sh line 122) fails and the installation
step is skipped.

Using unique variable names in `bulk.sh` avoids this problem.
---
 common/xbps-src/shutils/bulk.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/xbps-src/shutils/bulk.sh b/common/xbps-src/shutils/bulk.sh
index b0c39b2b7398..31732abe50a1 100644
--- a/common/xbps-src/shutils/bulk.sh
+++ b/common/xbps-src/shutils/bulk.sh
@@ -54,7 +54,7 @@ bulk_sortdeps() {
 }
 
 bulk_build() {
-    local cmd="$1"
+    local bulk_build_cmd="$1"
     local NPROCS=$(($(nproc)*2))
     local NRUNNING=0
 
@@ -67,7 +67,7 @@ bulk_build() {
     fi
 
     # Compare installed pkg versions vs srcpkgs
-    case "$cmd" in
+    case "$bulk_build_cmd" in
     installed)
         bulk_sortdeps $(xbps-checkvers -f '%n' -I -D "$XBPS_DISTDIR")
         return $?
@@ -97,9 +97,9 @@ bulk_build() {
 }
 
 bulk_update() {
-    local cmd="$1" pkgs f rval
+    local bulk_update_cmd="$1" pkgs f rval
 
-    pkgs="$(bulk_build "${cmd}")"
+    pkgs="$(bulk_build "${bulk_update_cmd}")"
     [[ -z $pkgs ]] && return 0
 
     msg_normal "xbps-src: the following packages must be rebuilt and updated:\n"
@@ -119,7 +119,7 @@ bulk_update() {
             msg_error "xbps-src: failed to build $pkgver pkg!\n"
         fi
     done
-    if [ -n "$pkgs" -a "$cmd" == installed ]; then
+    if [ -n "$pkgs" -a "$bulk_update_cmd" == installed ]; then
         echo
         msg_normal "xbps-src: updating your system, confirm to proceed...\n"
         ${XBPS_SUCMD} "xbps-install --repository=$XBPS_REPOSITORY --repository=$XBPS_REPOSITORY/nonfree -u ${pkgs//[$'\n']/ }" || return 1

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

* Re: [PR PATCH] [Closed]: Use unique names for bulk update commands
  2022-10-15 13:45 [PR PATCH] Use unique names for bulk update commands heindsight
@ 2022-10-15 13:56 ` Duncaen
  2022-10-15 13:57 ` Duncaen
  1 sibling, 0 replies; 3+ messages in thread
From: Duncaen @ 2022-10-15 13:56 UTC (permalink / raw)
  To: ml

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

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

Use unique names for bulk update commands
https://github.com/void-linux/void-packages/pull/39969

Description:
A regression introduced in 4c43245e0b (#37700) is causing the `xbps-src update-sys` command to skip the final step of installing the updated packages.

This happens because the `cmd` variable name clashes with a loop variable used in common/environment/setup/install.sh script [line 16](/void-linux/void-packages/blob/4c43245e0b989fa85fe57090a1a584d6e6650546/common/environment/setup/install.sh#L16). Thus the `"$cmd" == installed` comparison ([common/xbps-src/shutils/bulk.sh line 122](/void-linux/void-packages/blob/4c43245e0b989fa85fe57090a1a584d6e6650546/common/xbps-src/shutils/bulk.sh#L122)) fails and the installation step is skipped.

Using unique variable names in `bulk.sh` avoids this problem.

#### Testing the changes
- I tested the changes in this PR: **YES**

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

* Re: Use unique names for bulk update commands
  2022-10-15 13:45 [PR PATCH] Use unique names for bulk update commands heindsight
  2022-10-15 13:56 ` [PR PATCH] [Closed]: " Duncaen
@ 2022-10-15 13:57 ` Duncaen
  1 sibling, 0 replies; 3+ messages in thread
From: Duncaen @ 2022-10-15 13:57 UTC (permalink / raw)
  To: ml

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

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/39969#issuecomment-1279751387

Comment:
Thank you for finding this, i hate shell lol.

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

end of thread, other threads:[~2022-10-15 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-15 13:45 [PR PATCH] Use unique names for bulk update commands heindsight
2022-10-15 13:56 ` [PR PATCH] [Closed]: " Duncaen
2022-10-15 13:57 ` Duncaen

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