diff options
author | Bryan Drewery <bryan@shatow.net> | 2021-09-03 23:37:10 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-09-03 23:38:15 +0300 |
commit | 14d46f876b9d78711129cfc245080bd3056610a4 (patch) | |
tree | 6ef8055e8669da04c16c0795ca7207bea85c7564 /src | |
parent | 18af2abf58f34a4497a4110f84d9b7eb0ff88653 (diff) |
delete_pkg: Reduce spam; ignore pkg.txz compat symlinks
Diffstat (limited to 'src')
-rw-r--r-- | src/share/poudriere/common.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 359f03c8..cf8312e9 100644 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -5448,14 +5448,35 @@ delete_old_pkg() { local pkgbase new_pkgbase flavor pkg_flavor originspec local dep_pkgname dep_pkgbase dep_origin dep_flavor dep_dep_args local ignore new_origin stale_pkg dep_args pkg_dep_args - local pkg_arch no_arch arch + local pkg_arch no_arch arch is_sym pkgfile="${pkg##*/}" pkgname="${pkgfile%.*}" if [ "${DELETE_UNKNOWN_FILES}" = "yes" ]; then + is_sym=0 + if [ -L "${pkg}" ]; then + is_sym=1 + fi + if [ "${is_sym}" -eq 1 ] && [ ! -e "${pkg}" ]; then + msg "Deleting ${COLOR_PORT}${pkgfile}${COLOR_RESET}: dead symlink" + delete_pkg "${pkg}" + return 0 + fi case "${pkgfile}" in *.${PKG_EXT}) ;; + *.txz) + # If this is a symlink to a .pkg file then just ignore + # as the ports framework or pkg sometimes creates them. + if [ "${is_sym}" -eq 1 ]; then + case "$(realpath "${pkg}")" in + *.${PKG_EXT}) + msg_debug "Ignoring symlinked ${COLOR_PORT}${pkgfile}${COLOR_RESET}" + return 0 + ;; + esac + fi + ;& # FALTHROUGH *) msg "Deleting ${COLOR_PORT}${pkgfile}${COLOR_RESET}: unknown or obsolete file" delete_pkg "${pkg}" |