-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix subvolume paths with a / everywhere, #41
Conversation
What is left to do:
I don't know how to continue from here. @csirac2 could you help me with those points? Feel free to just push new commits to the branch. I started to use this branch now for my purposes and see how it turns out in pratice. |
Happy to help, will take a look next weekend :) |
Thanks! I'll report whether my code set my backups on fire in the meantime. 😉 |
22e4318
to
5d22f20
Compare
I think I managed to fix the tests with their now helpful output, but travis doesn't manage to build stuff today, I guess I'll try again tomorrow. |
glob2grep_file() { | ||
FILE=$1 | ||
OUT=$(mktemp) | ||
|
||
# check if every line starts with either / or *, if not it's a syntax error. | ||
while read -r line; do | ||
if ! [[ "$line" =~ ^[/\*].* ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing because [[ =~ is a bash-ism, but we are a #/bin/sh script ;-)
Perhaps try something like
if ! grep '^[/\*]' "$1"; then
echo "SYNTAX ERROR: $1 contains lines that start with neither / nor *." >&2
exit 12
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests should pass on Travis once we remove the [[ =~
"bash-isms" - see comment
794aeec
to
be20ad1
Compare
I now settled with
which really seems to work! Just a little headbanging on strange erors like „grep cannot be found“ was required to get to the Should have run shellcheck by myself to rule this out, sorry. 😆 |
Regarding the doubled SYNTAX ERROR, I now understand why it's happening, the functions which use glob2grep_file use it as subprocesses and don't check an exit value from glob2grep, so they just continue, as well as their processes… 😞 Is there a nicer way to do this than ripple the exit status up until the parent snazzer process? |
Found a way to cleanly fix the SYNTAX ERROR problem, but now the tests fail again. :/ investigating… |
hooray, things fixed. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Whoops! I noticed after I accepted the merge that it's still WIP... let me know if it really wasn't ready yet |
I still want to extend the tests a little to cover more of this new functionality. Other than that, doing a 0.1 release of the master branch before merging this is the only thing left to do. 😉 Is there anything you want in the 0.1 release that's not already in, or can I start with release preparation (on a different branch)? |
I've just done some gardening of the milestones here, please assign issues you want released in 0.1 to the 0.1 release milestone: https://github.com/csirac2/snazzer/milestones The only one I really had my heart set on was #22 - I've moved some of the annoying bugs to "0.6", these were bugs had planned to have fixed in a first release but I don't want them to stop you doing the important work of rolling a first release :) I would like to see a TODO or ISSUES.txt in the release with the unresolved issues listed. Perhaps I can work on that and #22 this weekend. |
I'd prefer to have this in 0.1, as this might attract more people to using snazzer. Also, #47 will be easier to work out with this included. But I'm not sure, just breaking the old config files without at least releasing a version… maybe we should tag the current state of the git repository as some kind of |
Yes, we should tag before merging this in. 0.0.1 is fine. Please feel free to use the milestone feature to assign this PR to 0.1 |
95c7180
to
4093f28
Compare
Finished! 😄 This is everything I wanted to do in this PR. From my side, this could be merged after #51 was completed. |
Excellent work! Just made a one-char typo fix. Happy to accept this once #51 is merged. I'd better get my |
Thanks! 😉 |
97cf626
to
a888ee3
Compare
by which it was possible to generalize mountpoint handling and exclude the mountpoint as subvolume to snapshot if wanted.
tests still fail, though.
a888ee3
to
3632b2b
Compare
by which it was possible to generalize mountpoint handling
and exclude the mountpoint as subvolume to snapshot if wanted.
Resolves #38.