Boost logo

Boost-Build :

From: Mark Sheppard (msheppard_at_[hidden])
Date: 2003-11-07 08:31:36


Attached is a patch to cause Jam to expand the argument to each "case"
statement. This slight syntax alteration allows you to cache a directory
listing to speed up the case where you're doing multiple consecutive GLOBs
in the same directory, for example:

rule DeleteFiles ( dir : globs + : excludes * )
{
local deletions ;
if $(CACHED_DIR_NAME) != $(dir) {
CACHED_DIR_LIST = [ GLOB $(dir) : * ] ;
CACHED_DIR_NAME = $(dir) ;
}
for local file in $(CACHED_DIR_LIST)
{
switch $(file)
{
case $(dir)/$(globs) :
if ! $(file) in $(excludes) {
Debug "Will delete $(file:D=)" ;
Del $(file) ;
deletions += $(file) ;
}
}
}
return $(deletions) ;
}

Hope someone finds it useful,
Mark.

 ------_=_NextPart_000_01C3A533.776579C0 Content-Type: application/octet-stream;
name="05-expand-case.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="05-expand-case.patch"

[Attachment content not displayed.] ------_=_NextPart_000_01C3A533.776579C0--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk