]> git.cameronkatri.com Git - cgit.git/blobdiff - cgit.c
implement repo.logo and repo.logo-link
[cgit.git] / cgit.c
diff --git a/cgit.c b/cgit.c
index d6146e2270737806513b0ceca0e187475f93c121..e8c1f9405f56af242b94587cf47349a40a40ba99 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -71,13 +71,13 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
                repo->module_link= xstrdup(value);
        else if (!strcmp(name, "section"))
                repo->section = xstrdup(value);
-       else if (!strcmp(name, "readme") && value != NULL) {
-               char *colon;
-               if (*value == '/' || ((colon = strchr(value, ':')) != NULL && colon != value && *(colon + 1) != '\0'))
-                       repo->readme = xstrdup(value);
-               else
-                       repo->readme = xstrdup(fmt("%s/%s", repo->path, value));
-       else if (ctx.cfg.enable_filter_overrides) {
+       else if (!strcmp(name, "readme") && value != NULL)
+               repo->readme = xstrdup(value);
+       else if (!strcmp(name, "logo") && value != NULL)
+               repo->logo = xstrdup(value);
+       else if (!strcmp(name, "logo-link") && value != NULL)
+               repo->logo_link = xstrdup(value);
+       else if (ctx.cfg.enable_filter_overrides) {
                if (!strcmp(name, "about-filter"))
                        repo->about_filter = new_filter(value, 0);
                else if (!strcmp(name, "commit-filter"))
@@ -97,6 +97,8 @@ void config_cb(const char *name, const char *value)
                ctx.repo->path = trim_end(value, '/');
        else if (ctx.repo && !prefixcmp(name, "repo."))
                repo_config(ctx.repo, name + 5, value);
+       else if (!strcmp(name, "readme"))
+               ctx.cfg.readme = xstrdup(value);
        else if (!strcmp(name, "root-title"))
                ctx.cfg.root_title = xstrdup(value);
        else if (!strcmp(name, "root-desc"))
@@ -123,6 +125,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.logo_link = xstrdup(value);
        else if (!strcmp(name, "module-link"))
                ctx.cfg.module_link = xstrdup(value);
+       else if (!strcmp(name, "strict-export"))
+               ctx.cfg.strict_export = xstrdup(value);
        else if (!strcmp(name, "virtual-root")) {
                ctx.cfg.virtual_root = trim_end(value, '/');
                if (!ctx.cfg.virtual_root && (!strcmp(value, "/")))
@@ -195,6 +199,8 @@ void config_cb(const char *name, const char *value)
                                      ctx.cfg.project_list, repo_config);
                else
                        scan_tree(expand_macros(value), repo_config);
+       else if (!strcmp(name, "section-from-path"))
+               ctx.cfg.section_from_path = atoi(value);
        else if (!strcmp(name, "source-filter"))
                ctx.cfg.source_filter = new_filter(value, 1);
        else if (!strcmp(name, "summary-log"))
@@ -610,7 +616,7 @@ static void process_cached_repolist(const char *path)
        hash = hash_str(path);
        if (ctx.cfg.project_list)
                hash += hash_str(ctx.cfg.project_list);
-       cached_rc = xstrdup(fmt("%s/rc-%8x", ctx.cfg.cache_root, hash));
+       cached_rc = xstrdup(fmt("%s/rc-%8lx", ctx.cfg.cache_root, hash));
 
        if (stat(cached_rc, &st)) {
                /* Nothing is cached, we need to scan without forking. And