Skip to content

Commit

Permalink
Fix restore script host name change with generic names.
Browse files Browse the repository at this point in the history
Fix the restore script's --change_hostname functionality to work
properly even with generic host names, like "myth" or "a".

Thanks to Alex Tomlins for the patch.  Refs #9482.
(cherry picked from commit c086645)
  • Loading branch information
alext authored and sphery committed Jan 14, 2011
1 parent 2394a9d commit 46a0dda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mythtv/programs/scripts/database/mythconverg_restore.pl
Expand Up @@ -13,7 +13,7 @@

# Script info
$NAME = 'MythTV Database Restore Script';
$VERSION = '1.0.16';
$VERSION = '1.0.17';

# Some variables we'll use here
our ($username, $homedir, $mythconfdir, $database_information_file);
Expand Down Expand Up @@ -1435,9 +1435,9 @@
$query = "UPDATE $table_name SET value = REPLACE(value, ?, ?)".
" WHERE value LIKE ?";
$sth_update = $dbh->prepare($query);
$sth_update->bind_param(1, $old_hostname);
$sth_update->bind_param(2, $new_hostname);
$sth_update->bind_param(3, '%'.$old_hostname.'%');
$sth_update->bind_param(1, 'SGweightPerDir:'.$old_hostname.':');
$sth_update->bind_param(2, 'SGweightPerDir:'.$new_hostname.':');
$sth_update->bind_param(3, 'SGweightPerDir:'.$old_hostname.':%');
$result = $sth_update->execute;
if (!defined($result))
{
Expand Down

0 comments on commit 46a0dda

Please sign in to comment.