aboutsummaryrefslogtreecommitdiff
path: root/libexec/build-make-uninstall
blob: 7e4c07afdddbf5e666945126028548287aeef777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env build

build_make_uninstall()
{(
	load_rules "${1}"

	if [ -f "${BUILDER_SYSDIR}/var/db/binpkgs/${CATEGORY}/${NAME}" ]; then
		echo "uninstalling: ${1}"

		cd "${BUILDER_SYSDIR}"
		# 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 "${BUILDER_SYSDIR}/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