[Bucardo-general] Patch, Added $self to input for custom code

Ben Allen bsa at lanl.gov
Tue Mar 24 04:31:13 UTC 2009


Lev,

I'm working on the current development version pulled from Bucardo's  
Git repository. I have no idea if 3.0.9 has the same code or not as  
3.0.9 is pretty well aged. Its around line 3960 in Bucardo.pm if that  
helps.

Normally if I submit a patch you can apply it by copying it into the  
base of the extracted source for Bucardo and run:

patch < named_of_file.patch

However, to be honest unless you just want to test the patch out, I'd  
say wait for Greg to add my patches back to the source base. As likely  
he's going to know a better way to do what I patched (as in this  
case), or know other places where changes are needed based on the bug  
I've found.

Regards,

Ben


On Mar 23, 2009, at 10:20 AM, Lev Tannen wrote:

> Hello Ben,
>
> My name is Lev Tannen. I would like to apply your patch to my  
> version of Bucardo, which is 3.0.9 but cannot figure out how to do  
> this.
> My understanding is that I just need to add a line "bucself    =>  
> $self" to Bucardo.pm between lines
> sub start_kid {
>                         endsync    => '',
>                         rowinfo    => \%rowinfo,
>                         runagain   => 0, ## exception only
> and
>                 };
>                 if ($c->{getrows}) {
>                         $input->{rows} = $rows_for_custom_code;
>
> But my version of Bucardo does not contain such a pattern. Did I  
> missed something, or this patch is intended for an another version  
> of Bucardo?
>
> Thank you,
> Lev Tannen
>
> On Sat, Mar 21, 2009 at 7:55 PM, Ben Allen <bsa at lanl.gov> wrote:
> Attached is a patch that passes $self in the run_kid_custom_code  
> function of Bucardo.pm in the $input hashref. This allows  
> customcode, as used for custom exception and conflict handlers, etc  
> to now easily use the send_mail function of Bucardo.pm (among other  
> things, but this was what I needed it for).
>
> send_mail can now be used like such from inside customcode:
>
> send_mail($result->{bucself},{ body => "$result->{warning}\n\n 
> $dump", subject => "Bucardo Exception" });
>
> Regards,
>
> Ben
>
>
>
>
>
> _______________________________________________
> Bucardo-general mailing list
> Bucardo-general at bucardo.org
> https://mail.endcrypt.com/mailman/listinfo/bucardo-general
>
>

Ben Allen

System Administrator
Influenza Sequence Database
Los Alamos National Laboratory




More information about the Bucardo-general mailing list