From 9e329c0a275cc0a0ce02d86593c2ee558d846239 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Wed, 16 Jan 2013 06:24:05 -0500 Subject: [PATCH] Renamed option updatedb.sh --label to --package --- installer/rcube_install.php | 2 +- bin/update.sh | 2 +- bin/updatedb.sh | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/update.sh b/bin/update.sh index e1beef0..536bad9 100755 --- a/bin/update.sh +++ b/bin/update.sh @@ -144,7 +144,7 @@ // check database schema if ($RCI->config['db_dsnw']) { echo "Executing database schema update.\n"; - system(INSTALL_PATH . "bin/updatedb.sh --label=roundcube --version=" . $ops['version'] + system(INSTALL_PATH . "bin/updatedb.sh --package=roundcube --version=" . $ops['version'] . " --dir=" . INSTALL_PATH . DIRECTORY_SEPARATOR . "SQL", $res); $success = !$res; diff --git a/bin/updatedb.sh b/bin/updatedb.sh index 9f2aef1..017c149 100755 --- a/bin/updatedb.sh +++ b/bin/updatedb.sh @@ -27,15 +27,15 @@ $opts = rcube_utils::get_opt(array( 'v' => 'version', 'd' => 'dir', - 'l' => 'label', + 'p' => 'package', )); if (empty($opts['dir'])) { echo "ERROR: Database schema directory not specified (--dir).\n"; exit(1); } -if (empty($opts['label'])) { - echo "ERROR: Database schema label not specified (--label).\n"; +if (empty($opts['package'])) { + echo "ERROR: Database schema package name not specified (--package).\n"; exit(1); } @@ -60,7 +60,7 @@ $DB->query("SELECT " . $DB->quote_identifier('value') ." FROM " . $DB->quote_identifier('system') ." WHERE " . $DB->quote_identifier('name') ." = ?", - $opts['label'] . '-version'); + $opts['package'] . '-version'); $row = $DB->fetch_array(); $version = $row[0]; @@ -126,7 +126,7 @@ foreach ($result as $v) { echo "Updating database schema ($v)... "; - $error = update_db_schema($opts['label'], $v, $dir . DIRECTORY_SEPARATOR . "$v.sql"); + $error = update_db_schema($opts['package'], $v, $dir . DIRECTORY_SEPARATOR . "$v.sql"); if ($error) { echo "\nError in DDL upgrade $v: $error\n"; @@ -137,7 +137,7 @@ exit(0); -function update_db_schema($label, $version, $file) +function update_db_schema($package, $version, $file) { global $DB; @@ -167,13 +167,13 @@ $DB->query("UPDATE " . $DB->quote_identifier('system') ." SET " . $DB->quote_identifier('value') . " = ?" ." WHERE " . $DB->quote_identifier('name') . " = ?", - $version, $label . '-version'); + $version, $package . '-version'); if (!$DB->is_error() && !$DB->affected_rows()) { $DB->query("INSERT INTO " . $DB->quote_identifier('system') ." (" . $DB->quote_identifier('name') . ", " . $DB->quote_identifier('value') . ")" ." VALUES (?, ?)", - $label . '-version', $version); + $package . '-version', $version); } return $DB->is_error(); diff --git a/installer/rcube_install.php b/installer/rcube_install.php index bbb225b..a800dfd 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -633,7 +633,7 @@ */ function update_db($version) { - system(INSTALL_PATH . "bin/updatedb.sh --label=roundcube --version=" . $version + system(INSTALL_PATH . "bin/updatedb.sh --package=roundcube --version=" . $version . " --dir=" . INSTALL_PATH . "SQL", $result); return !$result; -- Gitblit v1.9.1