Date: Mon, 20 Aug 2012 13:47:09 GMT From: Pietro Cerutti <gahr@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/170784: [bsd.port.mk] [patch] resolve symlinks in PREFIX on deinstall Message-ID: <201208201347.q7KDl9oo053357@red.freebsd.org> Resent-Message-ID: <201208201350.q7KDo7HT000455@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 170784 >Category: ports >Synopsis: [bsd.port.mk] [patch] resolve symlinks in PREFIX on deinstall >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 20 13:50:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Pietro Cerutti >Release: >Organization: The FreeBSD Project >Environment: >Description: The deinstall target checks whether PREFIX equals the cwd registered at install time, but fails to resolve symlinks. >How-To-Repeat: mkdir -p /usr/tmp/prefix ln -sf prefix /usr/tmp/link sudo make -C /usr/ports/audio/etcd (whatever) install deinstall ===> Deinstalling for audio/etcd ===> etcd-1.0.1 has a different PREFIX: /usr/tmp/prefix, skipping >Fix: Patch attached with submission follows: Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk (revision 302796) +++ Mk/bsd.port.mk (working copy) @@ -4477,7 +4477,7 @@ check_name=`${ECHO_CMD} $${p} | ${SED} -e 's/-[^-]*$$//'`; \ if [ "$${check_name}" = "${PKGBASE}" ]; then \ prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \ - if [ "x${PREFIX}" = "x$${prfx}" ]; then \ + if [ "x`${READLINK_CMD} -f ${PREFIX}`" = "x$${prfx}" ]; then \ ${ECHO_MSG} "===> Deinstalling $${p}"; \ ${PKG_DELETE} -f $${p}; \ else \ >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208201347.q7KDl9oo053357>