Ticket #5975: mythtv-5975_and_6013-combined.patch

File mythtv-5975_and_6013-combined.patch, 2.2 KB (added by sphery <mtdean@…>, 15 years ago)

Combined version of #5975 and #6013 patches (to work around patch collisions). Can be used instead if both are applied/committed together.

  • programs/scripts/database/mythconverg_restore.pl

    old new  
    1313
    1414# Script info
    1515    $NAME           = 'MythTV Database Restore Script';
    16     $VERSION        = '1.0.3';
     16    $VERSION        = '1.0.4';
    1717
    1818# Some variables we'll use here
    1919    our ($username, $homedir, $mythconfdir, $database_information_file);
     
    769769                }
    770770            }
    771771            my @files = <$backup_conf{'directory'}/$backup_conf{'filename'}*>;
     772            @files = grep(!/.*mythconverg_(backup|restore).pl$/, @files);
    772773            my $num_files = @files;
    773774            if ($num_files < 1)
    774775            {
     
    919920        my $exit = $? >> 8;
    920921        verbose($verbose_level_debug,
    921922                "\n$mysql_client exited with status:  $exit");
    922         verbose($verbose_level_error,
    923                 "$mysql_client output:", $result) if ($exit);
    924         die("\nUnable to create initial database, stopped");
     923        if ($exit)
     924        {
     925            verbose($verbose_level_error,
     926                    "$mysql_client output:", $result);
     927            die("\nUnable to create initial database, stopped");
     928        }
    925929        return $exit;
    926930    }
    927931
     
    14331433            }
    14341434            if (!defined($restore_xmltvids))
    14351435            {
    1436                 $filter = '^INSERT INTO \`(' .
    1437                           join('|', @partial_restore_tables) . ')\` ';
     1436                $filter = '^INSERT INTO \`?(' .
     1437                          join('|', @partial_restore_tables) . ')\`? ';
     1438                # If doing a whitelist restore, ensure we keep the character
     1439                # set info to prevent data corruption
     1440                if (!defined($with_plugin_data))
     1441                {
     1442                    $filter = '(40101 SET NAMES |'.$filter.')';
     1443                }
    14381444                verbose($verbose_level_debug,
    14391445                        "\nRestoring partial backup with filter:", $filter);
    14401446            }