aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-03-16 19:58:31 +0000
committerChristopher Baines <mail@cbaines.net>2019-03-16 19:59:45 +0000
commit38888aea6b398fb5a44af77314c03900cf64d43d (patch)
tree1ab62087043ff6584b5cae0624c27eb9a47859a0
parenta0f4f153a9950443b319e8af8c6b5e2da30d7335 (diff)
downloaddata-service-38888aea6b398fb5a44af77314c03900cf64d43d.tar
data-service-38888aea6b398fb5a44af77314c03900cf64d43d.tar.gz
Fix some duplication on the compare page
For the new and removed package sections.
-rw-r--r--guix-data-service/comparison.scm18
-rw-r--r--guix-data-service/web/view/html.scm4
2 files changed, 12 insertions, 10 deletions
diff --git a/guix-data-service/comparison.scm b/guix-data-service/comparison.scm
index 8688f84..132def8 100644
--- a/guix-data-service/comparison.scm
+++ b/guix-data-service/comparison.scm
@@ -127,17 +127,19 @@ ORDER BY base_packages.name DESC, base_packages.version, target_packages.name, t
(define (package-data-vhashes->new-packages base-packages-vhash target-packages-vhash)
(vlist->list
- (vlist-filter (match-lambda
- ((name . details)
- (not (vhash-assoc name base-packages-vhash))))
- target-packages-vhash)))
+ (package-data-vhash->package-name-and-version-vhash
+ (vlist-filter (match-lambda
+ ((name . details)
+ (not (vhash-assoc name base-packages-vhash))))
+ target-packages-vhash))))
(define (package-data-vhashes->removed-packages base-packages-vhash target-packages-vhash)
(vlist->list
- (vlist-filter (match-lambda
- ((name . details)
- (not (vhash-assoc name target-packages-vhash))))
- base-packages-vhash)))
+ (package-data-vhash->package-name-and-version-vhash
+ (vlist-filter (match-lambda
+ ((name . details)
+ (not (vhash-assoc name target-packages-vhash))))
+ base-packages-vhash))))
(define (package-data-vhash->package-versions-vhash package-data-vhash)
(define (system-and-target<? a b)
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 665e9e7..d84230d 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -591,7 +591,7 @@
(tbody
,@(map
(match-lambda
- ((name version rest ...)
+ (((name . version) metadata)
`(tr
(td ,name)
(td ,version))))
@@ -610,7 +610,7 @@
(tbody
,@(map
(match-lambda
- ((name version rest ...)
+ (((name . version) metadata)
`(tr
(td ,name)
(td ,version))))