Skip to content
Snippets Groups Projects

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

Merged Imported Administrator requested to merge feature/file-hook-globbing into master
All threads resolved!

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

Checking pipeline status.

Merged by AdministratorAdministrator 3 years ago (Dec 28, 2021 4:14am UTC)

Merge details

  • Changes merged into master with 206e75c5.
  • Deleted the source branch.

Pipeline #142606 passed

Pipeline passed for 206e75c5 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Author Owner
      Resolved by Administrator

      a quick review of the changes looks good. I like your approach with trying to expand globs in getFile. I haven't had a chance to test this out yet, but would like to before merging

      By clayton craft on 2021-12-12T23:38:23

  • Administrator added 1 commit · Imported

    added 1 commit

    • 2bfcec2e - Use getFile for file hooks and always try to expand globs

    Compare with previous version

    By Johannes Marbach on 2021-12-14T19:36:47

  • Administrator added 1 commit · Imported

    added 1 commit

    • c4d3bffd - get(Hook)Files: Use getFile, handle globs and dirs

    Compare with previous version

    By Johannes Marbach on 2021-12-14T19:48:42

    • Author Owner
      Resolved by Administrator

      Can't review this because this in Go (:see_no_evil:) but I noticed that there is a file called main_test.go with some what seems to synthetic tests. Might be good idea to add some test there to verify new behaviour of changed function(s)?

      By Alexey Min on 2021-12-28T04:13:38

      Edited by Ghost User
  • Administrator resolved all threads · Imported

    resolved all threads

    By clayton craft on 2021-12-28T04:02:42

  • Administrator added 2 commits · Imported

    added 2 commits

    • 7a61e512 - 1 commit from branch postmarketOS:master
    • 206e75c5 - get(Hook)Files: Use getFile, handle globs and dirs (MR 14)

    Compare with previous version

    By clayton craft on 2021-12-28T04:11:56

  • Administrator approved this merge request · Imported

    approved this merge request

    By clayton craft on 2021-12-28T04:12:13

  • Administrator resolved all threads · Imported

    resolved all threads

    By clayton craft on 2021-12-28T04:13:41

  • Administrator merged · Imported

    merged

  • Author Owner

    tested in qemu, with and without osk-sdl, and extracted the initfs by hand to spot check some paths, and it seems to get everything :smile: thanks @cherrypicker !

    By clayton craft on 2021-12-28T04:15:02

  • Please register or sign in to reply
    Loading