Blob Blame History Raw
From a428a4c08f5f5e15e2cd57db0760c4746b223d59 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 21 May 2012 15:12:18 +0200
Subject: [PATCH] F16: silently ignore Documentation= fields

People want to use the same unit files in F16 as in F17.

Backporting the full support for Documentation= to F16 is too much work.
Just teach the fragment loader about the tag and ignore it.

(Documentation was added upstream in commit 49dbfa7b2b0bf3906704dac1eaeb4eba91056a19)
---
 src/load-fragment-gperf.gperf.m4 |    1 +
 src/load-fragment.c              |   14 ++++++++++++++
 src/load-fragment.h              |    1 +
 3 files changed, 16 insertions(+)

diff --git a/src/load-fragment-gperf.gperf.m4 b/src/load-fragment-gperf.gperf.m4
index 9f0b20d..426b3f4 100644
--- a/src/load-fragment-gperf.gperf.m4
+++ b/src/load-fragment-gperf.gperf.m4
@@ -90,6 +90,7 @@ $1.ControlGroupModify,           config_parse_bool,                  0,
 )m4_dnl
 Unit.Names,                      config_parse_unit_names,            0,                             0
 Unit.Description,                config_parse_unit_string_printf,    0,                             offsetof(Unit, description)
+Unit.Documentation,              config_parse_documentation,         0,                             0
 Unit.Requires,                   config_parse_unit_deps,             UNIT_REQUIRES,                 0
 Unit.RequiresOverridable,        config_parse_unit_deps,             UNIT_REQUIRES_OVERRIDABLE,     0
 Unit.Requisite,                  config_parse_unit_deps,             UNIT_REQUISITE,                0
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 818e766..a049a31 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -2032,6 +2032,20 @@ int config_parse_unit_blkio_bandwidth(const char *filename, unsigned line, const
 }
 
 
+int config_parse_documentation(
+                const char *filename,
+                unsigned line,
+                const char *section,
+                const char *lvalue,
+                int ltype,
+                const char *rvalue,
+                void *data,
+                void *userdata) {
+
+        /* silently ignored in F16 */
+        return 0;
+}
+
 #define FOLLOW_MAX 8
 
 static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
diff --git a/src/load-fragment.h b/src/load-fragment.h
index fbb31f9..dd734fc 100644
--- a/src/load-fragment.h
+++ b/src/load-fragment.h
@@ -36,6 +36,7 @@ int config_parse_unit_names(const char *filename, unsigned line, const char *sec
 int config_parse_unit_string_printf(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unit_strv_printf(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_unit_path_printf(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_documentation(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_socket_listen(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_socket_bind(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
 int config_parse_exec_nice(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);