Subject: make show-needs-update
To: None <tech-pkg@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: tech-pkg
Date: 06/03/2003 01:06:08
someone asked, so i threw this together.

.if !target(show-needs-update)
show-needs-update:
.  if defined(DEPENDS)
	${_PKG_SILENT}${_PKG_DEBUG}					\
	for i in `${MAKE} show-all-depends-dirs`; do			\
		cd ${_PKGSRCDIR}/$$i;					\
		want=`make show-vars VARNAMES=PKGNAME`;			\
		have=`${PKG_INFO} -e "$${want%-*}" || true`;		\
		if [ -z "$$have" ]; then				\
			echo "$$i => (none) => needs install";		\
		elif [ "$$have" != "$$want" ]; then			\
			echo "$$i => $$have => needs update to $$want";	\
		fi;							\
	done
.  endif
.endif

which, as you might be able to see (or perhaps not), when invoked in a
given package's directory, will print the list of dependent packages
that require either updating or installing in order that everything by
up to date.

it's not exactly pretty, but i wanted to ask here if (a) anyone can
see ways to make it look prettier (particularly around the part where
it iterates over the output of another make invocation), or (b) if
anyone else likes this and thinks it ought to be added to bsd.pkg.mk
along with all the other informational meta-targets.

comments?  thoughts?

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."