Subject: Re: Another pkgsrc updating question (sorry!)
To: Chavdar Ivanov <ci4ic4@gmail.com>
From: Alistair Crooks <agc@pkgsrc.org>
List: netbsd-users
Date: 06/06/2005 10:34:28
--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Jun 03, 2005 at 03:56:57PM +0100, Chavdar Ivanov wrote:
> What I do is totally unsupported and not recommended. However, it gets
> the job done as fast as possible. The fact is, it rarely breaks
> things, although one has to exercise one's good judgement.
> 
> In the case of Gnome 2.10 update, I would cd to the same place and
> just run 'make'. It will do the nessary constituent packages with
> 'make install', some - or most - of which will fail because of older
> version installed. I will then cd to the directory of the failed
> package and run 'make replace'. In case of shared libraries present
> (obviously very often) I might have to manually create soft links for
> the older replaced libraries - there is rarely such a drastic shared
> library change as to render the packages, dependent on that particular
> shared library, from running; anyway, if this happens, 'make replace'
> had created the 'pkg_tarup' of the old package in the work directory,
> so I will still have the opportunity to revert to it and then decide
> what to do.

I've been using the attached patch for a while, and it misses out the
(cd ../../*/borked-pkg && make replace) dance. It does the same job,
just does it for you...

Regards,
Alistair

--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=jfdi

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1682
diff -u -r1.1682 bsd.pkg.mk
--- bsd.pkg.mk	1 Jun 2005 03:04:16 -0000	1.1682
+++ bsd.pkg.mk	6 Jun 2005 09:32:19 -0000
@@ -2730,6 +2730,18 @@
 undo-replace: real-undo-replace
 .endif
 
+.PHONY: doit
+.if !target(doit)
+doit jfdi:
+	${_PKG_SILENT}${_PKG_DEBUG}					\
+	found="`${PKG_BEST_EXISTS} \"${PKGWILDCARD}\" || ${TRUE}`";	\
+	case "$$found" in						\
+	"")	tgt="${INSTALL_TARGET}";;				\
+	*)	tgt="${_PKGSRC_BUILD_TARGETS} real-replace";;		\
+	esac;								\
+	cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} DEPENDS_TARGET=jfdi $$tgt
+.endif
+
 ${EXTRACT_COOKIE}:
 .if ${INTERACTIVE_STAGE:Mextract} == "extract" && defined(BATCH)
 	@${ECHO} "*** The extract stage of this package requires user interaction"

--bg08WKrSYDhXBjb5--