Skip to content

Commit

Permalink
Take input files into account when determining last-modified revision
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tarsius committed Sep 6, 2024
1 parent faa983c commit 5973156
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions package-build.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -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)))
Expand Down
5 changes: 3 additions & 2 deletions package-recipe.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5973156

Please sign in to comment.