fix #148 #149
No reviewers
Labels
No labels
bug
bullseye
discussion
duplicate
enhancement
help wanted
invalid
question
suggestion
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: evolix/evocheck#149
Loading…
Reference in a new issue
No description provided.
Delete branch "148"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In check_evobackup_exclude_mount function, add support for new rsync
syntax introduced in evobackup 22.12.
Looks good to me!
@ -544,1 +544,3 @@
grep -- "--exclude " "${evobackup_file}" | grep -E -o "\"[^\"]+\"" | tr -d '"' > "${excludes_file}"
# XXX old release of evobackups don't have version and verions over 22.12 use new syntax to exclude rsync file
if grep -q "^VERSION=" "${evobackup_file}" && test $( sed -E -n 's/VERSION="(.*)"/\1/p' "${evobackup_file}" | tr -d . ) -ge 2212 ; then
sed -n '/RSYNC_EXCLUDES="/,/"/p' "${evobackup_file}" | sed '1d;$d' > "${excludes_file}"
This won't work in some edge cases, for example with:
RSYNC_EXCLUDES="/foo
/foo"
I suggest you use
sed -En '/RSYNC_EXCLUDES="/,/"/ {s/(RSYNC_EXCLUDES=|")//g;p}'
instead.I fixed and I pushed.
1a832b9bdd
toeb9d4875be
Hi,
On line 545, I would split the 2 tests.
I would keep the test on evobackup version in the main "if". Then inside this condition I would store the value of the version in a variable, then I would add an "if" on version number.
To compare version numbers, on Debian we can do this with
dpkg --compare-versions
d431c3d95f
tob31f69a380
b31f69a380
tob3db84a8f7
And this proposal broke the check (as described in #150) it would have been great to actually check on really old evobackup versions before implementing this.
The logic needed to either be duplicated or the check sould have been kept in a single
if
.As a reminder for future references, long condition chains can be separated in multiple lines if necessary.