[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: run-parts concurrently?

(I apologize for the fact that this won't thread properly.  For now
I am confined to webmail.)

Will Lowe <harpo () thebackrow ! net> wrote:
> So it's quite possible that by running things in parallel
> you'll screw up an inter-script dependancy chain.

You are right.  You can't drop the concurrent run-parts substitute in
place of run-parts and expect everything to work.

The run-parts substitute I have just written deals with this problem
by allowing dependencies to be declared either in the scripts
themselves or in a dependency file.  E.g., suppose you have scripts
foo, bar and baz.  The baz script must run after bar but both bar and
baz can run concurrently with foo.  In place of run-parts one runs 
the run-parts substitute and one adds the following to the .dep file
in the scripts directory:

   baz : bar

Alternatively one can add the following line to the top of baz:

   once bar

The latter has the advantage that it returns the exit status of bar.
Glob patterns and ranges are allowed in these declarations.
If anyone is interested in playing with this, drop me a line.


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 

Reply to: