commit f4d8fa484baca111338fd12bf94995a48d745917
Author: Jonathan Dupart <jonathan@dupart.org>
Date:   Tue Jan 21 20:43:35 2014 +0100

    dup: prefix every call to duplicity with LC_ALL=C
    
    When used with gpg encryption and a non-C locale duplicity can fail on
    characters outside ascii set in gpg output.
    
    duplicity bug details are explained here :
    https://bugs.launchpad.net/duplicity/+bug/510625

diff --git a/handlers/dup.in b/handlers/dup.in
index a67848f..2634916 100644
--- a/handlers/dup.in
+++ b/handlers/dup.in
@@ -116,7 +116,7 @@ else
 fi
 
 ### duplicity version (ignore anything else than 0-9 and ".")
-duplicity_version="`duplicity --version | @AWK@ '{print $2}' | @SED@ 's/[^.[:digit:]]//g'`"
+duplicity_version="`LC_ALL=C 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}'`"
@@ -281,13 +281,13 @@ fi
 ### Cleanup commands (duplicity >= 0.4.4)
 
 # cleanup
-debug "$execstr_precmd duplicity cleanup --force $execstr_options $execstr_serverpart"
+debug "$execstr_precmd LC_ALL=C duplicity cleanup --force $execstr_options $execstr_serverpart"
 if [ ! $test ]; then
    export PASSPHRASE=$password
    export FTP_PASSWORD=$ftp_password
    output=`nice -n $nicelevel \
              su -c \
-             "$execstr_precmd duplicity cleanup --force $execstr_options $execstr_serverpart 2>&1"`
+             "$execstr_precmd LC_ALL=C duplicity cleanup --force $execstr_options $execstr_serverpart 2>&1"`
    exit_code=$?
    if [ $exit_code -eq 0 ]; then
       debug $output
@@ -300,13 +300,13 @@ fi
 
 # remove-older-than
 if [ "$keep" != "yes" ]; then
-   debug "$execstr_precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart"
+   debug "$execstr_precmd LC_ALL=C duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart"
    if [ ! $test ]; then
       export PASSPHRASE=$password
       export FTP_PASSWORD=$ftp_password
       output=`nice -n $nicelevel \
                 su -c \
-                "$execstr_precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart 2>&1"`
+                "$execstr_precmd LC_ALL=C duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart 2>&1"`
       exit_code=$?
       if [ $exit_code -eq 0 ]; then
          debug $output
@@ -322,13 +322,13 @@ fi
 if [ "$keep" != "yes" ]; then
    if [ "$keepincroffulls" != "all" ]; then
       if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 10 ]; then
-         debug "$execstr_precmd duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart"
+         debug "$execstr_precmd LC_ALL=C duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart"
          if [ ! $test ]; then
             export PASSPHRASE=$password
             export FTP_PASSWORD=$ftp_password
             output=`nice -n $nicelevel \
                su -c \
-               "$execstr_precmd duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart 2>&1"`
+               "$execstr_precmd LC_ALL=C duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart 2>&1"`
             exit_code=$?
             if [ $exit_code -eq 0 ]; then
                debug $output
@@ -343,14 +343,14 @@ if [ "$keep" != "yes" ]; then
 fi
 
 ### Backup command
-debug "$execstr_precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart"
+debug "$execstr_precmd LC_ALL=C duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart"
 if [ ! $test ]; then
    outputfile=`maketemp backupout`
    export PASSPHRASE=$password
    export FTP_PASSWORD=$ftp_password
    output=`nice -n $nicelevel \
              su -c \
-                "$execstr_precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart >$outputfile 2>&1"`
+                "$execstr_precmd LC_ALL=C duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart >$outputfile 2>&1"`
    exit_code=$?
    debug $output
    cat $outputfile | (while read output ; do
