xbps-src: Add remove-obsoletes command

This commit is contained in:
Michael Aldridge 2021-04-11 02:32:01 -07:00
parent a30fee551f
commit f5e766c248
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,6 @@
remove_obsoletes () {
for repo in $XBPS_HOSTDIR/binpkgs $XBPS_HOSTDIR/binpkgs/debug $XBPS_HOSTDIR/binpkgs/nonfree $XBPS_HOSTDIR/binpkgs/multilib/ $XBPS_HOSTDIR/binpkgs/multilib/nonfree ; do
msg_normal "Cleaning $repo\n"
XBPS_ARCH=${XBPS_CROSS_TARGET:-$XBPS_MACHINE} $XBPS_RINDEX_CMD -r $repo
done
}

View File

@ -78,6 +78,9 @@ remove <pkgname>
remove-autodeps remove-autodeps
Removes all package dependencies that were installed automatically. Removes all package dependencies that were installed automatically.
remove-obsoletes
Remove all obsolete packages from default repositories as detected by xbps-rindex.
purge-distfiles purge-distfiles
Removes all obsolete distfiles in <hostdir>/sources. Removes all obsolete distfiles in <hostdir>/sources.
@ -799,6 +802,9 @@ case "$XBPS_TARGET" in
read_pkg read_pkg
remove_pkg $XBPS_CROSS_BUILD remove_pkg $XBPS_CROSS_BUILD
;; ;;
remove-obsoletes)
remove_obsoletes
;;
list) list)
$XBPS_QUERY_CMD -l $XBPS_QUERY_CMD -l
;; ;;