aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMark Ferrell <major@homeonderanged.org>2014-04-16 07:54:03 -0700
committerMark Ferrell <major@homeonderanged.org>2014-04-16 07:54:03 -0700
commit50904ddf4ea7db1cd28e0ff4d73bf18ffa13821b (patch)
tree4f842a7c8b23fdf3b40e852d89a9e83d5f711867 /libexec
parent0a7ef798040b4139b00427843c342ceee82a7eee (diff)
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.
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/build-make15
1 files changed, 15 insertions, 0 deletions
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