From 50904ddf4ea7db1cd28e0ff4d73bf18ffa13821b Mon Sep 17 00:00:00 2001 From: Mark Ferrell Date: Wed, 16 Apr 2014 07:54:03 -0700 Subject: Remove packages which are no longer valid * Before we start a build we check the SYSROOT for old packages which no longer have a valid package definition. This could be the result of a rename, or simply removing the package all together. Regardless, we remove it from the SYSROOT. --- libexec/build-make | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libexec') diff --git a/libexec/build-make b/libexec/build-make index 8a4bf9c..aa3f419 100755 --- a/libexec/build-make +++ b/libexec/build-make @@ -91,6 +91,21 @@ build_make() export BUILDER_MAKEFILE "${BUILDER_LIBDIR}/build-makedeps" || die "failed generate build dependencies" + for package in $(cd "${SYSROOT}/var/db/binpkgs" && echo */*); do + test -e "${SYSROOT}/var/db/binpkgs/${package}" || continue + name="${package##*/}" + category="${package%%/*}" + if ! build-query --exists "${category}/${name}"; then + echo "${category}/${name}: removing bad package" + (cd "${SYSROOT}" && + cat "var/db/binpkgs/${category}/${name}" | xargs -0 rm -f + rm "var/db/binpkgs/${category}/${name}") + fi + done + unset category + unset name + + packages= for package in "$@"; do case "${package}" in -- cgit v1.2.3-70-g09d2