diff options
author | Christian Hesse | 2018-06-18 11:48:43 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2018-06-27 18:13:03 +0200 |
commit | 54d37dc154f5308459df0a90c81dabd0245b6c17 (patch) | |
tree | 6a4ab44d3dc6f51ea9f417206721ec648bea67f9 | |
parent | 2f8648ff7f5c7119ab035c134504f04eefe068fb (diff) | |
download | cgit-54d37dc154f5308459df0a90c81dabd0245b6c17.tar.gz cgit-54d37dc154f5308459df0a90c81dabd0245b6c17.tar.bz2 cgit-54d37dc154f5308459df0a90c81dabd0245b6c17.zip |
global: remove functionality we deprecated for cgit v1.0
The man page states these were deprecated for v1.0. We are past v1.1,
so remove the functionality.
Signed-off-by: Christian Hesse <mail@eworm.de>
Reviewed-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | cgit.c | 17 | ||||
-rw-r--r-- | cgit.h | 3 | ||||
-rw-r--r-- | cgitrc.5.txt | 21 | ||||
-rw-r--r-- | ui-repolist.c | 3 | ||||
-rw-r--r-- | ui-shared.c | 2 |
5 files changed, 3 insertions, 43 deletions
@@ -111,7 +111,7 @@ static void config_cb(const char *name, const char *value) | |||
111 | { | 111 | { |
112 | const char *arg; | 112 | const char *arg; |
113 | 113 | ||
114 | if (!strcmp(name, "section") || !strcmp(name, "repo.group")) | 114 | if (!strcmp(name, "section")) |
115 | ctx.cfg.section = xstrdup(value); | 115 | ctx.cfg.section = xstrdup(value); |
116 | else if (!strcmp(name, "repo.url")) | 116 | else if (!strcmp(name, "repo.url")) |
117 | ctx.repo = cgit_add_repo(value); | 117 | ctx.repo = cgit_add_repo(value); |
@@ -139,20 +139,14 @@ static void config_cb(const char *name, const char *value) | |||
139 | ctx.cfg.header = xstrdup(value); | 139 | ctx.cfg.header = xstrdup(value); |
140 | else if (!strcmp(name, "logo")) | 140 | else if (!strcmp(name, "logo")) |
141 | ctx.cfg.logo = xstrdup(value); | 141 | ctx.cfg.logo = xstrdup(value); |
142 | else if (!strcmp(name, "index-header")) | ||
143 | ctx.cfg.index_header = xstrdup(value); | ||
144 | else if (!strcmp(name, "index-info")) | ||
145 | ctx.cfg.index_info = xstrdup(value); | ||
146 | else if (!strcmp(name, "logo-link")) | 142 | else if (!strcmp(name, "logo-link")) |
147 | ctx.cfg.logo_link = xstrdup(value); | 143 | ctx.cfg.logo_link = xstrdup(value); |
148 | else if (!strcmp(name, "module-link")) | 144 | else if (!strcmp(name, "module-link")) |
149 | ctx.cfg.module_link = xstrdup(value); | 145 | ctx.cfg.module_link = xstrdup(value); |
150 | else if (!strcmp(name, "strict-export")) | 146 | else if (!strcmp(name, "strict-export")) |
151 | ctx.cfg.strict_export = xstrdup(value); | 147 | ctx.cfg.strict_export = xstrdup(value); |
152 | else if (!strcmp(name, "virtual-root")) { | 148 | else if (!strcmp(name, "virtual-root")) |
153 | ctx.cfg.virtual_root = ensure_end(value, '/'); | 149 | ctx.cfg.virtual_root = ensure_end(value, '/'); |
154 | } else if (!strcmp(name, "nocache")) | ||
155 | ctx.cfg.nocache = atoi(value); | ||
156 | else if (!strcmp(name, "noplainemail")) | 150 | else if (!strcmp(name, "noplainemail")) |
157 | ctx.cfg.noplainemail = atoi(value); | 151 | ctx.cfg.noplainemail = atoi(value); |
158 | else if (!strcmp(name, "noheader")) | 152 | else if (!strcmp(name, "noheader")) |
@@ -236,7 +230,7 @@ static void config_cb(const char *name, const char *value) | |||
236 | else if (!strcmp(name, "project-list")) | 230 | else if (!strcmp(name, "project-list")) |
237 | ctx.cfg.project_list = xstrdup(expand_macros(value)); | 231 | ctx.cfg.project_list = xstrdup(expand_macros(value)); |
238 | else if (!strcmp(name, "scan-path")) | 232 | else if (!strcmp(name, "scan-path")) |
239 | if (!ctx.cfg.nocache && ctx.cfg.cache_size) | 233 | if (ctx.cfg.cache_size) |
240 | process_cached_repolist(expand_macros(value)); | 234 | process_cached_repolist(expand_macros(value)); |
241 | else if (ctx.cfg.project_list) | 235 | else if (ctx.cfg.project_list) |
242 | scan_projects(expand_macros(value), | 236 | scan_projects(expand_macros(value), |
@@ -355,7 +349,6 @@ static void prepare_context(void) | |||
355 | { | 349 | { |
356 | memset(&ctx, 0, sizeof(ctx)); | 350 | memset(&ctx, 0, sizeof(ctx)); |
357 | ctx.cfg.agefile = "info/web/last-modified"; | 351 | ctx.cfg.agefile = "info/web/last-modified"; |
358 | ctx.cfg.nocache = 0; | ||
359 | ctx.cfg.cache_size = 0; | 352 | ctx.cfg.cache_size = 0; |
360 | ctx.cfg.cache_max_create_time = 5; | 353 | ctx.cfg.cache_max_create_time = 5; |
361 | ctx.cfg.cache_root = CGIT_CACHE_ROOT; | 354 | ctx.cfg.cache_root = CGIT_CACHE_ROOT; |
@@ -973,8 +966,6 @@ static void cgit_parse_args(int argc, const char **argv) | |||
973 | } | 966 | } |
974 | if (skip_prefix(argv[i], "--cache=", &arg)) { | 967 | if (skip_prefix(argv[i], "--cache=", &arg)) { |
975 | ctx.cfg.cache_root = xstrdup(arg); | 968 | ctx.cfg.cache_root = xstrdup(arg); |
976 | } else if (!strcmp(argv[i], "--nocache")) { | ||
977 | ctx.cfg.nocache = 1; | ||
978 | } else if (!strcmp(argv[i], "--nohttp")) { | 969 | } else if (!strcmp(argv[i], "--nohttp")) { |
979 | ctx.env.no_http = "1"; | 970 | ctx.env.no_http = "1"; |
980 | } else if (skip_prefix(argv[i], "--query=", &arg)) { | 971 | } else if (skip_prefix(argv[i], "--query=", &arg)) { |
@@ -1095,8 +1086,6 @@ int cmd_main(int argc, const char **argv) | |||
1095 | else | 1086 | else |
1096 | ctx.page.expires += ttl * 60; | 1087 | ctx.page.expires += ttl * 60; |
1097 | if (!ctx.env.authenticated || (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD"))) | 1088 | if (!ctx.env.authenticated || (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD"))) |
1098 | ctx.cfg.nocache = 1; | ||
1099 | if (ctx.cfg.nocache) | ||
1100 | ctx.cfg.cache_size = 0; | 1089 | ctx.cfg.cache_size = 0; |
1101 | err = cache_process(ctx.cfg.cache_size, ctx.cfg.cache_root, | 1090 | err = cache_process(ctx.cfg.cache_size, ctx.cfg.cache_root, |
1102 | ctx.qry.raw, ttl, process_request); | 1091 | ctx.qry.raw, ttl, process_request); |
@@ -197,8 +197,6 @@ struct cgit_config { | |||
197 | char *footer; | 197 | char *footer; |
198 | char *head_include; | 198 | char *head_include; |
199 | char *header; | 199 | char *header; |
200 | char *index_header; | ||
201 | char *index_info; | ||
202 | char *logo; | 200 | char *logo; |
203 | char *logo_link; | 201 | char *logo_link; |
204 | char *mimetype_file; | 202 | char *mimetype_file; |
@@ -248,7 +246,6 @@ struct cgit_config { | |||
248 | int max_repodesc_len; | 246 | int max_repodesc_len; |
249 | int max_blob_size; | 247 | int max_blob_size; |
250 | int max_stats; | 248 | int max_stats; |
251 | int nocache; | ||
252 | int noplainemail; | 249 | int noplainemail; |
253 | int noheader; | 250 | int noheader; |
254 | int renamelimit; | 251 | int renamelimit; |
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 3bfacfa..acfae91 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
@@ -238,18 +238,6 @@ include:: | |||
238 | Name of a configfile to include before the rest of the current config- | 238 | Name of a configfile to include before the rest of the current config- |
239 | file is parsed. Default value: none. See also: "MACRO EXPANSION". | 239 | file is parsed. Default value: none. See also: "MACRO EXPANSION". |
240 | 240 | ||
241 | index-header:: | ||
242 | The content of the file specified with this option will be included | ||
243 | verbatim above the repository index. This setting is deprecated, and | ||
244 | will not be supported by cgit-1.0 (use root-readme instead). Default | ||
245 | value: none. | ||
246 | |||
247 | index-info:: | ||
248 | The content of the file specified with this option will be included | ||
249 | verbatim below the heading on the repository index page. This setting | ||
250 | is deprecated, and will not be supported by cgit-1.0 (use root-desc | ||
251 | instead). Default value: none. | ||
252 | |||
253 | local-time:: | 241 | local-time:: |
254 | Flag which, if set to "1", makes cgit print commit and tag times in the | 242 | Flag which, if set to "1", makes cgit print commit and tag times in the |
255 | servers timezone. Default value: "0". | 243 | servers timezone. Default value: "0". |
@@ -323,11 +311,6 @@ module-link:: | |||
323 | formatstring are the path and SHA1 of the submodule commit. Default | 311 | formatstring are the path and SHA1 of the submodule commit. Default |
324 | value: none. | 312 | value: none. |
325 | 313 | ||
326 | nocache:: | ||
327 | If set to the value "1" caching will be disabled. This settings is | ||
328 | deprecated, and will not be honored starting with cgit-1.0. Default | ||
329 | value: "0". | ||
330 | |||
331 | noplainemail:: | 314 | noplainemail:: |
332 | If set to "1" showing full author email addresses will be disabled. | 315 | If set to "1" showing full author email addresses will be disabled. |
333 | Default value: "0". | 316 | Default value: "0". |
@@ -359,10 +342,6 @@ renamelimit:: | |||
359 | "-1" uses the compiletime value in git (for further info, look at | 342 | "-1" uses the compiletime value in git (for further info, look at |
360 | `man git-diff`). Default value: "-1". | 343 | `man git-diff`). Default value: "-1". |
361 | 344 | ||
362 | repo.group:: | ||
363 | Legacy alias for "section". This option is deprecated and will not be | ||
364 | supported in cgit-1.0. | ||
365 | |||
366 | repository-sort:: | 345 | repository-sort:: |
367 | The way in which repositories in each section are sorted. Valid values | 346 | The way in which repositories in each section are sorted. Valid values |
368 | are "name" for sorting by the repo name or "age" for sorting by the | 347 | are "name" for sorting by the repo name or "age" for sorting by the |
diff --git a/ui-repolist.c b/ui-repolist.c index af52f9b..41424c0 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -288,9 +288,6 @@ void cgit_print_repolist(void) | |||
288 | cgit_print_docstart(); | 288 | cgit_print_docstart(); |
289 | cgit_print_pageheader(); | 289 | cgit_print_pageheader(); |
290 | 290 | ||
291 | if (ctx.cfg.index_header) | ||
292 | html_include(ctx.cfg.index_header); | ||
293 | |||
294 | if (ctx.qry.sort) | 291 | if (ctx.qry.sort) |
295 | sorted = sort_repolist(ctx.qry.sort); | 292 | sorted = sort_repolist(ctx.qry.sort); |
296 | else if (ctx.cfg.section_sort) | 293 | else if (ctx.cfg.section_sort) |
diff --git a/ui-shared.c b/ui-shared.c index e8c0723..a63dcb0 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -977,8 +977,6 @@ static void print_header(void) | |||
977 | } else { | 977 | } else { |
978 | if (ctx.cfg.root_desc) | 978 | if (ctx.cfg.root_desc) |
979 | html_txt(ctx.cfg.root_desc); | 979 | html_txt(ctx.cfg.root_desc); |
980 | else if (ctx.cfg.index_info) | ||
981 | html_include(ctx.cfg.index_info); | ||
982 | } | 980 | } |
983 | html("</td></tr></table>\n"); | 981 | html("</td></tr></table>\n"); |
984 | } | 982 | } |