1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

Merge pull request #8530 from poettering/include-is-obsolete

actively say that .include is obsolete
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-23 15:13:02 +01:00 committed by GitHub
commit fbbffb8c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,7 +180,7 @@ static int parse_line(
char *l,
void *userdata) {
char *e;
char *e, *include;
assert(filename);
assert(line > 0);
@ -194,7 +194,8 @@ static int parse_line(
if (strchr(COMMENTS "\n", *l))
return 0;
if (startswith(l, ".include ")) {
include = first_word(l, ".include");
if (include) {
_cleanup_free_ char *fn = NULL;
/* .includes are a bad idea, we only support them here
@ -211,7 +212,11 @@ static int parse_line(
return 0;
}
fn = file_in_same_dir(filename, strstrip(l+9));
log_syntax(unit, LOG_WARNING, filename, line, 0,
".include directives are deprecated, and support for them will be removed in a future version of systemd. "
"Please use drop-in files instead.");
fn = file_in_same_dir(filename, strstrip(include));
if (!fn)
return -ENOMEM;