summaryrefslogtreecommitdiffstats
path: root/lib/quilt.el
diff options
context:
space:
mode:
authorOndřej Lysoněk <olysonek@redhat.com>2020-06-09 15:12:43 +0200
committerJean Delvare <jdelvare@suse.de>2020-06-09 15:12:43 +0200
commitd7cdaacef18ea41dedb959a15d26c13acf8f689d (patch)
tree624c748c94d7bea4f39b7427e6d10949f9af2a7b /lib/quilt.el
parent3e1648a7f6d88a725a262f7334f14663aff478a4 (diff)
downloadquilt-d7cdaacef18ea41dedb959a15d26c13acf8f689d.tar.gz
quilt.el: Make quilt-patches-directory return per-project setting
When creating the .pc/ directory, quilt writes the value of QUILT_PATCHES to .pc/.quilt_patches. On all subsequent invocations, quilt uses the contents of .pc/.quilt_patches as the value of QUILT_PATCHES, rather than the value set in quiltrc. All the callers in quilt.el really expect the per-project setting from .pc/.quilt_patches, so return the value set therein if present. Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com> Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'lib/quilt.el')
-rw-r--r--lib/quilt.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/quilt.el b/lib/quilt.el
index ca55980..fb6df35 100644
--- a/lib/quilt.el
+++ b/lib/quilt.el
@@ -48,9 +48,20 @@
(kill-buffer (current-buffer))))
(getenv var)))
+(defun quilt--per-project-patches-directory ()
+ (let ((qd (quilt-dir)))
+ (if qd
+ (let ((project-config (concat qd "/"
+ (quilt-pc-directory) "/.quilt_patches")))
+ (if (file-readable-p project-config)
+ (with-temp-buffer
+ (insert-file-contents-literally project-config)
+ (substring (buffer-string) 0 -1)))))))
+
(defun quilt-patches-directory ()
"Return the location of patch files."
- (or (quilt--get-config-variable "QUILT_PATCHES")
+ (or (quilt--per-project-patches-directory)
+ (quilt--get-config-variable "QUILT_PATCHES")
"patches"))
(defun quilt-pc-directory ()