Re: Handling merge conflicts a bit more gracefully..
Linus Torvalds <torvalds@osdl.org> wrote:
Show 10 quoted lines
>
>> # Modified in both, but differently.
>> + merge -p "$src1" "$orig" "$src2" > "$4"
>>
>> Again, make sure "$4" is not a directory before redirecting into
>> it from merge, so that you can tell merge failures from it?
>
> Hmm.. What's the cleanest way to check for redirection errors, but still
> be able to distinguish those cleanly from "merge" itself returning an
> error?
I don't know whether this is the cleanest, but this is one way:
redir=failed
{
redir=ok
merge -p "$src1" "$orig" "$src2"
} > "$4" || err=$?if [ $redir = failed ]; then
...
fi
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt