aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-05-19 08:59:58 +0100
committerChristopher Baines <mail@cbaines.net>2022-05-19 08:59:58 +0100
commit285437697d524f4205a7f1c25a23d9ef771412f2 (patch)
tree4772e6543bb721e71ef8ed34a2245de9507fd47f
parenta24fbd108f75c8f27d2f68f2d1a051e2f3f3e191 (diff)
downloadnar-herder-285437697d524f4205a7f1c25a23d9ef771412f2.tar
nar-herder-285437697d524f4205a7f1c25a23d9ef771412f2.tar.gz
Fiddle more with the nar removal criteria
This should make the singular stored-on and and'ed stored-on work properly.
-rw-r--r--nar-herder/storage.scm6
-rw-r--r--scripts/nar-herder.in5
2 files changed, 7 insertions, 4 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm
index 7e72910..c017685 100644
--- a/nar-herder/storage.scm
+++ b/nar-herder/storage.scm
@@ -209,13 +209,15 @@
(database-select-narinfo-for-file database (assq-ref nar 'url)))
(match criteria
- (('and and-criteria ...)
+ (('and and-criteria)
(every (lambda (c)
(check-removal-criteria nar c))
and-criteria))
(('stored-on url)
(let ((uri (string->uri
- (string-append url
+ (string-append (if (symbol? url)
+ (symbol->string url)
+ url)
"/"
(store-path-hash-part
(assq-ref narinfo 'store-path))
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index 37705bc..32a2afa 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -131,8 +131,9 @@
(lambda (opt name arg result)
(alist-cons 'storage-nar-removal-criteria
(match (string-split arg #\=)
- ((sym rest ...)
- (cons (string->symbol sym) rest)))
+ ((sym rest)
+ (list (string->symbol sym)
+ (call-with-input-string rest read))))
result)))
(option '("ttl") #t #f