1
Description: Don't try to parse a string that can be translated to determine encryption
2
Author: Michael Terry <michael.terry@canonical.com>
3
Bug: https://bugs.launchpad.net/deja-dup/+bug/877631
4
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/deja-dup/+bug/877631
6
Index: deja-dup-21.1/common/Duplicity.vala
7
===================================================================
8
--- deja-dup-21.1.orig/common/Duplicity.vala 2011-10-20 12:28:51.000000000 -0400
9
+++ deja-dup-21.1/common/Duplicity.vala 2011-11-03 17:31:21.790069746 -0400
11
static File slash_root;
12
static File slash_home;
13
static File slash_home_me;
14
+ static Regex gpg_regex;
16
bool has_checked_contents = false;
17
bool has_non_home_contents = false;
19
slash_home = File.new_for_path("/home");
20
slash_home_me = File.new_for_path(Environment.get_home_dir());
23
+ if (gpg_regex == null) {
25
+ gpg_regex = new Regex(".*\\[.*\\.(g|gpg)'.*]$");
28
+ error("%s\n", e.message); // this is a programmer error, so use error()
34
@@ -1108,16 +1118,13 @@
35
if (firstline.length > 1) {
36
switch (int.parse(firstline[1])) {
38
- // In non-modern versions of duplicity, this list of files is the only
39
- // way to tell whether the backup is encrypted or not. This message
40
- // was not translated in duplicity before switching to a better method
41
- // of detecting, so we can safely check for it.
42
if (mode == Operation.Mode.STATUS &&
43
!DuplicityInfo.get_default().reports_encryption &&
44
- !detected_encryption &&
45
- text.has_prefix("Extracting backup chains from list of files:")) {
46
- detected_encryption = true;
47
- existing_encrypted = text.contains(".gpg'") || text.contains(".g'");
48
+ !detected_encryption) {
49
+ if (gpg_regex != null && gpg_regex.match(text)) {
50
+ detected_encryption = true;
51
+ existing_encrypted = true;