Skip to content

Commit 98ab8cc

Browse files
committed
Fix the backup and restore scripts to be more forgiving of user typos in command-line argument punctuation, and fix some spacing in backup script output as long as the version number is changing.
git-svn-id: http://svn.mythtv.org/svn/trunk@26864 7dbf422c-18fa-0310-86e9-fd20926502f2 (cherry picked from commit 7f42884)
1 parent 2ae9670 commit 98ab8cc

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

mythtv/programs/scripts/database/mythconverg_backup.pl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Script info
1515
$NAME = 'MythTV Database Backup Script';
16-
$VERSION = '1.0.9';
16+
$VERSION = '1.0.10';
1717

1818
# Some variables we'll use here
1919
our ($username, $homedir, $mythconfdir, $database_information_file);
@@ -83,10 +83,11 @@
8383
'compress=s' => \$compress,
8484
'rotate=i' => \$rotate,
8585
'rotateglob|glob=s' => \$rotateglob,
86-
'backup_xmltvids|xmltvids' => \$backup_xmltvids,
86+
'backup_xmltvids|backup-xmltvids|'.
87+
'xmltvids' => \$backup_xmltvids,
8788
'usage|help|h+' => \$usage,
8889
'version' => \$show_version,
89-
'script_version|v' => \$show_version_script,
90+
'script_version|script-version|v' => \$show_version_script,
9091
'verbose|debug|d+' => \$debug
9192
);
9293

@@ -861,9 +862,9 @@
861862
verbose($verbose_level_error,
862863
'', 'ERROR: DBBackupDirectory is not a directory or is '.
863864
'not writable. Please specify',
864-
' a directory in your database information file'.
865+
' a directory in your database information file'.
865866
' using DBBackupDirectory.',
866-
' If not using a database information file,'.
867+
' If not using a database information file,'.
867868
' please specify the ',
868869
' --directory command-line option.');
869870
die("\nInvalid backup directory, stopped");
@@ -1048,7 +1049,7 @@
10481049
verbose($verbose_level_error,
10491050
'', 'ERROR: Unable to backup xmltvids without Perl'.
10501051
' database libraries.',
1051-
' Please ensure the Perl DBI and DBD::mysql'.
1052+
' Please ensure the Perl DBI and DBD::mysql'.
10521053
' modules are installed.');
10531054
die("\nPerl database libraries missing, stopped");
10541055
}

mythtv/programs/scripts/database/mythconverg_restore.pl

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Script info
1515
$NAME = 'MythTV Database Restore Script';
16-
$VERSION = '1.0.15';
16+
$VERSION = '1.0.16';
1717

1818
# Some variables we'll use here
1919
our ($username, $homedir, $mythconfdir, $database_information_file);
@@ -67,19 +67,24 @@
6767
'schemaver|DBSchemaVer=s' => \$db_schema_version,
6868
'directory|DBBackupDirectory=s' => \$backup_directory,
6969
'filename|DBBackupFilename=s' => \$backup_filename,
70-
'partial_restore|new_hardware' => \$partial_restore,
71-
'with_plugin_data|plugin_data' => \$with_plugin_data,
72-
'restore_xmltvids|xmltvids' => \$restore_xmltvids,
73-
'mysql_client|client=s' => \$mysql_client,
70+
'partial_restore|new_hardware|'.
71+
'partial-restore|new-hardware' => \$partial_restore,
72+
'with_plugin_data|plugin_data|'.
73+
'with-plugin-data|plugin-data' => \$with_plugin_data,
74+
'restore_xmltvids|'.
75+
'restore-xmltvids|xmltvids' => \$restore_xmltvids,
76+
'mysql_client|mysql-client|client=s' => \$mysql_client,
7477
'uncompress=s' => \$uncompress,
75-
'drop_database|drop_db' => \$drop_database,
76-
'create_database|create_db|mc_sql' => \$create_database,
77-
'change_hostname' => \$change_hostname,
78-
'new_hostname=s' => \$new_hostname,
79-
'old_hostname=s' => \$old_hostname,
78+
'drop_database|drop_db|'.
79+
'drop-database|drop-db' => \$drop_database,
80+
'create_database|create_db|mc_sql|'.
81+
'create-database|create-db|mc-sql' => \$create_database,
82+
'change_hostname|change-hostname' => \$change_hostname,
83+
'new_hostname|new-hostname=s' => \$new_hostname,
84+
'old_hostname|old-hostname=s' => \$old_hostname,
8085
'usage|help|h+' => \$usage,
8186
'version' => \$show_version,
82-
'script_version|v' => \$show_version_script,
87+
'script_version|script-version|v' => \$show_version_script,
8388
'verbose|debug|d+' => \$debug
8489
);
8590

0 commit comments

Comments
 (0)