Ticket #4811: MythTV.pm.2.diff

File MythTV.pm.2.diff, 2.5 KB (added by eharris@…, 16 years ago)

Unified diff for same patch except using current svn 0.21 tree as base

  • MythTV.pm

    old new  
    284284        elsif ($line =~ m#<DBPort>(\d*?)</DBPort>#) {
    285285            $mysql_conf{'db_port'}  = $1;
    286286        }
     287        elsif ($line =~ m#<MasterServerIP>(.*?)</MasterServerIP>#) {
     288            $mysql_conf{'master_host'}  = $1;
     289        }
     290        elsif ($line =~ m#<MasterServerPort>(\d*?)</MasterServerPort>#) {
     291            $mysql_conf{'master_port'}  = $1;
     292        }
    287293    # Hostname override.  Not sure if this is still valid or not
    288294        elsif ($line =~ m#<LocalHostName>(.*?)</LocalHostName>#) {
    289295            $mysql_conf{'hostname'} = $1;
     
    298304    sub new {
    299305        my $class = shift;
    300306        my $self  = {
    301                      'master_host' => undef,
    302                      'master_port' => undef,
    303307                     'dbh'         => undef,
    304308
    305309                     'channels'    => {},
     
    314318                     'db_pass'     => $mysql_conf{'db_pass'},
    315319                     'db_name'     => $mysql_conf{'db_name'},
    316320                     'hostname'    => $mysql_conf{'hostname'},
     321                     'master_host' => $mysql_conf{'master_host'},
     322                     'master_port' => $mysql_conf{'master_port'},
    317323                     'connect'     => 1,
    318324
    319325                    };
     
    328334            $self->{'db_pass'}  = $params->{'db_pass'}  if ($params->{'db_pass'});
    329335            $self->{'db_name'}  = $params->{'db_name'}  if ($params->{'db_name'});
    330336            $self->{'hostname'} = $params->{'hostname'} if ($params->{'hostname'});
     337            $self->{'master_host'} = $params->{'master_host'} if ($params->{'master_host'});
     338            $self->{'master_port'} = $params->{'master_port'} if ($params->{'master_port'});
    331339            if (defined $params->{'connect'}) {
    332340                $self->{'connect'} = $params->{'connect'};
    333341            }
     
    340348            or die "Cannot connect to database: $!\n\n";
    341349
    342350    # Load the master host and port
    343         $self->{'master_host'} = $self->backend_setting('MasterServerIP');
    344         $self->{'master_port'} = $self->backend_setting('MasterServerPort');
     351        if (!$self->{'master_host'}) {
     352            $self->{'master_host'} = $self->backend_setting('MasterServerIP');
     353        }
     354        if (!$self->{'master_port'}) {
     355            $self->{'master_port'} = $self->backend_setting('MasterServerPort');
     356        }
    345357
    346358        if (!$self->{'master_host'} || !$self->{'master_port'}) {
    347359            die "MasterServerIP or MasterServerPort not found!\n"