构建包给出:单个文件模板与包名称不匹配

Building a package gives: Single file templates does not match package name

我想更新一个原来是单个文件的包。现在,它包含一个包含一些文件的目录。

原来的食谱是:(tikz :repo "emiliotorres/tikz" :fetcher github) 而且根据this,我觉得新版本一定是(tikz :repo "emiliotorres/tikz" :fetcher github :files ("templates/*.el" "templates")) .

我把新版的emiliotorres/tikz复制到本地的melpa/package-build和

make -k recipes/tikz

我收到这个错误

 • Building package tikz ...
Package: tikz
Fetcher: github
Source:  https://github.com/emiliotorres/tikz.git
Updating /home/emilio/temp/melpa2/working/tikz/
Single file templates does not match package name tikz
make: [Makefile:111: recipes/tikz] Error 255 (no tiene efecto)

你能给我一些提示吗?

谢谢!

根据链接 Melpa Readme,以下配置应将整个目录 templates 包含到包中:

(tikz :repo "emiliotorres/tikz"
      :fetcher github
      :files ("tikz.el" "templates"))

另一种方法,最终由 OP 选择,也记录在 MELPA 自述文件中:

If your package requires some additional files, but is otherwise fine with the defaults, it's recommended to use the special element :defaults as the very first element of the :files list, which causes the default value shown above to be prepended to the specified file list. For example :files (:defaults "snippets") would cause the "snippets" subdir to be copied in addition to the defaults.

因此,在问题的上下文中:

(tikz :repo "emiliotorres/tikz"
      :fetcher github
      :files (:defaults "templates"))