aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-09-20 23:31:35 +0200
committerMax Kellermann <max@duempel.org>2009-09-20 23:31:35 +0200
commita86f9b80357e30823ce9d3d486adcf4cd4e781dc (patch)
tree6bbe109a30b5ad7483514df2a477c79991e30c3a
parent32f212cb860d5cd91e952e4802c151101cc9c8c0 (diff)
cmdline: removed options --create-db and --no-create-db
Both options are deprecated, and should not be used anymore. Many users get confused by their presence.
-rw-r--r--NEWS1
-rw-r--r--doc/mpd.16
-rw-r--r--doc/mpdconf.example3
-rw-r--r--src/cmdline.c15
-rw-r--r--src/cmdline.h1
-rw-r--r--src/main.c16
6 files changed, 7 insertions, 35 deletions
diff --git a/NEWS b/NEWS
index eb1e13ec..ed0137bb 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,7 @@ ver 0.16 (20??/??/??)
* removed the deprecated "error_file" option
* save state when stopped
* renamed option "--stdout" to "--stderr"
+* removed options --create-db and --no-create-db
* obey $(sysconfdir) for default mpd.conf location
diff --git a/doc/mpd.1 b/doc/mpd.1
index 22c0e751..b7084367 100644
--- a/doc/mpd.1
+++ b/doc/mpd.1
@@ -25,12 +25,6 @@ Output a brief help message.
Kill the currently running mpd session. The pid_file parameter must be
specified in the config file for this to work.
.TP
-.BI --create-db
-Force (re)creation of database.
-.TP
-.BI --no-create-db
-Do not create database, even if it doesn't exist.
-.TP
.BI --no-daemon
Don't detach from console.
.TP
diff --git a/doc/mpdconf.example b/doc/mpdconf.example
index 2d273286..e4a2e2a8 100644
--- a/doc/mpdconf.example
+++ b/doc/mpdconf.example
@@ -353,8 +353,7 @@ input {
# Character Encoding ##########################################################
#
# If file or directory names do not display correctly for your locale then you
-# may need to modify this setting. After modification of this setting mpd
-# --create-db must be run to change the database.
+# may need to modify this setting.
#
#filesystem_charset "UTF-8"
#
diff --git a/src/cmdline.c b/src/cmdline.c
index 606f2667..d0e8e75d 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -82,17 +82,13 @@ void parse_cmdline(int argc, char **argv, struct options *options)
GOptionContext *context;
bool ret;
static gboolean option_version,
- option_create_db, option_no_create_db, option_no_daemon,
+ option_no_daemon,
option_no_config;
const GOptionEntry entries[] = {
- { "create-db", 0, 0, G_OPTION_ARG_NONE, &option_create_db,
- "force (re)creation of database", NULL },
{ "kill", 0, 0, G_OPTION_ARG_NONE, &options->kill,
"kill the currently running mpd session", NULL },
{ "no-config", 0, 0, G_OPTION_ARG_NONE, &option_no_config,
"don't read from config", NULL },
- { "no-create-db", 0, 0, G_OPTION_ARG_NONE, &option_no_create_db,
- "don't create database, even if it doesn't exist", NULL },
{ "no-daemon", 0, 0, G_OPTION_ARG_NONE, &option_no_daemon,
"don't detach from console", NULL },
{ "stdout", 0, 0, G_OPTION_ARG_NONE, &options->log_stderr,
@@ -110,7 +106,6 @@ void parse_cmdline(int argc, char **argv, struct options *options)
options->daemon = true;
options->log_stderr = false;
options->verbose = false;
- options->create_db = 0;
context = g_option_context_new("[path/to/mpd.conf]");
g_option_context_add_main_entries(context, entries, NULL);
@@ -134,14 +129,6 @@ void parse_cmdline(int argc, char **argv, struct options *options)
parser can use it already */
log_early_init(options->verbose);
- if (option_create_db && option_no_create_db)
- g_error("Cannot use both --create-db and --no-create-db\n");
-
- if (option_no_create_db)
- options->create_db = -1;
- else if (option_create_db)
- options->create_db = 1;
-
options->daemon = !option_no_daemon;
if (option_no_config) {
diff --git a/src/cmdline.h b/src/cmdline.h
index 05bf7379..eb626dbc 100644
--- a/src/cmdline.h
+++ b/src/cmdline.h
@@ -27,7 +27,6 @@ struct options {
gboolean daemon;
gboolean log_stderr;
gboolean verbose;
- int create_db;
};
void parse_cmdline(int argc, char **argv, struct options *options);
diff --git a/src/main.c b/src/main.c
index f7b3d297..a0385733 100644
--- a/src/main.c
+++ b/src/main.c
@@ -123,7 +123,7 @@ glue_mapper_init(void)
* process has been daemonized.
*/
static bool
-glue_db_init_and_load(const struct options *options)
+glue_db_init_and_load(void)
{
const char *path = config_get_path(CONF_DB_FILE);
bool ret;
@@ -142,19 +142,11 @@ glue_db_init_and_load(const struct options *options)
db_init(path);
- if (options->create_db > 0)
- /* don't attempt to load the old database */
- return false;
-
ret = db_load(&error);
if (!ret) {
g_warning("Failed to load database: %s", error->message);
g_error_free(error);
- if (options->create_db < 0)
- g_error("can't open db file and using "
- "\"--no-create-db\" command line option");
-
if (!db_check())
exit(EXIT_FAILURE);
@@ -331,7 +323,7 @@ int main(int argc, char *argv[])
decoder_plugin_init_all();
update_global_init();
- create_db = !glue_db_init_and_load(&options);
+ create_db = !glue_db_init_and_load();
glue_sticker_init();
@@ -356,8 +348,8 @@ int main(int argc, char *argv[])
player_create();
if (create_db) {
- /* the database failed to load, or MPD was started
- with --create-db: recreate a new database */
+ /* the database failed to load: recreate the
+ database */
unsigned job = directory_update_init(NULL);
if (job == 0)
g_error("directory update failed");