ports/55616: Bugg in bsd.port.mk causes installed packages to be missed
mats at dufberg.se
mats at dufberg.se
Fri Aug 15 21:40:17 UTC 2003
>Number: 55616
>Category: ports
>Synopsis: Bugg in bsd.port.mk causes installed packages to be missed
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Aug 15 14:40:14 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Mats Dufberg
>Release: FreeBSD 5.0-RELEASE i386
>Organization:
private
>Environment:
>Description:
Code in ports/Mk/bsd.port.mk (ports/Mk/bsd.port.mk,v 1.461) is
meant to prevent a newer version of a package to be installed
if an older is already installed. If, say, unzip-5.50
(archivers/unzip) is installed, it should not be possible to
install unzip-5.50_2 (archivers/unzip) without being warned.
The code starts on line 3006 with target
"check-already-installed". Between lines 3009 and 3022 the
installed package is captured and set in the variable
"found_package". This part of the code is only done for
OSVERSION > 460102.
If the packed is already installed package, code on lines 3024
to 3036 is meant to return an error message. There are two
cases, the package is installed with the same version or the
package is installed with an older version. The first case
works, but not the second.
>How-To-Repeat:
Try to do "make install" on a package in the ports tree, which
already is installed, but with an older version.
>Fix:
The control variable "found_package" is set on line 3017
("found_package=$${p}") and tested on line 3024. The setting
of the variable is correct, but it does not survive to line
3024. I guess that the environment varible scope does not
extend that far. Is the code run in a forked environment?
I do not how to make the variable survive.
Lines 3008 ti 3036 from the file:
.if ${OSVERSION} >= 460102
@${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed"
@already_installed=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \
if [ -n "$${already_installed}" ]; then \
for p in $${already_installed}; do \
prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${HEAD} -n 1 | ${SED} -ne '1s|^@cwd ||p'`; \
if [ "x${PREFIX}" = "x$${prfx}" ]; then \
df=`${PKG_INFO} -q -f $${p} 2> /dev/null | ${GREP} -v "^@" | ${COMM} -12 - ${TMPPLIST}`; \
if [ -n "$${df}" ]; then \
found_package=$${p}; \
break; \
fi; \
fi; \
done; \
fi;
.endif
@if [ -d ${PKG_DBDIR}/${PKGNAME} -o -n "$${found_package}" ]; then \
if [ -d ${PKG_DBDIR}/${PKGNAME} ]; then \
${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
else \
${ECHO_CMD} "===> An older version of ${PKGORIGIN} is already installed ($${found_package})"; \
fi; \
${ECHO_CMD} " You may wish to \`\`make deinstall'' and install this port again"; \
${ECHO_CMD} " by \`\`make reinstall'' to upgrade it properly."; \
${ECHO_CMD} " If you really wish to overwrite the old port of ${PKGORIGIN}"; \
${ECHO_CMD} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
${ECHO_CMD} " in your environment or the \"make install\" command line."; \
exit 1; \
fi
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list