[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH v2 5/7] quilt.el: Make quilt-patches-directory return
From: |
Ondřej Lysoněk |
Subject: |
[Quilt-dev] [PATCH v2 5/7] quilt.el: Make quilt-patches-directory return per-project setting |
Date: |
Sat, 30 May 2020 18:17:22 +0200 |
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>
---
lib/quilt.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
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 ()
--
2.25.4
- [Quilt-dev] [PATCH v2 1/7] quilt.el: Fix documentation of quilt-pc-directory, Ondřej Lysoněk, 2020/05/30
- [Quilt-dev] [PATCH v2 2/7] quilt.el: Refactor config reading functions, Ondřej Lysoněk, 2020/05/30
- [Quilt-dev] [PATCH v2 3/7] Document that quilt loads /etc/quilt.quiltrc, Ondřej Lysoněk, 2020/05/30
- [Quilt-dev] [PATCH v2 4/7] quilt.el: Load /etc/quilt.quiltrc if ~/.quiltrc doesn't exist, Ondřej Lysoněk, 2020/05/30
- [Quilt-dev] [PATCH v2 5/7] quilt.el: Make quilt-patches-directory return per-project setting,
Ondřej Lysoněk <=
- [Quilt-dev] [PATCH v2 6/7] quilt.el: Fix quilt-editable when QUILT_PATCHES_PREFIX is set, Ondřej Lysoněk, 2020/05/30
- [Quilt-dev] [PATCH v2 7/7] quilt.el: Fix a typo in documentation, Ondřej Lysoněk, 2020/05/30