csirac2 / snazzer

btrfs snapshotting and backup system offering snapshot measurement, transport and pruning.
BSD 2-Clause "Simplified" License
89 stars 9 forks source link

take exclude lines for whole file path #31

Closed florianjacob closed 7 years ago

florianjacob commented 8 years ago

Because the usage of grep -f, each line inside /etc/snazzer/exclude.patterns currently behaves like it would have been surrounded by _-globs, making tmp essentially the same as _tmp*.

I think this current behaviour is inconsistent with the exclude patterns of du and tar and this change would make it consistent, but I'm not sure. Would fix #30.

This change should be backwards-compatible in all cases, except when people had lines like tmp but expected them to be evaluated as *tmp*. Maybe the manpage mention of .snapshots would need to be updated as well.

florianjacob commented 8 years ago

Note: Prior to #29, this was not possible. The implicit surrounding *s were required to ignore the other columns of output from the subvolume list. Planned well in advance. :wink:

csirac2 commented 8 years ago

I'm very grateful for these PRs, thanks again! Do you have a few minutes to update https://github.com/csirac2/snazzer/blob/master/tests/fixtures.sh#L11 to include tmp1234 as an example subvol in the tests? I realize now that I've written the tests in https://github.com/csirac2/snazzer/blob/master/tests/snazzer-list.bats to be a little bit too magical for easy maintenance... I can give it a go if you haven't peeked into the tests yet

florianjacob commented 8 years ago

Ok, so that behaviour was not intentional, I wasn't shure. :wink:

I did not take a look at the tests so far, as I have no experience with bats or with „serious“ as in non-throwaway bash programming – but I'll do that on saturday, together with the manpage.

csirac2 commented 7 years ago

I've fixed some general brokenness with the tests, although it's still a bit sad, and the test suite now passes with your commit (so they're currently failing: 57 tests, 6 failures).

If you have a doc tweak to add, that's all that remains, otherwise we can merge/close this.

florianjacob commented 7 years ago

Cool! See my new commit for documentation tweak proposal.

csirac2 commented 7 years ago

Merged. I've added a Makefile which (1) I hope will allow future contributors to run tests more easily, (2) knows how to rebuild the markdown & man page docs, feedback welcome :)

florianjacob commented 7 years ago

Good idea! :smile: This could also help downstream package mantainers like the snazzer AUR package to ease their installation scripts.