diff options
author | jlam <jlam@pkgsrc.org> | 2002-11-21 10:11:57 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2002-11-21 10:11:57 +0000 |
commit | e44ac5236f55723bf720ee64e941fab373d86a41 (patch) | |
tree | 6df7ca5032ac2dce1392495a7edde738cd5bfda3 /mk/install/deinstall | |
parent | d2054ffc609007ad2dca038dbbe5c8aec91dbb7d (diff) | |
download | pkgsrc-e44ac5236f55723bf720ee64e941fab373d86a41.tar.gz |
Don't blindly assume that directores listed in OWN_DIRS* and MAKE_DIRS*
that are outside of ${LOCALBASE} belong to the package that lists them.
If the directory already exists before the package is installed, then
we don't presume ownership of the directory.
This addresses pkg/18383 by Grant Beattie.
Diffstat (limited to 'mk/install/deinstall')
-rw-r--r-- | mk/install/deinstall | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mk/install/deinstall b/mk/install/deinstall index 854283fa15f..87ff7254e49 100644 --- a/mk/install/deinstall +++ b/mk/install/deinstall @@ -1,6 +1,6 @@ # start of deinstall # -# $NetBSD: deinstall,v 1.15 2002/11/17 08:58:50 salo Exp $ +# $NetBSD: deinstall,v 1.16 2002/11/21 10:11:57 jlam Exp $ eval set -- ${PKG_USERS} for userset; do @@ -112,7 +112,13 @@ POST-DEINSTALL) eval set -- ${ALL_DIRS} for dir; do if [ "${_PKG_CONFIG}" = "YES" ]; then - ${RMDIR} -p "${dir}" 2>/dev/null || ${TRUE} + if [ -f "${dir}/.pkgsrc" ]; then + dirowner=`${HEAD} -1 "${dir}/.pkgsrc"` + if [ "${dirowner}" = "${PKGBASE}" ]; then + ${RM} -f "${dir}/.pkgsrc" + ${RMDIR} -p "${dir}" 2>/dev/null || ${TRUE} + fi + fi is_make_dir=` \ eval set -- ${ALL_MAKE_DIRS}; \ is_make_dir=0; \ |