Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a86f9b80
Commit
a86f9b80
authored
Sep 20, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain 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.
parent
32f212cb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
35 deletions
+7
-35
NEWS
NEWS
+1
-0
mpd.1
doc/mpd.1
+0
-6
mpdconf.example
doc/mpdconf.example
+1
-2
cmdline.c
src/cmdline.c
+1
-14
cmdline.h
src/cmdline.h
+0
-1
main.c
src/main.c
+4
-12
No files found.
NEWS
View file @
a86f9b80
...
@@ -33,6 +33,7 @@ ver 0.16 (20??/??/??)
...
@@ -33,6 +33,7 @@ ver 0.16 (20??/??/??)
* removed the deprecated "error_file" option
* removed the deprecated "error_file" option
* save state when stopped
* save state when stopped
* renamed option "--stdout" to "--stderr"
* renamed option "--stdout" to "--stderr"
* removed options --create-db and --no-create-db
* obey $(sysconfdir) for default mpd.conf location
* obey $(sysconfdir) for default mpd.conf location
...
...
doc/mpd.1
View file @
a86f9b80
...
@@ -25,12 +25,6 @@ Output a brief help message.
...
@@ -25,12 +25,6 @@ Output a brief help message.
Kill the currently running mpd session. The pid_file parameter must be
Kill the currently running mpd session. The pid_file parameter must be
specified in the config file for this to work.
specified in the config file for this to work.
.TP
.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
.BI --no-daemon
Don't detach from console.
Don't detach from console.
.TP
.TP
...
...
doc/mpdconf.example
View file @
a86f9b80
...
@@ -353,8 +353,7 @@ input {
...
@@ -353,8 +353,7 @@ input {
# Character Encoding ##########################################################
# Character Encoding ##########################################################
#
#
# If file or directory names do not display correctly for your locale then you
# 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
# may need to modify this setting.
# --create-db must be run to change the database.
#
#
#filesystem_charset "UTF-8"
#filesystem_charset "UTF-8"
#
#
...
...
src/cmdline.c
View file @
a86f9b80
...
@@ -82,17 +82,13 @@ void parse_cmdline(int argc, char **argv, struct options *options)
...
@@ -82,17 +82,13 @@ void parse_cmdline(int argc, char **argv, struct options *options)
GOptionContext
*
context
;
GOptionContext
*
context
;
bool
ret
;
bool
ret
;
static
gboolean
option_version
,
static
gboolean
option_version
,
option_
create_db
,
option_no_create_db
,
option_
no_daemon
,
option_no_daemon
,
option_no_config
;
option_no_config
;
const
GOptionEntry
entries
[]
=
{
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"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
kill
,
"kill the currently running mpd session"
,
NULL
},
"kill the currently running mpd session"
,
NULL
},
{
"no-config"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
option_no_config
,
{
"no-config"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
option_no_config
,
"don't read from config"
,
NULL
},
"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
,
{
"no-daemon"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
option_no_daemon
,
"don't detach from console"
,
NULL
},
"don't detach from console"
,
NULL
},
{
"stdout"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
log_stderr
,
{
"stdout"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
log_stderr
,
...
@@ -110,7 +106,6 @@ void parse_cmdline(int argc, char **argv, struct options *options)
...
@@ -110,7 +106,6 @@ void parse_cmdline(int argc, char **argv, struct options *options)
options
->
daemon
=
true
;
options
->
daemon
=
true
;
options
->
log_stderr
=
false
;
options
->
log_stderr
=
false
;
options
->
verbose
=
false
;
options
->
verbose
=
false
;
options
->
create_db
=
0
;
context
=
g_option_context_new
(
"[path/to/mpd.conf]"
);
context
=
g_option_context_new
(
"[path/to/mpd.conf]"
);
g_option_context_add_main_entries
(
context
,
entries
,
NULL
);
g_option_context_add_main_entries
(
context
,
entries
,
NULL
);
...
@@ -134,14 +129,6 @@ void parse_cmdline(int argc, char **argv, struct options *options)
...
@@ -134,14 +129,6 @@ void parse_cmdline(int argc, char **argv, struct options *options)
parser can use it already */
parser can use it already */
log_early_init
(
options
->
verbose
);
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
;
options
->
daemon
=
!
option_no_daemon
;
if
(
option_no_config
)
{
if
(
option_no_config
)
{
...
...
src/cmdline.h
View file @
a86f9b80
...
@@ -27,7 +27,6 @@ struct options {
...
@@ -27,7 +27,6 @@ struct options {
gboolean
daemon
;
gboolean
daemon
;
gboolean
log_stderr
;
gboolean
log_stderr
;
gboolean
verbose
;
gboolean
verbose
;
int
create_db
;
};
};
void
parse_cmdline
(
int
argc
,
char
**
argv
,
struct
options
*
options
);
void
parse_cmdline
(
int
argc
,
char
**
argv
,
struct
options
*
options
);
...
...
src/main.c
View file @
a86f9b80
...
@@ -123,7 +123,7 @@ glue_mapper_init(void)
...
@@ -123,7 +123,7 @@ glue_mapper_init(void)
* process has been daemonized.
* process has been daemonized.
*/
*/
static
bool
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
);
const
char
*
path
=
config_get_path
(
CONF_DB_FILE
);
bool
ret
;
bool
ret
;
...
@@ -142,19 +142,11 @@ glue_db_init_and_load(const struct options *options)
...
@@ -142,19 +142,11 @@ glue_db_init_and_load(const struct options *options)
db_init
(
path
);
db_init
(
path
);
if
(
options
->
create_db
>
0
)
/* don't attempt to load the old database */
return
false
;
ret
=
db_load
(
&
error
);
ret
=
db_load
(
&
error
);
if
(
!
ret
)
{
if
(
!
ret
)
{
g_warning
(
"Failed to load database: %s"
,
error
->
message
);
g_warning
(
"Failed to load database: %s"
,
error
->
message
);
g_error_free
(
error
);
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
())
if
(
!
db_check
())
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -331,7 +323,7 @@ int main(int argc, char *argv[])
...
@@ -331,7 +323,7 @@ int main(int argc, char *argv[])
decoder_plugin_init_all
();
decoder_plugin_init_all
();
update_global_init
();
update_global_init
();
create_db
=
!
glue_db_init_and_load
(
&
options
);
create_db
=
!
glue_db_init_and_load
();
glue_sticker_init
();
glue_sticker_init
();
...
@@ -356,8 +348,8 @@ int main(int argc, char *argv[])
...
@@ -356,8 +348,8 @@ int main(int argc, char *argv[])
player_create
();
player_create
();
if
(
create_db
)
{
if
(
create_db
)
{
/* the database failed to load
, or MPD was started
/* the database failed to load
: recreate the
with --create-db: recreate a new
database */
database */
unsigned
job
=
directory_update_init
(
NULL
);
unsigned
job
=
directory_update_init
(
NULL
);
if
(
job
==
0
)
if
(
job
==
0
)
g_error
(
"directory update failed"
);
g_error
(
"directory update failed"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment