aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/build-make-clean15
-rwxr-xr-xlibexec/build-make-compile2
-rwxr-xr-xlibexec/build-make-uninstall25
-rwxr-xr-xlibexec/build-makedeps2
4 files changed, 33 insertions, 11 deletions
diff --git a/libexec/build-make-clean b/libexec/build-make-clean
index 285d80e..248d087 100755
--- a/libexec/build-make-clean
+++ b/libexec/build-make-clean
@@ -5,25 +5,18 @@ build_make_clean()
load_rules "${1}"
if [ -z "${NOCLEAN}" ]; then
+ import build-make-uninstall
+
if [ -f "${BUILDER_ATFDIR}/${CATEGORY}/${NAME}-${VERSION}-${RELEASE}.${ARCHIVE_FORMAT}" ]; then
rm "${BUILDER_ATFDIR}/${CATEGORY}/${NAME}-${VERSION}-${RELEASE}.${ARCHIVE_FORMAT}" &
fi
- if [ -f "${SYSROOT}/var/db/binpkgs/${CATEGORY}/${NAME}" ]; then
- cd "${SYSROOT}"
- # FIXME: we are failing to handle file collisions produce in
- # this file.
- cat "var/db/binpkgs/${CATEGORY}/${NAME}" | xargs -0 rm -f &
- fi
if [ -d "${BUILDER_TMPDIR}/${CATEGORY}/${NAME}" ]; then
rm -rf "${BUILDER_TMPDIR}/${CATEGORY}/${NAME}" &
fi
- wait
+ build_make_uninstall "${1}" &
- # Clobber our package marker.
- if [ -f "${SYSROOT}/var/db/binpkgs/${CATEGORY}/${NAME}" ]; then
- rm "${SYSROOT}/var/db/binpkgs/${CATEGORY}/${NAME}"
- fi
+ wait
fi
)}
diff --git a/libexec/build-make-compile b/libexec/build-make-compile
index 3a5de16..6a2a8a9 100755
--- a/libexec/build-make-compile
+++ b/libexec/build-make-compile
@@ -32,6 +32,8 @@ build_make_compile()
trap build_make_compile_cleanup 0
load_rules "${1}"
+ build uninstall "${1}"
+
# Declare compilation variables before loading the rules as the package
# may potentially overwrite this data, in particular the toolchain data
# is usually rewritten within the toolchain/buildtools rule.
diff --git a/libexec/build-make-uninstall b/libexec/build-make-uninstall
new file mode 100755
index 0000000..b07da59
--- /dev/null
+++ b/libexec/build-make-uninstall
@@ -0,0 +1,25 @@
+#!/usr/bin/env build
+
+build_make_uninstall()
+{(
+ load_rules "${1}"
+
+ if [ -f "${SYSROOT}/var/db/binpkgs/${CATEGORY}/${NAME}" ]; then
+ echo "uninstalling: ${1}"
+
+ cd "${SYSROOT}"
+ # FIXME: we are failing to handle file collisions produce in
+ # this file.
+ cat "var/db/binpkgs/${CATEGORY}/${NAME}" | xargs -0 rm -f
+
+ # Clobber our package marker.
+ rm "${SYSROOT}/var/db/binpkgs/${CATEGORY}/${NAME}"
+ fi
+)}
+
+if test "${BUILDER_CALL_STACK}" = '__main__'; then
+ simple_usage 'uninstall' '[all|[<category>/]<package|all>]' "$@"
+ build_make_uninstall "${@}"
+fi
+
+# vim: filetype=sh
diff --git a/libexec/build-makedeps b/libexec/build-makedeps
index 1156626..c8aa1af 100755
--- a/libexec/build-makedeps
+++ b/libexec/build-makedeps
@@ -80,6 +80,7 @@ for package; do
fi
target="$(build_makedeps_name "${dep}")"
+ echo "${target}_uninstall: ${makedep_target}_uninstall"
echo "${target}_clean: ${makedep_target}_clean"
echo "${target}_distclean: ${makedep_target}_distclean"
echo "${makedep_prep}: ${SYSROOT}/var/db/binpkgs/${dep}"
@@ -181,6 +182,7 @@ for package; do
printf "${makedep_install}: ${makedep_package}\n\t@build-make-install '${package}'\n"
printf "${makedep_test}: ${makedep_install}\n\t@build-make-test '${package}'\n"
printf "${makedep_export}: ${makedep_install}\n\t@build-make-export '${package}'\n"
+ printf "${makedep_target}_uninstall:\n\t@build-make-uninstall '${package}'\n"
printf "${makedep_target}_clean:\n\t@build-make-clean '${package}'\n"
printf "${makedep_target}_distclean:\n\t@build-make-distclean '${package}'\n"