diff options
author | Bryan Drewery <bryan@shatow.net> | 2020-04-09 00:49:12 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2020-04-09 00:49:12 +0300 |
commit | b19ef339b1a3f3ce8ecdc623ab20e15b93060302 (patch) | |
tree | 02ebc0658088849c86a5ab049033af1c9a4552f8 | |
parent | a2c3bdc9b4e525475031dee46396114d5d96b745 (diff) |
bulk -af: Delete unqueued packages like pkgclean.
This only does it for -a and -f as those are fully consistent repository
requests. If the user is doing some one-off build of specific ports then
it would be unexpected to trim the whole repository away.
Issue #747
-rwxr-xr-x | src/share/poudriere/common.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 0c839dd1..7454bab9 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -5050,7 +5050,12 @@ delete_old_pkg() { originspec_encode originspec "${origin}" "${pkg_dep_args}" \ "${pkg_flavor}" if ! originspec_is_needed_and_not_ignored "${originspec}"; then - msg_debug "delete_old_pkg: Skip unqueued ${pkg} ${originspec}" + if [ ${ALL} -eq 1 -o -n "${LISTPKGS}" ]; then + msg "Deleting ${pkg##*/}: no longer needed" + delete_pkg "${pkg}" + else + msg_debug "delete_old_pkg: Skip unqueued ${pkg} ${originspec}" + fi return 0 fi # Apparently we expect this package via its origin and flavor. |