Subject: Re: [boost] [bjam] copy a file
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-01-23 14:26:02
On 01/23/2012 10:26 AM, lcaminiti wrote:
> Hello all,
> I'd have a Jamfile that has a "doc" rule to build documentation `bjam doc`.
> I'd like to program another rule "config_doc" inside the Jamfile that does
> the following:
> bjam config_doc:
> 1) Copy the file /etc/config.txt to ./
> 2) Copy the file ./src/config.txt to /etc/
> 3) Run the doc rule
> 4) Copy the file ./config.txt into /etc/
> Where ./ is the current directory from where I'm running bjam. Ideally, I'd
> like 4) to be executed even if 3) fails.
> Is there a way to do this?
If there's any way to avoid this, you should.
a) This can't safely run in parallel with
other uses of the same rule or anything else
that uses /etc/config.txt
b) You can't guarantee that /etc/config.txt
is restored properly if the process is interrupted.
If you really, /really/ need to do this,
you should probably use a single action
that does all of this.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk