From: heindsight <heindsight@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Use unique names for bulk update commands
Date: Sat, 15 Oct 2022 15:45:09 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-39969@inbox.vuxu.org> (raw)
[-- 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
next reply other threads:[~2022-10-15 13:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-15 13:45 heindsight [this message]
2022-10-15 13:56 ` [PR PATCH] [Closed]: " Duncaen
2022-10-15 13:57 ` Duncaen
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=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-39969@inbox.vuxu.org \
--to=heindsight@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/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 NNTP newsgroup(s).