Add #:authenticate? parameter to ‘git-repository-url->git-repository-id’.
This commit is contained in:
parent
53710e73b3
commit
ff7697477f
1 changed files with 14 additions and 4 deletions
|
|
@ -225,7 +225,11 @@ FROM git_repositories WHERE id = $1"
|
||||||
(((id))
|
(((id))
|
||||||
(string->number id))))
|
(string->number id))))
|
||||||
|
|
||||||
(define (git-repository-url->git-repository-id conn url)
|
(define* (git-repository-url->git-repository-id conn url
|
||||||
|
#:key (authenticate? #t))
|
||||||
|
(define (->boolean value)
|
||||||
|
(if value "TRUE" "FALSE"))
|
||||||
|
|
||||||
(let ((existing-id
|
(let ((existing-id
|
||||||
(exec-query
|
(exec-query
|
||||||
conn
|
conn
|
||||||
|
|
@ -233,15 +237,21 @@ FROM git_repositories WHERE id = $1"
|
||||||
"SELECT id FROM git_repositories WHERE url = '" url "'"))))
|
"SELECT id FROM git_repositories WHERE url = '" url "'"))))
|
||||||
(string->number
|
(string->number
|
||||||
(match existing-id
|
(match existing-id
|
||||||
(((id)) id)
|
(((id))
|
||||||
|
(exec-query conn
|
||||||
|
(string-append "UPDATE git_repositories \
|
||||||
|
SET fetch_with_authentication = "
|
||||||
|
(->boolean authenticate?)
|
||||||
|
" WHERE id = " id ";"))
|
||||||
|
id)
|
||||||
(()
|
(()
|
||||||
(caar
|
(caar
|
||||||
(exec-query conn
|
(exec-query conn
|
||||||
(string-append
|
(string-append
|
||||||
"INSERT INTO git_repositories "
|
"INSERT INTO git_repositories "
|
||||||
"(url) "
|
"(url, fetch_with_authentication) "
|
||||||
"VALUES "
|
"VALUES "
|
||||||
"('" url "') "
|
"('" url "', " (->boolean authenticate?) ") "
|
||||||
"RETURNING id"))))))))
|
"RETURNING id"))))))))
|
||||||
|
|
||||||
(define (guix-revisions-and-jobs-for-git-repository conn git-repository-id)
|
(define (guix-revisions-and-jobs-for-git-repository conn git-repository-id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue