commit c8f50f70a4cae45a7b54db0f35e1b2f4529b9067
parent 96f814af9c65984e4c203af2017ee81a3224b8bb
Author: Luke Willis <lukejw@monastech.xyz>
Date: Sun, 8 Mar 2026 17:10:49 -0400
services: Update the stagit service to use accept and use a logo in svg format
Diffstat:
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/mt/packages/patches/stagit.diff b/mt/packages/patches/stagit.diff
@@ -1,5 +1,5 @@
diff --git a/stagit-index.c b/stagit-index.c
-index 6402296..0cc3591 100644
+index 6402296..0f22737 100644
--- a/stagit-index.c
+++ b/stagit-index.c
@@ -101,10 +101,10 @@ writeheader(FILE *fp)
@@ -8,16 +8,16 @@ index 6402296..0cc3591 100644
xmlencode(fp, description, strlen(description));
- fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
- fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
-+ fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"/favicon.png\" />\n", relpath);
++ fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"/logo.svg\" />\n", relpath);
+ fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\" />\n", relpath);
fputs("</head>\n<body>\n", fp);
- fprintf(fp, "<table>\n<tr><td><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></td>\n"
-+ fprintf(fp, "<table>\n<tr><td><img src=\"/logo.png\" alt=\"\" width=\"32\" height=\"32\" /></td>\n"
++ fprintf(fp, "<table>\n<tr><td><img src=\"/logo.svg\" alt=\"\" width=\"32\" height=\"32\" /></td>\n"
"<td><span class=\"desc\">", relpath);
xmlencode(fp, description, strlen(description));
fputs("</span></td></tr><tr><td></td><td>\n"
diff --git a/stagit.c b/stagit.c
-index 409714b..9248616 100644
+index 409714b..46f086b 100644
--- a/stagit.c
+++ b/stagit.c
@@ -511,16 +511,16 @@ writeheader(FILE *fp, const char *title)
@@ -25,7 +25,7 @@ index 409714b..9248616 100644
fputs(" - ", fp);
xmlencode(fp, description, strlen(description));
- fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
-+ fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"/favicon.png\" />\n", relpath);
++ fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"/logo.svg\" />\n", relpath);
fputs("<link rel=\"alternate\" type=\"application/atom+xml\" title=\"", fp);
xmlencode(fp, name, strlen(name));
fprintf(fp, " Atom Feed\" href=\"%satom.xml\" />\n", relpath);
@@ -36,7 +36,7 @@ index 409714b..9248616 100644
+ fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\" />\n", relpath);
fputs("</head>\n<body>\n<table><tr><td>", fp);
- fprintf(fp, "<a href=\"../%s\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>",
-+ fprintf(fp, "<a href=\"../%s\"><img src=\"/logo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>",
++ fprintf(fp, "<a href=\"../%s\"><img src=\"/logo.svg\" alt=\"\" width=\"32\" height=\"32\" /></a>",
relpath, relpath);
fputs("</td><td><h1>", fp);
xmlencode(fp, strippedname, strlen(strippedname));
diff --git a/mt/services/version-control.scm b/mt/services/version-control.scm
@@ -1,4 +1,5 @@
(define-module (mt services version-control)
+ #:use-module (gnu artwork)
#:use-module (gnu services)
#:use-module (gnu services base)
#:use-module (gnu services shepherd)
@@ -110,9 +111,9 @@ protocol.")
(default "/var/www/stagit"))
(gitolite-home stagit-configuration-gitolite-home ;string
(default "/var/lib/gitolite"))
- (icon stagit-configuration-icon ;file-like
- (default (plain-file "icon.svg"
- "\n")))
+ (logo stagit-configuration-logo ;file-like
+ (default (file-append %artwork-repository
+ "/logo/head-only/Guix-head.svg")))
(stylesheet stagit-configuration-stylesheet ;file-like
(default (plain-file "style.css"
"\n")))
@@ -124,7 +125,7 @@ protocol.")
(define (stagit-activation config)
(let* ((package (stagit-configuration-package config))
(www-home (stagit-configuration-www-home config))
- (icon (stagit-configuration-icon config))
+ (logo (stagit-configuration-logo config))
(stylesheet (stagit-configuration-stylesheet config))
(gitolite-home (stagit-configuration-gitolite-home config))
(gitolite-hooks (string-append gitolite-home "/local/hooks/common"))
@@ -136,7 +137,7 @@ protocol.")
(use-modules (ice-9 match))
(let* ((user-info (getpwnam "git"))
- (icon (string-append #$www-home "/favicon.png"))
+ (logo (string-append #$www-home "/logo.svg"))
(stylesheet (string-append #$www-home "/style.css"))
(post-receive (string-append #$gitolite-hooks "/post-receive")))
;; Setup files as the root user.
@@ -156,9 +157,9 @@ protocol.")
(setuid (passwd:uid user-info))
;; Setup files.
- (if (file-exists? icon)
- (delete-file icon))
- (symlink #$icon icon)
+ (if (file-exists? logo)
+ (delete-file logo))
+ (symlink #$logo logo)
(if (file-exists? stylesheet)
(delete-file stylesheet))