summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Tomlins <alex@tomlins.org.uk>2011-01-14 19:45:11 (GMT)
committer Michael T. Dean <mdean@mythtv.org>2011-01-14 19:50:32 (GMT)
commit46a0ddaccaef31d24cc479932e378e67ffe2bcd2 (patch)
tree1272f42455906f760a222162d421bb6da7c52eca
parent2394a9d70fe03371c124f7427a6791f2556b5748 (diff)
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 c086645cee9830a7865be85f13ce98323fd50c36)
-rwxr-xr-xmythtv/programs/scripts/database/mythconverg_restore.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/mythtv/programs/scripts/database/mythconverg_restore.pl b/mythtv/programs/scripts/database/mythconverg_restore.pl
index 6e93d24..41151ad 100755
--- a/mythtv/programs/scripts/database/mythconverg_restore.pl
+++ b/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 @@ EOF
$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))
{