
Steven Watanabe-4 wrote
AMDG
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.
This is for one of my own projects (not Boost) for which I don't have to worry about parallel access to the file. However, I do want to "catch" errors and restore the file if I can't build the docs. If I can't use bjam, I might create a script to do that... Thanks. --Lorenzo -- View this message in context: http://boost.2283326.n4.nabble.com/boost-bjam-copy-a-file-tp4321537p4321974.... Sent from the Boost - Dev mailing list archive at Nabble.com.