Skip to content
Snippets Groups Projects
Commit f7f20cd4 authored by intrigeri's avatar intrigeri
Browse files

Support duplicity >= 0.4.3 invocation syntax

parent 5cda2e3c
Branches
No related tags found
No related merge requests found
...@@ -14,6 +14,9 @@ version 0.9.5 -- unreleased ...@@ -14,6 +14,9 @@ version 0.9.5 -- unreleased
toint function sometimes) toint function sometimes)
. Fixed reportspace option (Trac#10) . Fixed reportspace option (Trac#10)
handler changes handler changes
dup:
. Support duplicity >= 0.4.3 invocation syntax (--ssh-command option
is not supported anymore)
ldap: ldap:
. Fixed shell command quoting issues, missing 'then' clauses, cleaned up . Fixed shell command quoting issues, missing 'then' clauses, cleaned up
compress=yes to be less redundant and not create empty uncompressed file compress=yes to be less redundant and not create empty uncompressed file
......
...@@ -70,22 +70,37 @@ fi ...@@ -70,22 +70,37 @@ fi
### COMMAND-LINE MANGLING ### ### COMMAND-LINE MANGLING ###
# duplicity >= 0.4.2 needs --sftp-command (NB: sftp does not support the -l option)
duplicity_version="`duplicity --version | @AWK@ '{print $2}'`" duplicity_version="`duplicity --version | @AWK@ '{print $2}'`"
duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`" duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`"
duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`" duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`"
duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`" duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`"
if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -ge 2 ]; then
sftpoptions="$sshoptions" # 1. duplicity >= 0.4.2 needs --sftp-command (NB: sftp does not support the -l option)
fi # 2. duplicity >= 0.4.3 replaces --ssh-command with --ssh-options, which:
# - is passed to scp and sftp commands by duplicity
# - has a special syntax we can not feed the command line with
# so we don't use it: since this version does not use the ssh command anymore,
# we keep compatibility with our previous config files by passing $sshoptions to
# --scp-command and --sftp-command ourselves
scpoptions="$sshoptions" scpoptions="$sshoptions"
[ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit" [ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit"
if [ -z "$sftpoptions" ]; then execstr="$options --no-print-statistics "
execstr="$options --no-print-statistics --scp-command 'scp $scpoptions' --ssh-command 'ssh $sshoptions' "
# < 0.4.2 : only uses ssh and scp
if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -le 2 ]; then
execstr="$execstr --scp-command 'scp $scpoptions' --ssh-command 'ssh $sshoptions' "
# >= 0.4.2 : also uses sftp, --sftp-command option is now supported
else else
execstr="$options --no-print-statistics --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions' --ssh-command 'ssh $sshoptions' " sftpoptions="$sshoptions"
# == 0.4.2 : uses ssh, scp and sftp
if [ "$duplicity_major" -eq 0 -a "$duplicity_minor" -eq 4 -a "$duplicity_sub" -eq 2 ]; then
execstr="$execstr --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions' --ssh-command 'ssh $sshoptions' "
# >= 0.4.3 : uses only scp and sftp, --ssh-command option is not supported anymore
else
execstr="$execstr --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions' "
fi
fi fi
# deal with symmetric or asymmetric (public/private key pair) encryption # deal with symmetric or asymmetric (public/private key pair) encryption
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment