Subject: Re: pkg/9043: Package install signals missing dependency too late.
To: None <frank@wins.uva.nl>
From: Greg A. Woods <woods@most.weird.com>
List: netbsd-bugs
Date: 12/22/1999 22:59:24
[ On Wednesday, December 22, 1999 at 16:03:54 (+0100), frank@wins.uva.nl wrote: ]
> Subject: pkg/9043: Package install signals missing dependency too late.
>
> 	After happily transferring, compiling and installing a package that
> 	depends on another one, the package system comes to the conclusion
> 	that a dependency is missing, and says it does not register the
> 	package.  However, at that point, the package has already been
> 	installed, and it turns out to be registered anyway

Hmm... this sounds suspiciously like the bug I was trying to discuss
(with no reply as yet) in tech-pkg the other day.  However your example
doesn't quite match....

What was the state of your .../pkgsrc/devel/ncurses directory in at the
time you encountered this error?  Did you have an existing work*
directory?  Was it from an already out-dated version of the ncurses
package?

I've proposed the following patch to .../pkgsrc/mk/bsd.pkg.mk, which
doesn't completely avoid the problem I encountered, but it certainly
helps a lot (and I've been using it since proposing it).  You might try
it and see if it makes any difference (unless your system has mutated
too much since to reproduce the problem).

(line numbers are approximate)

***************
*** 2117,2130 ****
  	if [ X"$$found" != X"" ]; then					\
  		${ECHO_MSG} "===>  ${PKGNAME} depends on installed package: $$package - `${ECHO} $$found | ${SED} -e 's|${PKG_DBDIR}/||g' | tr '\012' '\040'` found"; \
  	else								\
! 		${ECHO_MSG} "===>  ${PKGNAME} depends on package: $$package"; \
! 		target=${DEPENDS_TARGET};				\
! 		${ECHO_MSG} "===>  Verifying $$target for $$dir"; 	\
! 		if [ ! -d $$dir ]; then					\
! 			${ECHO_MSG} ">> No directory for $$dir.  Skipping.."; \
  		else							\
! 			(cd $$dir && ${MAKE} ${.MAKEFLAGS} $$target) &&	\
! 			${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"; \
  		fi;							\
  	fi
  .endfor
--- 2123,2143 ----
  	if [ X"$$found" != X"" ]; then					\
  		${ECHO_MSG} "===>  ${PKGNAME} depends on installed package: $$package - `${ECHO} $$found | ${SED} -e 's|${PKG_DBDIR}/||g' | tr '\012' '\040'` found"; \
  	else								\
! 		oldpackage="`${ECHO} \"$$package\" | ${SED} -e 's:-[^-]*$$::'`"; \
! 		found="`${PKG_INFO} -e \"$$oldpackage\" || ${TRUE}`";	\
! 		if [ ${DEPENDS_TARGET} = "install" -a X"$$found" != X"" ]; then				\
! 			${ECHO_MSG} "===>  dependent package version did not match: $$package - `${ECHO} $$found | ${SED} -e 's|${PKG_DBDIR}/||g' | tr '\012' '\040'` found"; \
! 			${FALSE};						\
  		else							\
! 			${ECHO_MSG} "===>  ${PKGNAME} depends on package: $$package"; \
! 			target=${DEPENDS_TARGET};			\
! 			${ECHO_MSG} "===>  Verifying $$target for $$dir"; 	\
! 			if [ ! -d $$dir ]; then				\
! 				${ECHO_MSG} ">> No directory for $$dir.  Skipping.."; \
! 			else						\
! 				(cd $$dir && ${MAKE} ${.MAKEFLAGS} $$target) &&	\
! 				${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"; \
! 			fi;							\
  		fi;							\
  	fi
  .endfor



-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>