diff options
author | Bryan Drewery <bryan@shatow.net> | 2021-09-03 21:25:55 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-09-03 23:38:15 +0300 |
commit | 18af2abf58f34a4497a4110f84d9b7eb0ff88653 (patch) | |
tree | ec5d19d1bd75952f25f3e684591f46589f7797b6 /src | |
parent | b999f9fd3a3c59a1451bb2eaed317cabf7569703 (diff) |
delete_pkg helpers belong with pkg.sh as they are for caching
Diffstat (limited to 'src')
-rw-r--r-- | src/share/poudriere/common.sh | 28 | ||||
-rw-r--r-- | src/share/poudriere/include/pkg.sh | 28 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 5771d805..359f03c8 100644 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -5397,34 +5397,6 @@ ensure_pkg_installed() { -C "${PKG_BIN%/*}" -s ",.*/,," "*/pkg-static" } -delete_pkg() { - [ $# -ne 1 ] && eargs delete_pkg pkg - local pkg="$1" - - # Delete the package and the depsfile since this package is being deleted, - # which will force it to be recreated - unlink "${pkg}" - clear_pkg_cache "${pkg}" -} - -# Keep in sync with delete_pkg -delete_pkg_xargs() { - [ $# -ne 2 ] && eargs delete_pkg listfile pkg - local listfile="$1" - local pkg="$2" - local pkg_cache_dir - - get_pkg_cache_dir pkg_cache_dir "${pkg}" 0 - - # Delete the package and the depsfile since this package is being deleted, - # which will force it to be recreated - { - echo "${pkg}" - echo "${pkg_cache_dir}" - } >> "${listfile}" - # XXX: May need clear_pkg_cache here if shash changes from file. -} - # Incremental rebuild checks. # # Most checks here operate on PKGNAME which is *unique* for any given diff --git a/src/share/poudriere/include/pkg.sh b/src/share/poudriere/include/pkg.sh index 786a0455..24ccc4ee 100644 --- a/src/share/poudriere/include/pkg.sh +++ b/src/share/poudriere/include/pkg.sh @@ -312,3 +312,31 @@ delete_all_pkgs() { rm -rf ${PACKAGES:?}/* ${cache_dir} echo " done" } + +delete_pkg() { + [ $# -ne 1 ] && eargs delete_pkg pkg + local pkg="$1" + + # Delete the package and the depsfile since this package is being deleted, + # which will force it to be recreated + unlink "${pkg}" + clear_pkg_cache "${pkg}" +} + +# Keep in sync with delete_pkg +delete_pkg_xargs() { + [ $# -ne 2 ] && eargs delete_pkg listfile pkg + local listfile="$1" + local pkg="$2" + local pkg_cache_dir + + get_pkg_cache_dir pkg_cache_dir "${pkg}" 0 + + # Delete the package and the depsfile since this package is being deleted, + # which will force it to be recreated + { + echo "${pkg}" + echo "${pkg_cache_dir}" + } >> "${listfile}" + # XXX: May need clear_pkg_cache here if shash changes from file. +} |