fix: better align "main" file detection with package-build

This commit is contained in:
riscy 2020-10-17 15:00:16 -07:00
parent d693294c68
commit 32a976753b

View file

@ -248,8 +248,13 @@ def _main_file(files: List[str], recipe: str) -> str:
try:
return next(
el
# the code in #'package-build--build-multi-file-package that
# determines the 'main' file is not quite exposed but it first
# looks for name-pkg.el, then name-pkg.el.in, and then name.el,
# which happens to match sorted() order:
for el in sorted(files)
if os.path.basename(el) == f"{name}-pkg.el"
or os.path.basename(el) == f"{name}-pkg.el.in"
or os.path.basename(el) == f"{name}.el"
)
except StopIteration: