ports/58149: [patch] Mk/bsd.port.mk: Make CONFLICTS compare prefix for installed packages and PREFIX.

Clement Laforet sheepkiller at cultdeadsheep.org
Thu Oct 16 22:41:42 UTC 2003


>Number:         58149
>Category:       ports
>Synopsis:       [patch] Mk/bsd.port.mk: Make CONFLICTS compare prefix for installed packages and PREFIX.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 16 15:40:21 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Clement Laforet
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
cotds.org
>Environment:
System: FreeBSD lucifer.cultdeadsheep.org 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Mon Sep 22 08:20:10 CEST 2003 clement at lucifer.cultdeadsheep.org:/usr/obj/usr/src/sys/LUCIFER i386


	
>Description:
	When a port uses CONFLICTS, packages are detected but their prefix are not compared with user defined PREFIX.
	Even if it's not a critical problem. it would be nice to avoid setting DISABLE_CONFLICTS in these case.

>How-To-Repeat:
	pkg_add -r inn
	cd ${PORTDIRS}/news/inn-stable
	make PREFIX=/foo/path install
>Fix:

	

--- CONFLICTS_checks_prefix-bsd.port.mk.diff begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /WORK/REPO/ports/Mk/bsd.port.mk,v
retrieving revision 1.468
diff -u -r1.468 bsd.port.mk
--- bsd.port.mk	3 Sep 2003 19:50:24 -0000	1.468
+++ bsd.port.mk	11 Oct 2003 20:21:24 -0000
@@ -2990,15 +2990,25 @@
 .endfor
 	@if [ -s ${WRKDIR}/.CONFLICTS ]; then \
 		found=`cat ${WRKDIR}/.CONFLICTS | ${SED} -e s'|${PKG_DBDIR}/||g' | tr '\012' ' '`; \
-		${ECHO_MSG} "===>  ${PKGNAME} conflicts with installed package(s): "; \
+		conflicting=0; \
+		${ECHO_MSG} "===>  ${PKGNAME} may conflict with installed package(s): "; \
 		for entry in $$found; do \
-			${ECHO_MSG} "      $$entry"; \
+			${ECHO_MSG} -n "      $$entry:"; \
+		prfx=`${PKG_INFO} -q -p $${entry} 2> /dev/null | ${HEAD} -n 1 | ${SED} -ne '1s|^@cwd ||p'`; \
+		if [ "x$${PREFIX}" = "x$${prfx}" ]; then \
+			conflicting=1;\
+			${ECHO_MSG} " yes.";\
+			else \
+			${ECHO_MSG} " no.";\
+		fi;\
 		done; \
 		${ECHO_MSG}; \
+		if [ "x$${conflicting}" = "x1" ] ; then \
 		${ECHO_MSG} "      They install files into the same place."; \
 		${ECHO_MSG} "      Please remove them first with pkg_delete(1)."; \
 		${RM} -f ${WRKDIR}/.CONFLICTS; \
 		exit 1; \
+		fi ;\
 	fi
 .endif  # CONFLICTS
 .endif
--- CONFLICTS_checks_prefix-bsd.port.mk.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list