Skip to content
Browse files

Fix restore script host name change with generic names.

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...
1 parent 2394a9d commit 46a0ddaccaef31d24cc479932e378e67ffe2bcd2 @alext alext committed with sphery Jan 14, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 mythtv/programs/scripts/database/mythconverg_restore.pl
View
8 mythtv/programs/scripts/database/mythconverg_restore.pl
@@ -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);
@@ -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))
{

0 comments on commit 46a0dda

Please sign in to comment.
Something went wrong with that request. Please try again.