diff options
author | intrigeri <intrigeri@boum.org> | 2014-02-22 14:21:19 +0000 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2014-02-22 14:23:22 +0000 |
commit | 1017ec315fe2b5550908abd9f1f4f9e5edb0bd9d (patch) | |
tree | fc9cc8d55498aa2583c13cd6d6e83a4b7a0abc3c | |
parent | 0e6df840b65267f9a668f5e987f5adec8535d70b (diff) | |
download | backupninja-1017ec315fe2b5550908abd9f1f4f9e5edb0bd9d.tar.gz backupninja-1017ec315fe2b5550908abd9f1f4f9e5edb0bd9d.tar.bz2 |
dup: Fix buggy version comparison. (Redmine#6746)
-rw-r--r-- | handlers/dup.in | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/handlers/dup.in b/handlers/dup.in index 18afb98..41364d2 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -117,13 +117,10 @@ fi ### duplicity version (ignore anything else than 0-9 and ".") duplicity_version="`duplicity --version | @AWK@ '{print $2}' | @SED@ 's/[^.[:digit:]]//g'`" -duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`" -duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`" -duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`" ### ssh/scp/sftp options (duplicity < 0.4.3 is unsupported) ## duplicity >= 0.6.17 : paramiko backend -if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 17 ]; then +if version_ge "$duplicity_version" '0.6.17'; then if [ -n "$sshoptions" ]; then if echo "$sshoptions" | grep -Eqs '^-o[[:space:]]*IdentityFile=[^ ]+$' ; then spaceless_sshoptions="$(echo -n "$sshoptions" | @SED@ 's/^-o[[:space:]]*/-o/')" @@ -191,7 +188,7 @@ else fi ### Cleanup options -if ! [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 20 ]; then +if ! version_ge "$duplicity_version" '0.6.20'; then execstr_options="${execstr_options} --extra-clean" fi @@ -323,7 +320,7 @@ fi # remove-all-inc-of-but-n-full : remove increments of older full backups : only keep latest ones if [ "$keep" != "yes" ]; then if [ "$keepincroffulls" != "all" ]; then - if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 10 ]; then + if version_ge "$duplicity_version" '0.6.10'; then debug "$execstr_precmd duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password |