From 59731562031b28a0ec0006bfe22e78f8b57dc631 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 6 Sep 2024 15:27:08 +0200 Subject: [PATCH] Take input files into account when determining last-modified revision Some files are not distributed with the package but still affect the files that are. An texi manual for example may include another texi file that is not a manual in its own right, but if the included file is modified, that still effects the generated info file. --- package-build.el | 11 +++++++++++ package-recipe.el | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/package-build.el b/package-build.el index c057d6d..7ab3df4 100644 --- a/package-build.el +++ b/package-build.el @@ -1320,6 +1320,13 @@ order and can have the following form: returned alist. Files matched by later elements are not affected. +- (:inputs GLOB...) + + A list that begins with `:inputs' specifies files, which are not + to be included in the package, but when modified still trigger a + new package version. I.e., this function ignores this element, + but `package-build--spec-globs' does not. + - (:rename SRC DEST) A list that begins with `:rename' causes the file SRC to be @@ -1350,6 +1357,7 @@ SPEC is a full files spec as stored in a recipe object." (let (include exclude) (dolist (entry spec) (pcase (car-safe entry) + (:inputs) (:exclude (dolist (entry (cdr entry)) (push entry exclude))) @@ -1422,6 +1430,9 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs." ((and `(:exclude . ,globs) (guard (cl-every #'stringp globs))) (mapcan (lambda (g) (toargs g t)) globs)) + ((and `(:inputs . ,globs) + (guard (cl-every #'stringp globs))) + (mapcan #'toargs globs)) ((and `(,dir . ,globs) (guard (stringp dir)) (guard (cl-every #'stringp globs))) diff --git a/package-recipe.el b/package-recipe.el index ce3b2f8..88c5c94 100644 --- a/package-recipe.el +++ b/package-recipe.el @@ -201,13 +201,14 @@ file is invalid, then raise an error." (when (eq (car spec) :defaults) (setq spec (cdr spec))) ;; All other elements have to be strings or lists of strings. - ;; A list whose first element is `:exclude' is also valid. + ;; Lists whose first element is `:exclude' or `:inputs' are + ;; also valid. (dolist (entry spec) (unless (cond ((stringp entry) (not (equal entry "*"))) ((listp entry) (and-let* ((globs (cdr entry))) - (and (or (eq (car entry) :exclude) + (and (or (memq (car entry) '(:exclude :inputs)) (stringp (car entry))) (seq-every-p (lambda (glob) (and (stringp glob)