Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Dec 1995 13:17:40 -0800
From:      "Jordan K. Hubbard" <jkh@time.cdrom.com>
To:        ports@freebsd.org
Subject:   Proposed change to bsd.port.mk
Message-ID:  <13988.818198260@time.cdrom.com>

next in thread | raw e-mail | index | archive | help
I was just thinking today that it might be nice to be able to write
your own scripts for traversing the ports tree, so I came up with this:

*** /usr/src/share/mk/bsd.port.mk	Fri Oct  6 00:20:35 1995
--- /usr/share/mk/bsd.port.mk	Tue Dec  5 02:24:42 1995
***************
*** 402,409 ****
--- 402,422 ----
  	@${DO_NADA}
  .endif
  
+ .if defined(ALL_HOOK)
+ all_hook:
+ 	@/usr/bin/env CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
+ 	  DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
+ 	  WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
+ 	  FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
+ 	  DEPENDS="${DEPENDS}" BUILD_DEPENDS="${BUILD_DEPENDS}" \
+ 	  RUN_DEPENDS="${RUN_DEPENDS}" X11BASE=${X11BASE} \
+ 	${ALL_HOOK}
+ 
+ all: all_hook
+ .else
  .if !target(all)
  all: build
+ .endif
  .endif
  
  .if !defined(IS_DEPENDED_TARGET)

Allowing you to do something like this:

% cd /usr/ports
% make ALL_HOOK='echo ${DISTNAME}: `cat ${PKGDIR}/COMMENT`' ECHO_MSG='echo >/dev/null'

To produce output like this:

arc521e.pl8: arc - create & extract files from DOS .ARC files
sharutils-4.1.4: Allow packing and unpacking of shell archives, v4.1.4
ha0999: ha - the HA archiver using the HSC compression method, version 0.999beta
lha101u: LHA - version 101u. Compress/uncompress files using LZW compression (.lzh files)
unarj: unarj version 2.41 - allows files to be extracted from ARJ archives.
...

What do folks think?

					Jordan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13988.818198260>