Recent bsd.port.mk changes
Sergey Matveychuk
sem at ciam.ru
Tue Apr 22 05:53:33 PDT 2003
Kris Kennaway пишет:
> On Tue, Apr 22, 2003 at 04:04:52AM +0400, Sergey Matveychuk wrote:
>
>>Kris Kennaway wrote:
>>
>>
>>>If you compile e.g. python modules against multiple versions of
>>>python, they will have different package names and install in
>>>different places (so the packages do not conflict at all), but the
>>>same origin. The new check will not allow the user to do this.
>>
>>I'v never seen this case. How looks like its names in PKG_DBDIR?
>
>
> They set a different PKGNAMEPREFIX: e.g. py-, py22-, ...
>
> Look at bsd.python.mk for the implementation.
>
> Kris
Here is a patch. Take a look. I'v added deinstall target there too. I
guess it's looks better than a first one.
--- bsd.port.mk.orig Wed Apr 9 12:37:24 2003
+++ bsd.port.mk Tue Apr 22 04:34:33 2003
@@ -2894,8 +2894,11 @@
.if !target(check-already-installed)
check-already-installed:
.if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
- @if [ -d ${PKG_DBDIR}/${PKGNAME} -o \
- "x`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`" != "x" ]; then \
+ @found_pkgs=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null | ${SED}
-e 's#\(.*\)-.*$$#\1#'`; \
+ for i in $${found_pkgs}; do \
+ if [ "$$i" = "${PKGBASE}" ]; then found=1; break; fi \
+ done; \
+ if [ -d ${PKG_DBDIR}/${PKGNAME} -o "$${found}" ]; then \
${ECHO_CMD} "===> ${PKGNAME} is already installed - perhaps an
older version?"; \
${ECHO_CMD} " If so, you may wish to \`\`make deinstall'' and
install"; \
${ECHO_CMD} " this port again by \`\`make reinstall'' to
upgrade it properly."; \
@@ -3238,8 +3241,11 @@
.if !target(deinstall)
deinstall:
- @deinstall_name=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \
- ${TEST} -z $${deinstall_name} && deinstall_name=${PKGNAME}; \
+ @if ${PKG_INFO} -e ${PKGNAME}; then \
+ deinstall_name=${PKGNAME}; \
+ else \
+ deinstall_name=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \
+ fi; \
${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN} ($${deinstall_name})"; \
if ${PKG_INFO} -e $${deinstall_name} 2> /dev/null; then \
${PKG_DELETE} -f $${deinstall_name}; \
--
Sem.
More information about the freebsd-ports
mailing list