Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src: Add remove-obsoletes command
@ 2021-04-11  9:33 the-maldridge
  2021-04-12  9:33 ` [PR PATCH] [Updated] " the-maldridge
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: the-maldridge @ 2021-04-11  9:33 UTC (permalink / raw)
  To: ml

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

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

https://github.com/the-maldridge/void-packages remove-obsoletes
https://github.com/void-linux/void-packages/pull/30147

xbps-src: Add remove-obsoletes command
This cleans more than it probably should since it will clean several layers of nesting.  We could enable globstar and iterate over everything it finds, but I'm not particularly keen on this.

Open to changes on this, looking for feedback.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-remove-obsoletes-30147.patch --]
[-- Type: text/x-diff, Size: 1512 bytes --]

From a4d3727455110541def5d089587fc08ebae0d06e Mon Sep 17 00:00:00 2001
From: Michael Aldridge <maldridge@VoidLinux.org>
Date: Sun, 11 Apr 2021 02:32:01 -0700
Subject: [PATCH] xbps-src: Add remove-obsoletes command

---
 common/xbps-src/shutils/remove_obsoletes.sh | 6 ++++++
 xbps-src                                    | 6 ++++++
 2 files changed, 12 insertions(+)
 create mode 100644 common/xbps-src/shutils/remove_obsoletes.sh

diff --git a/common/xbps-src/shutils/remove_obsoletes.sh b/common/xbps-src/shutils/remove_obsoletes.sh
new file mode 100644
index 000000000000..63e29300e930
--- /dev/null
+++ b/common/xbps-src/shutils/remove_obsoletes.sh
@@ -0,0 +1,6 @@
+remove_obsoletes () {
+    for repo in $XBPS_HOSTDIR/binpkgs $XBPS_HOSTDIR/binpkgs/*/ $XBPS_HOSTDIR/binpkgs/*/*/ ; do
+        msg_normal "Cleaning $repo\n"
+        $XBPS_RINDEX_CMD -r $repo
+    done
+}
diff --git a/xbps-src b/xbps-src
index 9d88873ab2c5..379bdd36bfd6 100755
--- a/xbps-src
+++ b/xbps-src
@@ -78,6 +78,9 @@ remove <pkgname>
 remove-autodeps
     Removes all package dependencies that were installed automatically.
 
+remove-obsoletes
+    Remove all obsolete packages from default repositories as detected by xbps-rindex.
+
 purge-distfiles
     Removes all obsolete distfiles in <hostdir>/sources.
 
@@ -799,6 +802,9 @@ case "$XBPS_TARGET" in
         read_pkg
         remove_pkg $XBPS_CROSS_BUILD
         ;;
+    remove-obsoletes)
+        remove_obsoletes
+        ;;
     list)
         $XBPS_QUERY_CMD -l
         ;;

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

end of thread, other threads:[~2021-04-15  6:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-11  9:33 [PR PATCH] xbps-src: Add remove-obsoletes command the-maldridge
2021-04-12  9:33 ` [PR PATCH] [Updated] " the-maldridge
2021-04-12 17:22 ` [PR REVIEW] " Chocimier
2021-04-12 17:26 ` the-maldridge
2021-04-12 17:49 ` ericonr
2021-04-12 17:49 ` ericonr
2021-04-12 17:58 ` the-maldridge
2021-04-13  3:36 ` [PR PATCH] [Updated] " the-maldridge
2021-04-13  3:39 ` the-maldridge
2021-04-13 21:14 ` Duncaen
2021-04-13 21:14 ` Duncaen
2021-04-15  5:45 ` [PR PATCH] [Updated] " the-maldridge
2021-04-15  6:08 ` [PR PATCH] [Merged]: " the-maldridge

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