unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob abe19845072695076101e13684974a0b23654644 1451 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
From 8b4d686a62fd66dedfc40ecdcf3698316993d614 Mon Sep 17 00:00:00 2001
From: Philip McGrath <philip@philipmcgrath.com>
Date: Sun, 17 Jul 2022 22:51:44 -0400
Subject: [PATCH] racket-index: set write permission when copying
 `docindex.sqlite`

Fixes https://github.com/racket/racket/issues/4357

(cherry picked from commit 55b6cbdca1f36a4f37bab1519c1b658717d3cad2)
---
 pkgs/racket-index/setup/scribble.rkt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pkgs/racket-index/setup/scribble.rkt b/pkgs/racket-index/setup/scribble.rkt
index 6694f0b793..e27a8fa348 100644
--- a/pkgs/racket-index/setup/scribble.rkt
+++ b/pkgs/racket-index/setup/scribble.rkt
@@ -252,7 +252,14 @@
     (unless (file-exists? db-file)
       (define-values (base name dir?) (split-path db-file))
       (make-directory* base)
-      (when copy-from (copy-file copy-from db-file))
+      (when copy-from
+        (copy-file copy-from db-file)
+        ;; we might not have write permissions for the previous layer:
+        ;; ensure that we do for the new file
+        (define orig-mode (file-or-directory-permissions db-file 'bits))
+        (define writeable-mode (bitwise-ior user-write-bit orig-mode))
+        (unless (= writeable-mode orig-mode)
+          (file-or-directory-permissions db-file writeable-mode)))
       (doc-db-disconnect
        (doc-db-file->connection db-file #t))))
   (when (or (ormap can-build*? main-docs)
-- 
2.32.0


debug log:

solving abe1984507 ...
found abe1984507 in https://git.savannah.gnu.org/cgit/guix.git

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).