From: Duncaen <Duncaen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] xbps-src: add update-local and show-local-updates
Date: Mon, 27 Jun 2022 00:50:38 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-37700@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 968 bytes --]
There is a new pull request by Duncaen against master on the void-packages repository
https://github.com/Duncaen/void-packages update-local
https://github.com/void-linux/void-packages/pull/37700
xbps-src: add update-local and show-local-updates
This makes it simple to bulk build all your outdated packages in the local repository, works with `-r` and branch repos.
There are two similar commands that already exist:
1. `update-sys` which builds outdated installed packages.
2. `update-bulk` which builds outdated packages in configured repositories, so depends on having synced the hosts repositories
and depends on builds already being finished in the remote repos.
With `update-local` you can instead just build a packages manually once and then update them with `./xbps-src update-local` without depending on the state of the host system or remote repositories.
A patch file from https://github.com/void-linux/void-packages/pull/37700.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-local-37700.patch --]
[-- Type: text/x-diff, Size: 3491 bytes --]
From c9f3acb43a14d88a90242648a9eeeedb74d1e253 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Sun, 18 Apr 2021 16:54:42 +0200
Subject: [PATCH] xbps-src: add update-local and show-local-updates
---
common/xbps-src/shutils/bulk.sh | 21 ++++++++++++++-------
xbps-src | 16 ++++++++++++++--
2 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/common/xbps-src/shutils/bulk.sh b/common/xbps-src/shutils/bulk.sh
index c0228f10ac2b..b0c39b2b7398 100644
--- a/common/xbps-src/shutils/bulk.sh
+++ b/common/xbps-src/shutils/bulk.sh
@@ -54,7 +54,7 @@ bulk_sortdeps() {
}
bulk_build() {
- local sys="$1"
+ local cmd="$1"
local NPROCS=$(($(nproc)*2))
local NRUNNING=0
@@ -67,10 +67,17 @@ bulk_build() {
fi
# Compare installed pkg versions vs srcpkgs
- if [[ $sys ]]; then
- bulk_sortdeps $(xbps-checkvers -f '%n' -I -D $XBPS_DISTDIR)
+ case "$cmd" in
+ installed)
+ bulk_sortdeps $(xbps-checkvers -f '%n' -I -D "$XBPS_DISTDIR")
return $?
- fi
+ ;;
+ local)
+ bulk_sortdeps $(xbps-checkvers -f '%n' -i -R "${XBPS_REPOSITORY}" -R "${XBPS_REPOSITORY}/nonfree" -D "$XBPS_DISTDIR")
+ return $?
+ ;;
+ esac
+
# compare repo pkg versions vs srcpkgs
for f in $(xbps-checkvers -f '%n' -D $XBPS_DISTDIR); do
if [ $NRUNNING -eq $NPROCS ]; then
@@ -90,9 +97,9 @@ bulk_build() {
}
bulk_update() {
- local args="$1" pkgs f rval
+ local cmd="$1" pkgs f rval
- pkgs="$(bulk_build ${args})"
+ pkgs="$(bulk_build "${cmd}")"
[[ -z $pkgs ]] && return 0
msg_normal "xbps-src: the following packages must be rebuilt and updated:\n"
@@ -112,7 +119,7 @@ bulk_update() {
msg_error "xbps-src: failed to build $pkgver pkg!\n"
fi
done
- if [ -n "$pkgs" -a -n "$args" ]; then
+ if [ -n "$pkgs" -a "$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
diff --git a/xbps-src b/xbps-src
index 4e8349091708..ccf008db4894 100755
--- a/xbps-src
+++ b/xbps-src
@@ -122,6 +122,9 @@ show-repo-updates
show-sys-updates
Prints the list of outdated packages in your system.
+show-local-updates
+ Prints the list of outdated packages in your local repositories.
+
sort-dependencies <pkg> <pkgN+1> ...
Given a list of packages specified as additional arguments, a sorted dependency
list will be returned to stdout.
@@ -132,6 +135,9 @@ update-bulk
update-sys
Rebuilds all packages in your system that are outdated and updates them.
+update-local
+ Rebuilds all packages in your local repositories that are outdated.
+
update-check <pkgname>
Check upstream site of <pkgname> for new releases.
@@ -962,7 +968,10 @@ case "$XBPS_TARGET" in
bulk_build
;;
show-sys-updates)
- bulk_build -I
+ bulk_build installed
+ ;;
+ show-local-updates)
+ bulk_build local
;;
sort-dependencies)
bulk_sortdeps ${@/$XBPS_TARGET/}
@@ -971,7 +980,10 @@ case "$XBPS_TARGET" in
bulk_update
;;
update-sys)
- bulk_update -I
+ bulk_update installed
+ ;;
+ update-local)
+ bulk_update local
;;
update-check)
read_pkg ignore-problems
next reply other threads:[~2022-06-26 22:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-26 22:50 Duncaen [this message]
2022-06-27 7:49 ` dkwo
2022-09-26 2:15 ` github-actions
2022-09-27 17:11 ` [PR PATCH] [Merged]: " Duncaen
-- strict thread matches above, loose matches on Subject: below --
2021-04-18 14:59 [PR PATCH] " 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-37700@inbox.vuxu.org \
--to=duncaen@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).