[resending to the bigger audience for comments] I should also mention that FORCE_UPDATE=Hard
Hi, When FETCH_PACKAGES=Yes pkg_add will cache packages in the ${_CACHE_REPO} directory. This task is done below ${ECHO_MSG} -n "===> Looking for ${_PKGFILE${_S}} in \$$PKG_PATH - " line in bsd.port.mk. It may happend that the package in the $PKG_PATH is available but not installable on the current system (for example, base system library had major bump). When that is the case and this package is checked directly by pkg_add everything is fine, as port system will fall back and build the package ignoring what is in the cache. When the package was cached in previous pkg_add execution as a dependency - build will fail. Attached diff removes such broken cached packages, so packaging will not be skiped. I will give you practical example, seen on my system after recent openssl update in the base. I'm building astro/py-metar which depends on lang/python/2.5. Python 2.5.4 in the PKG_PATH is linked with ssl.12 which will fail to install on the lates OpenBSD snapshot (ssl.14). With FETCH_PACKAGES=Yes pkg_add in bsd.port.mk will fail and that will force rebuild of the py-metar, but in this execution python-2.5.4 with old ssl.12 was cached in the ${_CACHE_REPO}. Then going thru dependencies python will be rebuild again, but the package from the cache will be hard linked to the all/ directory and that will break the build even when python went to the fake stage. Please review my patch. I would like to get that commited. Thanks. -- best regards q#
Index: bsd.port.mk =================================================================== RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v retrieving revision 1.959 diff -u -r1.959 bsd.port.mk --- bsd.port.mk 5 Jan 2009 12:43:49 -0000 1.959 +++ bsd.port.mk 11 Jan 2009 00:38:39 -0000 @@ -1433,6 +1433,10 @@ @mkdir -p $...@d} . if ${FETCH_PACKAGES:L} == "yes" && !defined(_TRIED_FETCHING_${_PACKAGE_COOKIE${_S}}) @f=${_CACHE_REPO}/${_PKGFILE${_S}}; \ + if [ -f $$f ]; then \ + ${SETENV} PKG_TMPDIR=${PKG_TMPDIR} pkg_add -n -q ${_PKG_ADD_FORCE} $$f >/dev/null 2>&1 || \ + rm -f $$f; \ + fi; \ cd ${.CURDIR} && ${MAKE} $$f && \ { ln $$f $@ 2>/dev/null || cp -p $$f $@ ; } || \ cd ${.CURDIR} && ${MAKE} _TRIED_FETCHING_${_PACKAGE_COOKIE${_S}}=Yes _internal-package-only