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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| | When quelpa builds some packages it has to copy files from the store, which means that they are marked as read-only. This patch sets the permissions of copied files and directories to ensure that they are writable.
diff --git a/core/libs/quelpa.el b/core/libs/quelpa.el
index 70b143657..9da420028 100644
@@ -374,8 +374,10 @@ and return TIME-STAMP, otherwise return OLD-TIME-STAMP."
(delete-directory dir t)
(make-directory dir)
(if (eq type 'file)
- (copy-file file-path dir t t t t)
- (copy-directory file-path dir t t t)))
+ (progn (copy-file file-path dir t t t t)
+ (set-file-modes (expand-file-name (file-name-nondirectory file-path) dir) #o644))
+ (progn (copy-directory file-path dir t t t)
+ (set-file-modes dir #o755))))
(quelpa-build--dump new-stamp-info stamp-file)
(quelpa-file-version file-path type version time-stamp))))
@@ -1369,10 +1371,13 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
(cond
((file-regular-p file)
(quelpa-build--message "%s -> %s" file newname)
- (copy-file file newname))
+ (copy-file file newname)
+ (set-file-modes newname #o644))
((file-directory-p file)
(quelpa-build--message "%s => %s" file newname)
- (copy-directory file newname))))
+ (make-directory newname)
+ (set-file-modes newname #o755)
+ (map quelpa-build--copy-file (directory-files file t)))))
(defun quelpa-build--find-source-file (target files)
"Search for source of TARGET in FILES."
@@ -1463,6 +1468,7 @@ Returns the archive entry for the package."
(if (file-exists-p pkg-target)
(quelpa-build--message "Skipping rebuild of %s" pkg-target)
(copy-file pkg-source pkg-target)
+ (set-file-modes pkg-target #o644)
(let ((enable-local-variables nil)
(make-backup-files nil))
(with-temp-buffer
@@ -1566,7 +1572,8 @@ attribute with an URL like \"http://domain.tld/path/to/file.el\"."
(unless (string= (file-name-extension url) "el")
(error "<%s> does not end in .el" url))
(unless (file-directory-p dir)
- (make-directory dir))
+ (make-directory dir)
+ (set-file-modes dir #o755))
(url-copy-file url local-path t)
(quelpa-check-hash name config local-path dir 'url)))
|