aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/model/git-repository.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-13 21:02:53 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-13 21:07:48 +0100
commit7341d1725420b431160536c1cf2b34a662ff0a86 (patch)
treef1490bcbf7133a2f5b8e46910138c991a6cf0ef3 /guix-data-service/model/git-repository.scm
parent9aaab6b751993d6774ed96b0f8632d8af3d565c7 (diff)
downloaddata-service-7341d1725420b431160536c1cf2b34a662ff0a86.tar
data-service-7341d1725420b431160536c1cf2b34a662ff0a86.tar.gz
Store and display the location of packages
Store the location a package can be found at, and display this on the package page. If available, link off to the git repository containing the package.
Diffstat (limited to 'guix-data-service/model/git-repository.scm')
-rw-r--r--guix-data-service/model/git-repository.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/guix-data-service/model/git-repository.scm b/guix-data-service/model/git-repository.scm
index 5f35cd3..16c57bf 100644
--- a/guix-data-service/model/git-repository.scm
+++ b/guix-data-service/model/git-repository.scm
@@ -4,6 +4,7 @@
#:export (all-git-repositories
git-repository-id->url
git-repository-url->git-repository-id
+ git-repositories-containing-commit
guix-revisions-and-jobs-for-git-repository))
@@ -56,3 +57,15 @@ ORDER BY 1 DESC NULLS FIRST, 2 DESC LIMIT 10;")
conn
query
(list git-repository-id)))
+
+(define (git-repositories-containing-commit conn commit)
+ (define query
+ "
+SELECT id, label, url, cgit_url_base
+FROM git_repositories WHERE id IN (
+ SELECT git_repository_id
+ FROM git_branches
+ WHERE commit = $1
+)")
+
+ (exec-query conn query (list commit)))