Skip to content

get(Hook)Files: handle globs and recurse into directories

Administrator requested to merge feature/file-hook-globbing into master

This MR includes three changes:

  1. Use getFile in getHookFiles to add the contents of file hooks
  2. Within getFile, first attempted a glob expansion on the specified file expression. This allows specifying e.g. /lib/udev/rules.d/*.rules.
  3. Within getFile, next if the path points to a directory, add all files including those from subdirectories. This allows specifying e.g. /usr/share/X11/xkb.

The extra features of getFile could also be leveraged to shorten some of the other code that currently calls this function. I didn't do this for now to keep the diff small for the sake of review.

The original version of the MR (which did 2. but only in getHookFiles) is still retained in the first commit. If the approach is agreed upon, I'll squash the commits.

Edited by Administrator

Merge request reports

Loading