From d5661f1f1996a893fbcbacb4d290c57acab4fb0e Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Fri, 6 Sep 2024 17:52:59 +0200 Subject: [PATCH] Fix renaming files explicitly --- package-build.el | 3 +++ package-recipe.el | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package-build.el b/package-build.el index 7ab3df4..f09a4ea 100644 --- a/package-build.el +++ b/package-build.el @@ -1433,6 +1433,9 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs." ((and `(:inputs . ,globs) (guard (cl-every #'stringp globs))) (mapcan #'toargs globs)) + ((and `(:rename ,src ,dest) + (guard (and (stringp src) (stringp dest)))) + (toargs src)) ((and `(,dir . ,globs) (guard (stringp dir)) (guard (cl-every #'stringp globs))) diff --git a/package-recipe.el b/package-recipe.el index 88c5c94..8c3900e 100644 --- a/package-recipe.el +++ b/package-recipe.el @@ -201,14 +201,15 @@ 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. - ;; Lists whose first element is `:exclude' or `:inputs' are - ;; also valid. + ;; Lists whose first element is `:exclude', `:inputs' or + ;; `:rename' are also valid. (dolist (entry spec) (unless (cond ((stringp entry) (not (equal entry "*"))) ((listp entry) (and-let* ((globs (cdr entry))) - (and (or (memq (car entry) '(:exclude :inputs)) + (and (or (memq (car entry) + '(:exclude :inputs :rename)) (stringp (car entry))) (seq-every-p (lambda (glob) (and (stringp glob)