aboutsummaryrefslogtreecommitdiff
path: root/module/calp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-01 21:32:15 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-01 22:10:14 +0100
commit55477368f84f76b831d3b714c52784e7bb952021 (patch)
treedd8afcc594e1b8ec6f4c59777c343488ab049820 /module/calp
parentDocument module-dependants. (diff)
downloadcalp-55477368f84f76b831d3b714c52784e7bb952021.tar.gz
calp-55477368f84f76b831d3b714c52784e7bb952021.tar.xz
Move path-append to own module.
Diffstat (limited to 'module/calp')
-rw-r--r--module/calp/benchmark/parse.scm1
-rw-r--r--module/calp/entry-points/html.scm7
-rw-r--r--module/calp/html/vcomponent.scm3
-rw-r--r--module/calp/main.scm11
-rw-r--r--module/calp/server/routes.scm1
5 files changed, 15 insertions, 8 deletions
diff --git a/module/calp/benchmark/parse.scm b/module/calp/benchmark/parse.scm
index f1ddf17d..1391d18a 100644
--- a/module/calp/benchmark/parse.scm
+++ b/module/calp/benchmark/parse.scm
@@ -1,5 +1,6 @@
(define-module (calp benchmark parse)
:use-module (hnh util)
+ :use-module ((hnh util path) :select (path-append))
:use-module (glob)
:use-module (statprof)
diff --git a/module/calp/entry-points/html.scm b/module/calp/entry-points/html.scm
index adac302f..7c4fe257 100644
--- a/module/calp/entry-points/html.scm
+++ b/module/calp/entry-points/html.scm
@@ -1,6 +1,7 @@
(define-module (calp entry-points html)
:export (main)
:use-module (hnh util)
+ :use-module ((hnh util path) :select (path-append))
:use-module (calp util time)
:use-module (hnh util options)
:use-module (datetime)
@@ -66,15 +67,15 @@
;; file existing but is of wrong type,
(define (create-files output-directory)
- (let* ((link (path-append output-directory "/static")))
+ (let* ((link (path-append output-directory "static")))
(unless (file-exists? output-directory)
(mkdir output-directory))
;; TODO nicer way to resolve static
- (let ((link (path-append output-directory "/static")))
+ (let ((link (path-append output-directory "static")))
(unless (file-exists? link)
- (symlink (path-append (xdg-data-home) "/calp/www/static") link)))))
+ (symlink (path-append (xdg-data-home) "calp" "www" "static") link)))))
(define (re-root-static tree)
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm
index 34aeca66..4c1ebbb3 100644
--- a/module/calp/html/vcomponent.scm
+++ b/module/calp/html/vcomponent.scm
@@ -1,5 +1,8 @@
(define-module (calp html vcomponent)
:use-module (hnh util)
+ ;; TODO should we really use path-append here? Path append is
+ ;; system-dependant, while URL-paths aren't.
+ :use-module ((hnh util path) :select (path-append))
:use-module (srfi srfi-1)
:use-module (srfi srfi-41)
:use-module ((rnrs io ports) :select (put-bytevector))
diff --git a/module/calp/main.scm b/module/calp/main.scm
index 01d66e5f..0ae22927 100644
--- a/module/calp/main.scm
+++ b/module/calp/main.scm
@@ -1,6 +1,7 @@
;; -*- geiser-scheme-implementation: guile -*-
(define-module (calp main)
:use-module (hnh util)
+ :use-module ((hnh util path) :select (path-append))
:use-module (srfi srfi-1)
:use-module (srfi srfi-88) ; keyword syntax
@@ -125,8 +126,8 @@
;; if an explicitly given config is missing.
[(find file-exists?
(list
- (path-append (xdg-config-home) "/calp/config.scm")
- (path-append (xdg-sysconfdir) "/calp/config.scm")))
+ (path-append (xdg-config-home) "calp" "config.scm")
+ (path-append (xdg-sysconfdir) "calp" "config.scm")))
=> identity]))
(when stprof (statprof-start))
@@ -210,7 +211,7 @@
(throw 'return))
(when (option-ref opts 'update-zoneinfo #f)
- (let* ((locations (list "/usr/libexec/calp/tzget" (path-append (xdg-data-home) "/tzget")))
+ (let* ((locations (list "/usr/libexec/calp/tzget" (path-append (xdg-data-home) "tzget")))
(filename (or (find file-exists? locations)
(error "tzget not installed, please put it in one of ~a" locations)))
(pipe (open-input-pipe filename)))
@@ -219,13 +220,13 @@
(define line ((@ (ice-9 rdelim) read-line) pipe))
(define names (string-split line #\space))
((@ (hnh util io) with-atomic-output-to-file)
- (path-append (xdg-data-home) "/calp/zoneinfo.scm")
+ (path-append (xdg-data-home) "calp" "zoneinfo.scm")
(lambda ()
(write `(set-config! 'tz-list ',names)) (newline)
(write `(set-config! 'last-zoneinfo-upgrade ,((@ (datetime) current-date)))) (newline)))))
;; always load zoneinfo if available.
- (let ((z (path-append (xdg-data-home) "/calp/zoneinfo.scm")))
+ (let ((z (path-append (xdg-data-home) "calp" "zoneinfo.scm")))
(when (file-exists? z)
(primitive-load z)))
diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm
index b53e1cad..87af983a 100644
--- a/module/calp/server/routes.scm
+++ b/module/calp/server/routes.scm
@@ -1,5 +1,6 @@
(define-module (calp server routes)
:use-module (hnh util)
+ :use-module ((hnh util path) :select (path-append))
:use-module (hnh util options)
:use-module (hnh util exceptions)