summaryrefslogtreecommitdiff
path: root/guix/forge
diff options
context:
space:
mode:
authorArun Isaac2023-10-04 16:21:45 +0100
committerArun Isaac2023-10-04 16:23:44 +0100
commit9ce2e5be41c0a1dc509037534a57918bc7a724d2 (patch)
tree0cf92a6b1ca13bd5c75838c0dc264f905cff585f /guix/forge
parent0010c66441e8c6778f4cc7a1d69829fe27473fc2 (diff)
downloadguix-forge-9ce2e5be41c0a1dc509037534a57918bc7a724d2.tar.gz
guix-forge-9ce2e5be41c0a1dc509037534a57918bc7a724d2.tar.lz
guix-forge-9ce2e5be41c0a1dc509037534a57918bc7a724d2.zip
forge: Set repository ownership only when user field is set.
* guix/forge/forge.scm (forge-activation): Set repository ownership only when user field is set.
Diffstat (limited to 'guix/forge')
-rw-r--r--guix/forge/forge.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/guix/forge/forge.scm b/guix/forge/forge.scm
index e3a6504..ca8128c 100644
--- a/guix/forge/forge.scm
+++ b/guix/forge/forge.scm
@@ -158,11 +158,16 @@
(when description
(call-with-output-file (string-append repository "/description")
(cut put-string <> description)))
- ;; Set ownership of repository files.
- (for-each (lambda (file)
- (let ((user (getpw username)))
- (chown file (passwd:uid user) (passwd:gid user))))
- (append (find-regular-files repository))))
+ ;; Set ownership of repository files when the
+ ;; user field is set. This enables setups where
+ ;; ownership is manually managed. TODO: Rethink
+ ;; this when we move to repositories owned and
+ ;; operated on by virtual users.
+ (when username
+ (for-each (lambda (file)
+ (let ((user (getpw username)))
+ (chown file (passwd:uid user) (passwd:gid user))))
+ (append (find-regular-files repository)))))
;; Install post receive hook.
(when (eq? ci-jobs-trigger-type 'post-receive-hook)
(let ((hook-link (string-append repository "/hooks/post-receive")))