Skip to content

fix: packages with directories under :files spec in their recipes fail

steckerhalter requested to merge #106 into master

Created by: vyp

to install with the file fetcher

This happened because package-build--expand-source-file-list does not expand directory listings (under :files in a recipe) into its contents (i.e. its filenames), which was the original assumption.

This meant that package-build--slurp-file would attempt to insert-file-contents on a directory, hence causing the (example) error:

Quelpa: failed to checkout `nyan-mode': `Read error: is a directory,
/home/u/sc/el/nyan-mode/img'

The fix here is to replace any directory listings that package-build--expand-source-file-list gives into its contents (i.e. a list of filenames located in the directory) recursively. quelpa-expand-source-file-list is the new function that does this, with quelpa-directory-files being a recursive helper function to traverse the filesystem.

Additionally, quelpa-slurp-file replaces usage of package-build--slurp-file because I think it is likely better suited to handle (potentially) binary files, because directory listings in recipes (under :files) usually involve distribution of binary files. I am not 100% sure if it is any better than package-build--slurp-file though.

Closes #106 (closed).

Merge request reports