Merge lp:~mterry/deja-dup/nag into lp:deja-dup/24

Proposed by Michael Terry
Status: Merged
Merged at revision: 1379
Proposed branch: lp:~mterry/deja-dup/nag
Merge into: lp:deja-dup/24
Prerequisite: lp:~mterry/deja-dup/verify
Diff against target: 1485 lines (+521/-156)
14 files modified
common/CommonUtils.vala (+50/-3)
common/Operation.vala (+18/-7)
common/OperationVerify.vala (+24/-0)
common/ToolPlugin.vala (+1/-0)
data/org.gnome.DejaDup.gschema.xml.in (+6/-1)
deja-dup/Assistant.vala (+13/-3)
deja-dup/AssistantBackup.vala (+4/-1)
deja-dup/AssistantOperation.vala (+118/-22)
po/deja-dup.pot (+156/-108)
tests/runner/mock/duplicity (+12/-0)
tests/runner/runner.vala (+39/-9)
tests/scripts/nag.test (+58/-0)
tools/duplicity/DuplicityInstance.vala (+4/-1)
tools/duplicity/DuplicityJob.vala (+18/-1)
To merge this branch: bzr merge lp:~mterry/deja-dup/nag
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve
Ken VanDine Pending
Review via email: mp+120312@code.launchpad.net

Description of the change

Adds a nag page to occasionally test the verify check without any cache/saved-passwords.

To test:

test/interactive
deja-dup-preferences (set up as needed)
gsettings set org.gnome.DejaDup nag-check '1970-01-01T00:32:08.916885Z'
deja-dup --backup

To post a comment you must log in.
Revision history for this message
Robert Bruce Park (robru) wrote :

The nag screen looks good, but after verifying the backup it just disappears, it does not give any indication of whether the verification was successful or not. The window should stay open and then say whether it was successful or not, and then allow the user to acknowledge and close the window.

review: Needs Fixing
Revision history for this message
Robert Bruce Park (robru) wrote :

Also, why did you delete that .pot file? Seems unrelated to the rest of this branch, kinda sloppy.

lp:~mterry/deja-dup/nag updated
1379. By Michael Terry

add back dropped pot file, whoops

1380. By Michael Terry

leave window up when we just tested the restore and asked for the password

1381. By Michael Terry

merge from trunk

1382. By Michael Terry

uncomment deleting the test directory; that wasn't supposed to be committed

1383. By Michael Terry

same for dropping valac-0.18 support

1384. By Michael Terry

try again to fix deja-dup.pot

Revision history for this message
Michael Terry (mterry) wrote :

OK, now the window stays up on successful backup+nag. On error, an error window will appear, as it would before.

As for the deja-dup.pot file, it was an accidental deletion. I tried to update it, not delete it, but apparently screwed that up.

Revision history for this message
Robert Bruce Park (robru) wrote :

Looks good now!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'common/CommonUtils.vala'
--- common/CommonUtils.vala 2012-06-21 15:45:56 +0000
+++ common/CommonUtils.vala 2012-08-21 01:36:28 +0000
@@ -30,6 +30,7 @@
30public const string LAST_BACKUP_KEY = "last-backup";30public const string LAST_BACKUP_KEY = "last-backup";
31public const string LAST_RESTORE_KEY = "last-restore";31public const string LAST_RESTORE_KEY = "last-restore";
32public const string PROMPT_CHECK_KEY = "prompt-check";32public const string PROMPT_CHECK_KEY = "prompt-check";
33public const string NAG_CHECK_KEY = "nag-check";
33public const string PERIODIC_KEY = "periodic";34public const string PERIODIC_KEY = "periodic";
34public const string PERIODIC_PERIOD_KEY = "periodic-period";35public const string PERIODIC_PERIOD_KEY = "periodic-period";
35public const string DELETE_AFTER_KEY = "delete-after";36public const string DELETE_AFTER_KEY = "delete-after";
@@ -209,11 +210,11 @@
209 run_deja_dup("--prompt");210 run_deja_dup("--prompt");
210}211}
211212
212public void update_prompt_time(bool cancel = false)213private void update_time_key(string key, bool cancel)
213{214{
214 var settings = DejaDup.get_settings();215 var settings = DejaDup.get_settings();
215216
216 if (settings.get_string(PROMPT_CHECK_KEY) == "disabled")217 if (settings.get_string(key) == "disabled")
217 return; // never re-enable218 return; // never re-enable
218219
219 string cur_time_str;220 string cur_time_str;
@@ -226,7 +227,53 @@
226 cur_time_str = cur_time.to_iso8601();227 cur_time_str = cur_time.to_iso8601();
227 }228 }
228229
229 settings.set_string(PROMPT_CHECK_KEY, cur_time_str);230 settings.set_string(key, cur_time_str);
231}
232
233public void update_prompt_time(bool cancel = false)
234{
235 update_time_key(PROMPT_CHECK_KEY, cancel);
236}
237
238public void update_nag_time(bool cancel = false)
239{
240 update_time_key(NAG_CHECK_KEY, cancel);
241}
242
243// In seconds
244public int get_nag_delay()
245{
246 TimeSpan span = 0;
247 if (DejaDup.in_testing_mode())
248 span = TimeSpan.MINUTE * 2;
249 else
250 span = TimeSpan.DAY * 30 * 2;
251 return (int)(span / TimeSpan.SECOND);
252}
253
254// This makes the check of whether we should remind user about their password.
255public bool is_nag_time()
256{
257 var settings = DejaDup.get_settings();
258 var nag = settings.get_string(NAG_CHECK_KEY);
259 var last_run_string = last_run_date(TimestampType.BACKUP);
260
261 if (nag == "disabled" || last_run_string == "")
262 return false;
263 else if (nag == "") {
264 update_nag_time();
265 return false;
266 }
267
268 TimeVal last_check_tval = TimeVal();
269 if (!last_check_tval.from_iso8601(nag))
270 return false;
271
272 var last_check = new DateTime.from_timeval_local(last_check_tval);
273 last_check = last_check.add_seconds(get_nag_delay());
274
275 var now = new DateTime.now_local();
276 return (last_check.compare(now) <= 0);
230}277}
231278
232public string get_folder_key(SimpleSettings settings, string key)279public string get_folder_key(SimpleSettings settings, string key)
233280
=== modified file 'common/Operation.vala'
--- common/Operation.vala 2012-08-13 19:59:00 +0000
+++ common/Operation.vala 2012-08-21 01:36:28 +0000
@@ -41,6 +41,7 @@
41 public signal void question(string title, string msg);41 public signal void question(string title, string msg);
42 public signal void is_full(bool first);42 public signal void is_full(bool first);
4343
44 public bool use_cached_password {get; protected set; default = true;}
44 public bool needs_password {get; set;}45 public bool needs_password {get; set;}
45 public Backend backend {get; private set;}46 public Backend backend {get; private set;}
46 public bool use_progress {get {return (job.flags & ToolJob.Flags.NO_PROGRESS) == 0;}47 public bool use_progress {get {return (job.flags & ToolJob.Flags.NO_PROGRESS) == 0;}
@@ -91,6 +92,7 @@
91 protected string passphrase;92 protected string passphrase;
92 bool finished = false;93 bool finished = false;
93 string saved_detail = null;94 string saved_detail = null;
95 Operation chained_op = null;
94 construct96 construct
95 {97 {
96 backend = Backend.get_default();98 backend = Backend.get_default();
@@ -168,12 +170,18 @@
168170
169 public void cancel()171 public void cancel()
170 {172 {
171 job.cancel();173 if (chained_op != null)
174 chained_op.cancel();
175 else
176 job.cancel();
172 }177 }
173 178
174 public void stop()179 public void stop()
175 {180 {
176 job.stop();181 if (chained_op != null)
182 chained_op.stop();
183 else
184 job.stop();
177 }185 }
178 186
179 protected virtual void connect_to_job()187 protected virtual void connect_to_job()
@@ -246,23 +254,26 @@
246 * Sometimes an operation wants to chain to a separate operation.254 * Sometimes an operation wants to chain to a separate operation.
247 * Here is the glue to make that happen.255 * Here is the glue to make that happen.
248 */256 */
249 subop.ref();257 assert(chained_op == null);
258
259 chained_op = subop;
250 subop.done.connect((s, c, d) => {260 subop.done.connect((s, c, d) => {
251 done(s, c, combine_details(saved_detail, d));261 done(s, c, combine_details(saved_detail, d));
252 subop.unref();262 chained_op = null;
253 });263 });
254 subop.raise_error.connect((e, d) => {raise_error(e, d);});264 subop.raise_error.connect((e, d) => {raise_error(e, d);});
255 subop.progress.connect((p) => {progress(p);});265 subop.progress.connect((p) => {progress(p);});
256 subop.passphrase_required.connect(() => {266 subop.passphrase_required.connect(() => {
267 needs_password = true;
257 passphrase_required();268 passphrase_required();
258 subop.needs_password = needs_password;269 if (!needs_password)
259 subop.passphrase = passphrase;270 subop.set_passphrase(passphrase);
260 });271 });
261 subop.question.connect((t, m) => {question(t, m);});272 subop.question.connect((t, m) => {question(t, m);});
262273
274 use_cached_password = subop.use_cached_password;
263 saved_detail = combine_details(saved_detail, detail);275 saved_detail = combine_details(saved_detail, detail);
264 subop.set_state(get_state());276 subop.set_state(get_state());
265 job = subop.job;
266277
267 action_desc_changed(desc);278 action_desc_changed(desc);
268 progress(0);279 progress(0);
269280
=== modified file 'common/OperationVerify.vala'
--- common/OperationVerify.vala 2012-08-10 18:33:29 +0000
+++ common/OperationVerify.vala 2012-08-21 01:36:28 +0000
@@ -28,19 +28,40 @@
28{28{
29 File metadir;29 File metadir;
30 File destdir;30 File destdir;
31 bool nag;
3132
32 public OperationVerify() {33 public OperationVerify() {
33 Object(mode: ToolJob.Mode.RESTORE);34 Object(mode: ToolJob.Mode.RESTORE);
34 }35 }
3536
37 construct {
38 // Should we nag user about password, etc? What this really means is that
39 // we try to do our normal verification routine in as close an emulation
40 // to a fresh restore after a disaster as possible. So fresh cache, no
41 // saved password, etc. We do *not* explicitly unmount the backend,
42 // because we may not be the only consumers.
43 if (is_nag_time()) {
44 use_cached_password = false;
45 nag = true;
46 }
47 }
48
36 public async override void start(bool try_claim_bus = true)49 public async override void start(bool try_claim_bus = true)
37 {50 {
51 if (nag) {
52 var fake_state = new State();
53 fake_state.backend = backend.clone();
54 set_state(fake_state);
55 }
38 action_desc_changed(_("Verifying backup…"));56 action_desc_changed(_("Verifying backup…"));
39 yield base.start(try_claim_bus);57 yield base.start(try_claim_bus);
40 }58 }
4159
42 protected override void connect_to_job()60 protected override void connect_to_job()
43 {61 {
62 if (nag)
63 job.flags |= ToolJob.Flags.NO_CACHE;
64
44 string cachedir = Environment.get_user_cache_dir();65 string cachedir = Environment.get_user_cache_dir();
45 metadir = File.new_for_path(Path.build_filename(cachedir, Config.PACKAGE, "metadata"));66 metadir = File.new_for_path(Path.build_filename(cachedir, Config.PACKAGE, "metadata"));
46 job.restore_files.append(metadir);67 job.restore_files.append(metadir);
@@ -73,6 +94,9 @@
73 raise_error(_("Your backup appears to be corrupted. You should delete the backup and try again."), null);94 raise_error(_("Your backup appears to be corrupted. You should delete the backup and try again."), null);
74 success = false;95 success = false;
75 }96 }
97
98 if (nag)
99 update_nag_time();
76 }100 }
77101
78 new RecursiveDelete(metadir).start();102 new RecursiveDelete(metadir).start();
79103
=== modified file 'common/ToolPlugin.vala'
--- common/ToolPlugin.vala 2012-04-30 00:23:37 +0000
+++ common/ToolPlugin.vala 2012-08-21 01:36:28 +0000
@@ -55,6 +55,7 @@
5555
56 public enum Flags {56 public enum Flags {
57 NO_PROGRESS,57 NO_PROGRESS,
58 NO_CACHE,
58 }59 }
59 public Flags flags {get; set;}60 public Flags flags {get; set;}
6061
6162
=== modified file 'data/org.gnome.DejaDup.gschema.xml.in'
--- data/org.gnome.DejaDup.gschema.xml.in 2012-06-21 15:45:56 +0000
+++ data/org.gnome.DejaDup.gschema.xml.in 2012-08-21 01:36:28 +0000
@@ -47,9 +47,14 @@
47 </key>47 </key>
48 <key name="prompt-check" type="s">48 <key name="prompt-check" type="s">
49 <default>''</default>49 <default>''</default>
50 <_summary>The first time Déjà Dup checked whether it should prompt about backing up</_summary>50 <_summary>The last time Déjà Dup checked whether it should prompt about backing up</_summary>
51 <_description>When a user logs in, the Déjà Dup monitor checks whether it should prompt about backing up. This is used to increase discoverability for users that don’t know about backups. This time should be either ‘disabled’ to turn off this check or in ISO 8601 format.</_description>51 <_description>When a user logs in, the Déjà Dup monitor checks whether it should prompt about backing up. This is used to increase discoverability for users that don’t know about backups. This time should be either ‘disabled’ to turn off this check or in ISO 8601 format.</_description>
52 </key>52 </key>
53 <key name="nag-check" type="s">
54 <default>''</default>
55 <_summary>The last time Déjà Dup checked whether it should prompt about your password</_summary>
56 <_description>In order to prevent you from forgetting your passwords, Déjà Dup will occasionally notify you to confirm the password. This time should be either ‘disabled’ to turn off this check or in ISO 8601 format.</_description>
57 </key>
53 <key name="delete-after" type="i">58 <key name="delete-after" type="i">
54 <default>0</default>59 <default>0</default>
55 <_summary>How long to keep backup files</_summary>60 <_summary>How long to keep backup files</_summary>
5661
=== modified file 'deja-dup/Assistant.vala'
--- deja-dup/Assistant.vala 2012-08-06 22:41:13 +0000
+++ deja-dup/Assistant.vala 2012-08-21 01:36:28 +0000
@@ -39,7 +39,7 @@
39 public bool last_op_was_back {get; private set; default = false;}39 public bool last_op_was_back {get; private set; default = false;}
4040
41 public enum Type {41 public enum Type {
42 NORMAL, INTERRUPT, SUMMARY, PROGRESS, FINISH42 NORMAL, INTERRUPT, CHECK, SUMMARY, PROGRESS, FINISH
43 }43 }
4444
45 Gtk.Label header_title;45 Gtk.Label header_title;
@@ -165,6 +165,11 @@
165 go_forward();165 go_forward();
166 }166 }
167167
168 static bool is_interrupt_type(Type type)
169 {
170 return type == Type.INTERRUPT || type == Type.CHECK;
171 }
172
168 public void go_back()173 public void go_back()
169 {174 {
170 weak List<PageInfo> next;175 weak List<PageInfo> next;
@@ -172,7 +177,7 @@
172 next = interrupted.prev;177 next = interrupted.prev;
173 else {178 else {
174 next = current.prev;179 next = current.prev;
175 while (next != null && next.data.type == Type.INTERRUPT)180 while (next != null && is_interrupt_type(next.data.type))
176 next = next.prev;181 next = next.prev;
177 }182 }
178183
@@ -194,7 +199,7 @@
194 }199 }
195 else {200 else {
196 next = (current == null) ? infos : current.next;201 next = (current == null) ? infos : current.next;
197 while (next != null && next.data.type == Type.INTERRUPT)202 while (next != null && is_interrupt_type(next.data.type))
198 next = next.next;203 next = next.next;
199 }204 }
200205
@@ -309,6 +314,11 @@
309 forward_text = _("Co_ntinue");314 forward_text = _("Co_ntinue");
310 }315 }
311 break;316 break;
317 case Type.CHECK:
318 show_close = true;
319 show_forward = true;
320 forward_text = C_("verb", "_Test");
321 break;
312 case Type.PROGRESS:322 case Type.PROGRESS:
313 show_cancel = true;323 show_cancel = true;
314 show_resume = true;324 show_resume = true;
315325
=== modified file 'deja-dup/AssistantBackup.vala'
--- deja-dup/AssistantBackup.vala 2012-04-10 02:22:06 +0000
+++ deja-dup/AssistantBackup.vala 2012-08-21 01:36:28 +0000
@@ -91,8 +91,11 @@
91 else {91 else {
92 set_page_title(page, _("Backup Finished"));92 set_page_title(page, _("Backup Finished"));
9393
94 // Also leave ourselves up if we just finished a restore test.
95 if (nagged)
96 summary_label.label = _("Your files were successfully backed up and tested.");
94 // If we don't have a special message to show the user, just bail.97 // If we don't have a special message to show the user, just bail.
95 if (!detail_widget.get_visible())98 else if (!detail_widget.get_visible())
96 Idle.add(() => {do_close(); return false;});99 Idle.add(() => {do_close(); return false;});
97 }100 }
98 }101 }
99102
=== modified file 'deja-dup/AssistantOperation.vala'
--- deja-dup/AssistantOperation.vala 2012-08-06 22:41:13 +0000
+++ deja-dup/AssistantOperation.vala 2012-08-21 01:36:28 +0000
@@ -45,11 +45,14 @@
45 protected StatusIcon status_icon;45 protected StatusIcon status_icon;
46 protected bool succeeded = false;46 protected bool succeeded = false;
4747
48 Gtk.Entry nag_entry;
48 Gtk.Entry encrypt_entry;49 Gtk.Entry encrypt_entry;
49 Gtk.Entry encrypt_confirm_entry;50 Gtk.Entry encrypt_confirm_entry;
50 Gtk.RadioButton encrypt_enabled;51 Gtk.RadioButton encrypt_enabled;
51 Gtk.CheckButton encrypt_remember;52 Gtk.CheckButton encrypt_remember;
52 protected Gtk.Widget password_page {get; private set;}53 protected Gtk.Widget password_page {get; private set;}
54 protected Gtk.Widget nag_page {get; private set;}
55 protected bool nagged;
53 List<Gtk.Widget> first_password_widgets;56 List<Gtk.Widget> first_password_widgets;
54 MainLoop password_ask_loop;57 MainLoop password_ask_loop;
55 MainLoop password_find_loop;58 MainLoop password_find_loop;
@@ -94,6 +97,7 @@
94 add_setup_pages();97 add_setup_pages();
95 add_confirm_page();98 add_confirm_page();
96 add_password_page();99 add_password_page();
100 add_nag_page();
97 add_question_page();101 add_question_page();
98 add_progress_page();102 add_progress_page();
99 add_summary_page();103 add_summary_page();
@@ -384,6 +388,59 @@
384 return page;388 return page;
385 }389 }
386390
391 protected Gtk.Widget make_nag_page()
392 {
393 int rows = 0;
394 Gtk.Widget w, label;
395
396 var page = new Gtk.Grid();
397 page.set("row-spacing", 6,
398 "column-spacing", 6,
399 "border-width", 12);
400
401 w = new Gtk.Label(_("In order to check that you will be able to retrieve your files in the case of an emergency, please enter your encryption password again to perform a brief restore test."));
402 w.set("xalign", 0.0f,
403 "max-width-chars", 25,
404 "wrap", true);
405 page.attach(w, 0, rows, 3, 1);
406 w.hide();
407 ++rows;
408
409 w = new Gtk.Entry();
410 w.set("visibility", false,
411 "hexpand", true,
412 "activates-default", true);
413 ((Gtk.Entry)w).changed.connect((entry) => {check_nag_validity();});
414 label = new Gtk.Label(_("E_ncryption password"));
415 label.set("mnemonic-widget", w,
416 "use-underline", true,
417 "xalign", 1.0f);
418 page.attach(label, 1, rows, 1, 1);
419 page.attach(w, 2, rows, 1, 1);
420 nag_entry = w as Gtk.Entry;
421 ++rows;
422
423 w = new Gtk.CheckButton.with_mnemonic(_("_Show password"));
424 ((Gtk.CheckButton)w).toggled.connect((button) => {
425 nag_entry.visibility = button.get_active();
426 });
427 page.attach(w, 2, rows, 1, 1);
428 ++rows;
429
430 w = new Gtk.CheckButton.with_mnemonic(_("Test every two _months"));
431 page.attach(w, 0, rows, 3, 1);
432 w.hide();
433 ((Gtk.CheckButton)w).active = true;
434 w.vexpand = true;
435 w.valign = Gtk.Align.END;
436 ((Gtk.CheckButton)w).toggled.connect((button) => {
437 DejaDup.update_nag_time(!button.get_active());
438 });
439 ++rows;
440
441 return page;
442 }
443
387 protected Gtk.Widget make_question_page()444 protected Gtk.Widget make_question_page()
388 {445 {
389 int rows = 0;446 int rows = 0;
@@ -462,6 +519,14 @@
462 password_page = page;519 password_page = page;
463 }520 }
464521
522 void add_nag_page()
523 {
524 var page = make_nag_page();
525 append_page(page, Type.CHECK);
526 set_page_title(page, _("Restore Test"));
527 nag_page = page;
528 }
529
465 void add_question_page()530 void add_question_page()
466 {531 {
467 var page = make_question_page();532 var page = make_question_page();
@@ -588,7 +653,7 @@
588 else if (op == null)653 else if (op == null)
589 do_apply.begin();654 do_apply.begin();
590 }655 }
591 else if (page == password_page)656 else if (page == password_page || page == nag_page)
592 set_header_icon(Gtk.Stock.DIALOG_AUTHENTICATION);657 set_header_icon(Gtk.Stock.DIALOG_AUTHENTICATION);
593 }658 }
594659
@@ -677,8 +742,8 @@
677742
678 protected void get_passphrase()743 protected void get_passphrase()
679 {744 {
680 // DEJA_DUP_TESTING only set when we are in test suite745 if (!searched_for_passphrase && !DejaDup.in_testing_mode() &&
681 if (!searched_for_passphrase && !DejaDup.in_testing_mode()) {746 op.use_cached_password) {
682 // First, try user's keyring747 // First, try user's keyring
683 GnomeKeyring.find_password(PASSPHRASE_SCHEMA,748 GnomeKeyring.find_password(PASSPHRASE_SCHEMA,
684 found_passphrase,749 found_passphrase,
@@ -730,14 +795,31 @@
730 set_page_title(password_page, _("Require Password?"));795 set_page_title(password_page, _("Require Password?"));
731 else796 else
732 set_page_title(password_page, _("Encryption Password Needed"));797 set_page_title(password_page, _("Encryption Password Needed"));
733 foreach (Gtk.Widget w in first_password_widgets) {798
799 foreach (Gtk.Widget w in first_password_widgets)
734 w.visible = first;800 w.visible = first;
735 }801
736 check_password_validity();802 check_password_validity();
737 encrypt_entry.select_region(0, -1);803 encrypt_entry.select_region(0, -1);
738 encrypt_entry.grab_focus();804 encrypt_entry.grab_focus();
739 }805 }
740806
807 void check_nag_validity()
808 {
809 var passphrase = nag_entry.get_text();
810 if (passphrase == "")
811 allow_forward(false);
812 else
813 allow_forward(true);
814 }
815
816 void configure_nag_page()
817 {
818 check_nag_validity();
819 nag_entry.set_text("");
820 nag_entry.grab_focus();
821 }
822
741 void stop_password_loop(Assistant dlg, int resp)823 void stop_password_loop(Assistant dlg, int resp)
742 {824 {
743 Idle.add(() => {825 Idle.add(() => {
@@ -751,8 +833,15 @@
751 protected void ask_passphrase(bool first = false)833 protected void ask_passphrase(bool first = false)
752 {834 {
753 op.needs_password = true;835 op.needs_password = true;
754 interrupt(password_page);836 if (op.use_cached_password) {
755 configure_password_page(first);837 interrupt(password_page);
838 configure_password_page(first);
839 }
840 else {
841 interrupt(nag_page);
842 configure_nag_page();
843 nagged = true;
844 }
756 force_visible(false);845 force_visible(false);
757 // pause until we can provide password by entering new main loop846 // pause until we can provide password by entering new main loop
758 password_ask_loop = new MainLoop(null);847 password_ask_loop = new MainLoop(null);
@@ -764,22 +853,29 @@
764 {853 {
765 var passphrase = "";854 var passphrase = "";
766855
767 if (encrypt_enabled.active) {856 if (op.use_cached_password) {
768 passphrase = encrypt_entry.get_text().strip();857 if (encrypt_enabled.active) {
858 passphrase = encrypt_entry.get_text().strip();
859 if (passphrase == "") // all whitespace password? allow it...
860 passphrase = encrypt_entry.get_text();
861 }
862
863 if (passphrase != "") {
864 // Save it
865 if (encrypt_remember.active) {
866 GnomeKeyring.store_password(PASSPHRASE_SCHEMA,
867 GnomeKeyring.DEFAULT,
868 _("Backup encryption password"),
869 passphrase, save_password_callback,
870 "owner", Config.PACKAGE,
871 "type", "passphrase");
872 }
873 }
874 }
875 else {
876 passphrase = nag_entry.get_text().strip();
769 if (passphrase == "") // all whitespace password? allow it...877 if (passphrase == "") // all whitespace password? allow it...
770 passphrase = encrypt_entry.get_text();878 passphrase = nag_entry.get_text();
771 }
772
773 if (passphrase != "") {
774 // Save it
775 if (encrypt_remember.active) {
776 GnomeKeyring.store_password(PASSPHRASE_SCHEMA,
777 GnomeKeyring.DEFAULT,
778 _("Backup encryption password"),
779 passphrase, save_password_callback,
780 "owner", Config.PACKAGE,
781 "type", "passphrase");
782 }
783 }879 }
784880
785 op.set_passphrase(passphrase);881 op.set_passphrase(passphrase);
786882
=== modified file 'po/deja-dup.pot'
--- po/deja-dup.pot 2012-07-20 23:42:14 +0000
+++ po/deja-dup.pot 2012-08-21 01:36:28 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: mike@mterry.name\n"10"Report-Msgid-Bugs-To: mike@mterry.name\n"
11"POT-Creation-Date: 2012-07-20 19:31-0400\n"11"POT-Creation-Date: 2012-08-20 21:34-0400\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -33,7 +33,7 @@
33#. context is itself a reference to both the underlying command line tool33#. context is itself a reference to both the underlying command line tool
34#. "duplicity" and the act of duplicating data for backup. As a whole, the34#. "duplicity" and the act of duplicating data for backup. As a whole, the
35#. phrase "Déjà Dup" may not be very translatable.35#. phrase "Déjà Dup" may not be very translatable.
36#: ../data/deja-dup.desktop.in.h:2 ../common/CommonUtils.vala:8936#: ../data/deja-dup.desktop.in.h:2 ../common/CommonUtils.vala:90
37#: ../deja-dup/main.vala:78 ../preferences/Preferences.vala:8837#: ../deja-dup/main.vala:78 ../preferences/Preferences.vala:88
38#, c-format38#, c-format
39msgid "Déjà Dup Backup Tool"39msgid "Déjà Dup Backup Tool"
@@ -154,7 +154,7 @@
154154
155#: ../data/org.gnome.DejaDup.gschema.xml.in.h:18155#: ../data/org.gnome.DejaDup.gschema.xml.in.h:18
156msgid ""156msgid ""
157"The first time Déjà Dup checked whether it should prompt about backing up"157"The last time Déjà Dup checked whether it should prompt about backing up"
158msgstr ""158msgstr ""
159159
160#: ../data/org.gnome.DejaDup.gschema.xml.in.h:19160#: ../data/org.gnome.DejaDup.gschema.xml.in.h:19
@@ -166,161 +166,173 @@
166msgstr ""166msgstr ""
167167
168#: ../data/org.gnome.DejaDup.gschema.xml.in.h:20168#: ../data/org.gnome.DejaDup.gschema.xml.in.h:20
169msgid ""
170"The last time Déjà Dup checked whether it should prompt about your password"
171msgstr ""
172
173#: ../data/org.gnome.DejaDup.gschema.xml.in.h:21
174msgid ""
175"In order to prevent you from forgetting your passwords, Déjà Dup will "
176"occasionally notify you to confirm the password. This time should be either "
177"‘disabled’ to turn off this check or in ISO 8601 format."
178msgstr ""
179
180#: ../data/org.gnome.DejaDup.gschema.xml.in.h:22
169msgid "How long to keep backup files"181msgid "How long to keep backup files"
170msgstr ""182msgstr ""
171183
172#: ../data/org.gnome.DejaDup.gschema.xml.in.h:21184#: ../data/org.gnome.DejaDup.gschema.xml.in.h:23
173msgid ""185msgid ""
174"The number of days to keep backup files on the backup location. A value of 0 "186"The number of days to keep backup files on the backup location. A value of 0 "
175"means forever. This is a minimum number of days; the files may be kept "187"means forever. This is a minimum number of days; the files may be kept "
176"longer."188"longer."
177msgstr ""189msgstr ""
178190
179#: ../data/org.gnome.DejaDup.gschema.xml.in.h:22191#: ../data/org.gnome.DejaDup.gschema.xml.in.h:24
180msgid "How long to wait between full backups"192msgid "How long to wait between full backups"
181msgstr ""193msgstr ""
182194
183#: ../data/org.gnome.DejaDup.gschema.xml.in.h:23195#: ../data/org.gnome.DejaDup.gschema.xml.in.h:25
184msgid ""196msgid ""
185"Déjà Dup needs to occasionally make fresh full backups. This is the number "197"Déjà Dup needs to occasionally make fresh full backups. This is the number "
186"of days to wait between full backups."198"of days to wait between full backups."
187msgstr ""199msgstr ""
188200
189#: ../data/org.gnome.DejaDup.gschema.xml.in.h:24201#: ../data/org.gnome.DejaDup.gschema.xml.in.h:26
190msgid "Type of location to store backup"202msgid "Type of location to store backup"
191msgstr ""203msgstr ""
192204
193#: ../data/org.gnome.DejaDup.gschema.xml.in.h:25205#: ../data/org.gnome.DejaDup.gschema.xml.in.h:27
194msgid ""206msgid ""
195"The type of backup location. If ‘auto’, a default will be chosen based on "207"The type of backup location. If ‘auto’, a default will be chosen based on "
196"what is available."208"what is available."
197msgstr ""209msgstr ""
198210
199#: ../data/org.gnome.DejaDup.gschema.xml.in.h:26211#: ../data/org.gnome.DejaDup.gschema.xml.in.h:28
200msgid "Amazon S3 Access Key ID"212msgid "Amazon S3 Access Key ID"
201msgstr ""213msgstr ""
202214
203#: ../data/org.gnome.DejaDup.gschema.xml.in.h:27215#: ../data/org.gnome.DejaDup.gschema.xml.in.h:29
204msgid "Your Amazon S3 Access Key Identifier. This acts as your S3 username."216msgid "Your Amazon S3 Access Key Identifier. This acts as your S3 username."
205msgstr ""217msgstr ""
206218
207#: ../data/org.gnome.DejaDup.gschema.xml.in.h:28219#: ../data/org.gnome.DejaDup.gschema.xml.in.h:30
208msgid "The Amazon S3 bucket name to use"220msgid "The Amazon S3 bucket name to use"
209msgstr ""221msgstr ""
210222
211#: ../data/org.gnome.DejaDup.gschema.xml.in.h:29223#: ../data/org.gnome.DejaDup.gschema.xml.in.h:31
212msgid ""224msgid ""
213"Which Amazon S3 bucket to store files in. This does not need to exist "225"Which Amazon S3 bucket to store files in. This does not need to exist "
214"already. Only legal hostname strings are valid."226"already. Only legal hostname strings are valid."
215msgstr ""227msgstr ""
216228
217#. Left this way for historical reasons, should be '$HOSTNAME'. See convert_s3_folder_to_hostname()229#. Left this way for historical reasons, should be '$HOSTNAME'. See convert_s3_folder_to_hostname()
218#: ../data/org.gnome.DejaDup.gschema.xml.in.h:31230#: ../data/org.gnome.DejaDup.gschema.xml.in.h:33
219msgid "The Amazon S3 folder"231msgid "The Amazon S3 folder"
220msgstr ""232msgstr ""
221233
222#: ../data/org.gnome.DejaDup.gschema.xml.in.h:32234#: ../data/org.gnome.DejaDup.gschema.xml.in.h:34
223msgid ""235msgid ""
224"An optional folder name to store files in. This folder will be created in "236"An optional folder name to store files in. This folder will be created in "
225"the chosen bucket."237"the chosen bucket."
226msgstr ""238msgstr ""
227239
228#: ../data/org.gnome.DejaDup.gschema.xml.in.h:33240#: ../data/org.gnome.DejaDup.gschema.xml.in.h:35
229msgid "The Rackspace Cloud Files container"241msgid "The Rackspace Cloud Files container"
230msgstr ""242msgstr ""
231243
232#: ../data/org.gnome.DejaDup.gschema.xml.in.h:34244#: ../data/org.gnome.DejaDup.gschema.xml.in.h:36
233msgid ""245msgid ""
234"Which Rackspace Cloud Files container to store files in. This does not need "246"Which Rackspace Cloud Files container to store files in. This does not need "
235"to exist already. Only legal hostname strings are valid."247"to exist already. Only legal hostname strings are valid."
236msgstr ""248msgstr ""
237249
238#: ../data/org.gnome.DejaDup.gschema.xml.in.h:35250#: ../data/org.gnome.DejaDup.gschema.xml.in.h:37
239msgid "Your Rackspace username"251msgid "Your Rackspace username"
240msgstr ""252msgstr ""
241253
242#: ../data/org.gnome.DejaDup.gschema.xml.in.h:36254#: ../data/org.gnome.DejaDup.gschema.xml.in.h:38
243msgid "This is your username for the Rackspace Cloud Files service."255msgid "This is your username for the Rackspace Cloud Files service."
244msgstr ""256msgstr ""
245257
246#: ../data/org.gnome.DejaDup.gschema.xml.in.h:37258#: ../data/org.gnome.DejaDup.gschema.xml.in.h:39
247msgid "The Ubuntu One folder"259msgid "The Ubuntu One folder"
248msgstr ""260msgstr ""
249261
250#: ../data/org.gnome.DejaDup.gschema.xml.in.h:38262#: ../data/org.gnome.DejaDup.gschema.xml.in.h:40
251msgid ""263msgid ""
252"The folder name to store files in. If ‘$HOSTNAME’, it will default to a "264"The folder name to store files in. If ‘$HOSTNAME’, it will default to a "
253"folder based on the name of the computer."265"folder based on the name of the computer."
254msgstr ""266msgstr ""
255267
256#: ../data/org.gnome.DejaDup.gschema.xml.in.h:39268#: ../data/org.gnome.DejaDup.gschema.xml.in.h:41
257#: ../deja-dup/AssistantRestore.vala:221 ../preferences/Preferences.vala:151269#: ../deja-dup/AssistantRestore.vala:221 ../preferences/Preferences.vala:151
258msgid "Backup location"270msgid "Backup location"
259msgstr ""271msgstr ""
260272
261#: ../data/org.gnome.DejaDup.gschema.xml.in.h:40273#: ../data/org.gnome.DejaDup.gschema.xml.in.h:42
262msgid "Location in which to hold the backup files."274msgid "Location in which to hold the backup files."
263msgstr ""275msgstr ""
264276
265#: ../data/org.gnome.DejaDup.gschema.xml.in.h:41277#: ../data/org.gnome.DejaDup.gschema.xml.in.h:43
266msgid "Folder type"278msgid "Folder type"
267msgstr ""279msgstr ""
268280
269#: ../data/org.gnome.DejaDup.gschema.xml.in.h:42281#: ../data/org.gnome.DejaDup.gschema.xml.in.h:44
270msgid ""282msgid ""
271"Whether the backup location is a mounted external volume or a normal folder."283"Whether the backup location is a mounted external volume or a normal folder."
272msgstr ""284msgstr ""
273285
274#: ../data/org.gnome.DejaDup.gschema.xml.in.h:43286#: ../data/org.gnome.DejaDup.gschema.xml.in.h:45
275msgid "Relative path under the external volume"287msgid "Relative path under the external volume"
276msgstr ""288msgstr ""
277289
278#: ../data/org.gnome.DejaDup.gschema.xml.in.h:44290#: ../data/org.gnome.DejaDup.gschema.xml.in.h:46
279msgid ""291msgid ""
280"If the backup location is on an external volume, this is the path of the "292"If the backup location is on an external volume, this is the path of the "
281"folder on that volume."293"folder on that volume."
282msgstr ""294msgstr ""
283295
284#: ../data/org.gnome.DejaDup.gschema.xml.in.h:45296#: ../data/org.gnome.DejaDup.gschema.xml.in.h:47
285msgid "Unique ID of the external volume"297msgid "Unique ID of the external volume"
286msgstr ""298msgstr ""
287299
288#: ../data/org.gnome.DejaDup.gschema.xml.in.h:46300#: ../data/org.gnome.DejaDup.gschema.xml.in.h:48
289msgid ""301msgid ""
290"If the backup location is on an external volume, this is its unique "302"If the backup location is on an external volume, this is its unique "
291"filesystem identifier."303"filesystem identifier."
292msgstr ""304msgstr ""
293305
294#: ../data/org.gnome.DejaDup.gschema.xml.in.h:47306#: ../data/org.gnome.DejaDup.gschema.xml.in.h:49
295msgid "Full name of the external volume"307msgid "Full name of the external volume"
296msgstr ""308msgstr ""
297309
298#: ../data/org.gnome.DejaDup.gschema.xml.in.h:48310#: ../data/org.gnome.DejaDup.gschema.xml.in.h:50
299msgid ""311msgid ""
300"If the backup location is on an external volume, this is the volume’s longer "312"If the backup location is on an external volume, this is the volume’s longer "
301"descriptive name."313"descriptive name."
302msgstr ""314msgstr ""
303315
304#: ../data/org.gnome.DejaDup.gschema.xml.in.h:49316#: ../data/org.gnome.DejaDup.gschema.xml.in.h:51
305msgid "Short name of the external volume"317msgid "Short name of the external volume"
306msgstr ""318msgstr ""
307319
308#: ../data/org.gnome.DejaDup.gschema.xml.in.h:50320#: ../data/org.gnome.DejaDup.gschema.xml.in.h:52
309msgid ""321msgid ""
310"If the backup location is on an external volume, this is the volume’s "322"If the backup location is on an external volume, this is the volume’s "
311"shorter name."323"shorter name."
312msgstr ""324msgstr ""
313325
314#: ../data/org.gnome.DejaDup.gschema.xml.in.h:51326#: ../data/org.gnome.DejaDup.gschema.xml.in.h:53
315msgid "Icon of the external volume"327msgid "Icon of the external volume"
316msgstr ""328msgstr ""
317329
318#: ../data/org.gnome.DejaDup.gschema.xml.in.h:52330#: ../data/org.gnome.DejaDup.gschema.xml.in.h:54
319msgid ""331msgid ""
320"If the backup location is on an external volume, this is the volume’s icon."332"If the backup location is on an external volume, this is the volume’s icon."
321msgstr ""333msgstr ""
322334
323#: ../data/org.gnome.DejaDup.gschema.xml.in.h:53335#: ../data/org.gnome.DejaDup.gschema.xml.in.h:55
324msgid "Obsolete"336msgid "Obsolete"
325msgstr ""337msgstr ""
326338
@@ -328,7 +340,7 @@
328msgid "Folder"340msgid "Folder"
329msgstr ""341msgstr ""
330342
331#: ../data/ui/restore-missing.ui.h:2 ../deja-dup/AssistantOperation.vala:175343#: ../data/ui/restore-missing.ui.h:2 ../deja-dup/AssistantOperation.vala:179
332msgid "Scanning…"344msgid "Scanning…"
333msgstr ""345msgstr ""
334346
@@ -354,7 +366,7 @@
354366
355#. Translators: %2$s is the name of a removable drive, %1$s is a folder367#. Translators: %2$s is the name of a removable drive, %1$s is a folder
356#. on that removable drive.368#. on that removable drive.
357#: ../common/BackendFile.vala:135 ../common/CommonUtils.vala:434369#: ../common/BackendFile.vala:135 ../common/CommonUtils.vala:481
358#, c-format370#, c-format
359msgid "%1$s on %2$s"371msgid "%1$s on %2$s"
360msgstr ""372msgstr ""
@@ -454,86 +466,96 @@
454msgid "_Remember secret access key"466msgid "_Remember secret access key"
455msgstr ""467msgstr ""
456468
457#: ../common/BackendU1.vala:166 ../widgets/ConfigLocation.vala:186469#: ../common/BackendU1.vala:170 ../widgets/ConfigLocation.vala:186
458msgid "Ubuntu One"470msgid "Ubuntu One"
459msgstr ""471msgstr ""
460472
461#. Translators: %s is a folder.473#. Translators: %s is a folder.
462#: ../common/BackendU1.vala:169474#: ../common/BackendU1.vala:173
463#, c-format475#, c-format
464msgid "%s on Ubuntu One"476msgid "%s on Ubuntu One"
465msgstr ""477msgstr ""
466478
467#: ../common/BackendU1.vala:236479#: ../common/BackendU1.vala:240
468msgid "Connect to Ubuntu One"480msgid "Connect to Ubuntu One"
469msgstr ""481msgstr ""
470482
471#: ../common/BackendU1.vala:237483#: ../common/BackendU1.vala:241
472msgid "Sign into Ubuntu One…"484msgid "Sign into Ubuntu One…"
473msgstr ""485msgstr ""
474486
475#: ../common/CommonUtils.vala:354487#: ../common/CommonUtils.vala:401
476#, c-format488#, c-format
477msgid "Could not find backup tool in %s. Your installation is incomplete."489msgid "Could not find backup tool in %s. Your installation is incomplete."
478msgstr ""490msgstr ""
479491
480#: ../common/CommonUtils.vala:356492#: ../common/CommonUtils.vala:403
481msgid "Could not load backup tool. Your installation is incomplete."493msgid "Could not load backup tool. Your installation is incomplete."
482msgstr ""494msgstr ""
483495
484#: ../common/CommonUtils.vala:362496#: ../common/CommonUtils.vala:409
485msgid "Backup tool is broken. Your installation is incomplete."497msgid "Backup tool is broken. Your installation is incomplete."
486msgstr ""498msgstr ""
487499
488#: ../common/CommonUtils.vala:384500#: ../common/CommonUtils.vala:431
489msgid "Could not start backup tool"501msgid "Could not start backup tool"
490msgstr ""502msgstr ""
491503
492#. Translators: this is the home folder and %s is the user's username504#. Translators: this is the home folder and %s is the user's username
493#: ../common/CommonUtils.vala:485505#: ../common/CommonUtils.vala:532
494#, c-format506#, c-format
495msgid "Home (%s)"507msgid "Home (%s)"
496msgstr ""508msgstr ""
497509
498#. Translators: this is the home folder510#. Translators: this is the home folder
499#: ../common/CommonUtils.vala:490511#: ../common/CommonUtils.vala:537
500msgid "Home"512msgid "Home"
501msgstr ""513msgstr ""
502514
503#. Translators: this is the trash folder515#. Translators: this is the trash folder
504#: ../common/CommonUtils.vala:495516#: ../common/CommonUtils.vala:542
505msgid "Trash"517msgid "Trash"
506msgstr ""518msgstr ""
507519
520#: ../common/OperationBackup.vala:42 ../common/OperationVerify.vala:56
521msgid "Verifying backup…"
522msgstr ""
523
508#: ../common/OperationRestore.vala:51524#: ../common/OperationRestore.vala:51
509msgid "Restoring files…"525msgid "Restoring files…"
510msgstr ""526msgstr ""
511527
512#: ../common/Operation.vala:60528#: ../common/OperationVerify.vala:94
529msgid ""
530"Your backup appears to be corrupted. You should delete the backup and try "
531"again."
532msgstr ""
533
534#: ../common/Operation.vala:61
513msgid "Backing up…"535msgid "Backing up…"
514msgstr ""536msgstr ""
515537
516#: ../common/Operation.vala:62 ../deja-dup/AssistantRestore.vala:484538#: ../common/Operation.vala:63 ../deja-dup/AssistantRestore.vala:484
517msgid "Restoring…"539msgid "Restoring…"
518msgstr ""540msgstr ""
519541
520#: ../common/Operation.vala:64542#: ../common/Operation.vala:65
521msgid "Checking for backups…"543msgid "Checking for backups…"
522msgstr ""544msgstr ""
523545
524#: ../common/Operation.vala:66546#: ../common/Operation.vala:67
525msgid "Listing files…"547msgid "Listing files…"
526msgstr ""548msgstr ""
527549
528#: ../common/Operation.vala:68 ../common/Operation.vala:100550#: ../common/Operation.vala:69 ../common/Operation.vala:103
529#: ../tools/duplicity/DuplicityJob.vala:386551#: ../tools/duplicity/DuplicityJob.vala:400
530#: ../tools/duplicity/DuplicityJob.vala:393552#: ../tools/duplicity/DuplicityJob.vala:407
531#: ../tools/duplicity/DuplicityJob.vala:412553#: ../tools/duplicity/DuplicityJob.vala:426
532#: ../tools/duplicity/DuplicityJob.vala:417554#: ../tools/duplicity/DuplicityJob.vala:431
533msgid "Preparing…"555msgid "Preparing…"
534msgstr ""556msgstr ""
535557
536#: ../common/Operation.vala:237558#: ../common/Operation.vala:295
537msgid "Another backup operation is already running"559msgid "Another backup operation is already running"
538msgstr ""560msgstr ""
539561
@@ -571,69 +593,90 @@
571msgid "Backup Finished"593msgid "Backup Finished"
572msgstr ""594msgstr ""
573595
574#: ../deja-dup/AssistantBackup.vala:100596#: ../deja-dup/AssistantBackup.vala:96
597msgid "Your files were successfully backed up and tested."
598msgstr ""
599
600#: ../deja-dup/AssistantBackup.vala:103
575msgid "Backing Up…"601msgid "Backing Up…"
576msgstr ""602msgstr ""
577603
578#: ../deja-dup/AssistantOperation.vala:174604#: ../deja-dup/AssistantOperation.vala:178
579msgid "Scanning:"605msgid "Scanning:"
580msgstr ""606msgstr ""
581607
582#: ../deja-dup/AssistantOperation.vala:256608#: ../deja-dup/AssistantOperation.vala:260
583msgid "_Details"609msgid "_Details"
584msgstr ""610msgstr ""
585611
586#: ../deja-dup/AssistantOperation.vala:304612#: ../deja-dup/AssistantOperation.vala:308
587msgid "_Allow restoring without a password"613msgid "_Allow restoring without a password"
588msgstr ""614msgstr ""
589615
590#: ../deja-dup/AssistantOperation.vala:310616#: ../deja-dup/AssistantOperation.vala:314
591msgid "_Password-protect your backup"617msgid "_Password-protect your backup"
592msgstr ""618msgstr ""
593619
594#: ../deja-dup/AssistantOperation.vala:324620#: ../deja-dup/AssistantOperation.vala:328
595#, c-format621#, c-format
596msgid ""622msgid ""
597"You will need your password to restore your files. You might want to write "623"You will need your password to restore your files. You might want to write "
598"it down."624"it down."
599msgstr ""625msgstr ""
600626
601#: ../deja-dup/AssistantOperation.vala:339627#: ../deja-dup/AssistantOperation.vala:343
628#: ../deja-dup/AssistantOperation.vala:414
602msgid "E_ncryption password"629msgid "E_ncryption password"
603msgstr ""630msgstr ""
604631
605#: ../deja-dup/AssistantOperation.vala:356632#: ../deja-dup/AssistantOperation.vala:360
606msgid "Confir_m password"633msgid "Confir_m password"
607msgstr ""634msgstr ""
608635
609#: ../deja-dup/AssistantOperation.vala:369636#: ../deja-dup/AssistantOperation.vala:373
637#: ../deja-dup/AssistantOperation.vala:423
610msgid "_Show password"638msgid "_Show password"
611msgstr ""639msgstr ""
612640
613#: ../deja-dup/AssistantOperation.vala:378641#: ../deja-dup/AssistantOperation.vala:382
614#: ../deja-dup/MountOperationAssistant.vala:40642#: ../deja-dup/MountOperationAssistant.vala:40
615msgid "_Remember password"643msgid "_Remember password"
616msgstr ""644msgstr ""
617645
618#: ../deja-dup/AssistantOperation.vala:447646#: ../deja-dup/AssistantOperation.vala:401
647msgid ""
648"In order to check that you will be able to retrieve your files in the case "
649"of an emergency, please enter your encryption password again to perform a "
650"brief restore test."
651msgstr ""
652
653#: ../deja-dup/AssistantOperation.vala:430
654msgid "Test every two _months"
655msgstr ""
656
657#: ../deja-dup/AssistantOperation.vala:504
619msgid "Summary"658msgid "Summary"
620msgstr ""659msgstr ""
621660
622#: ../deja-dup/AssistantOperation.vala:537661#: ../deja-dup/AssistantOperation.vala:526
623#: ../tools/duplicity/DuplicityJob.vala:694662msgid "Restore Test"
624#: ../tools/duplicity/DuplicityJob.vala:1076663msgstr ""
664
665#: ../deja-dup/AssistantOperation.vala:602
666#: ../tools/duplicity/DuplicityJob.vala:710
667#: ../tools/duplicity/DuplicityJob.vala:1092
625msgid "Failed with an unknown error."668msgid "Failed with an unknown error."
626msgstr ""669msgstr ""
627670
628#: ../deja-dup/AssistantOperation.vala:730671#: ../deja-dup/AssistantOperation.vala:795
629msgid "Require Password?"672msgid "Require Password?"
630msgstr ""673msgstr ""
631674
632#: ../deja-dup/AssistantOperation.vala:732675#: ../deja-dup/AssistantOperation.vala:797
633msgid "Encryption Password Needed"676msgid "Encryption Password Needed"
634msgstr ""677msgstr ""
635678
636#: ../deja-dup/AssistantOperation.vala:778679#: ../deja-dup/AssistantOperation.vala:868
637msgid "Backup encryption password"680msgid "Backup encryption password"
638msgstr ""681msgstr ""
639682
@@ -782,11 +825,16 @@
782msgid "Scanning finished"825msgid "Scanning finished"
783msgstr ""826msgstr ""
784827
785#: ../deja-dup/Assistant.vala:309828#: ../deja-dup/Assistant.vala:314
786msgid "Co_ntinue"829msgid "Co_ntinue"
787msgstr ""830msgstr ""
788831
789#: ../deja-dup/Assistant.vala:347 ../deja-dup/StatusIcon.vala:93832#: ../deja-dup/Assistant.vala:320
833msgctxt "verb"
834msgid "_Test"
835msgstr ""
836
837#: ../deja-dup/Assistant.vala:357 ../deja-dup/StatusIcon.vala:93
790msgid "_Resume Later"838msgid "_Resume Later"
791msgstr ""839msgstr ""
792840
@@ -1012,35 +1060,35 @@
1012msgid "Categories"1060msgid "Categories"
1013msgstr ""1061msgstr ""
10141062
1015#: ../tools/duplicity/DuplicityJob.vala:891063#: ../tools/duplicity/DuplicityJob.vala:90
1016#: ../tools/duplicity/DuplicityJob.vala:1731064#: ../tools/duplicity/DuplicityJob.vala:187
1017msgid "Paused (no network)"1065msgid "Paused (no network)"
1018msgstr ""1066msgstr ""
10191067
1020#. Was not even a file path (maybe something goofy like computer://)1068#. Was not even a file path (maybe something goofy like computer://)
1021#: ../tools/duplicity/DuplicityJob.vala:4441069#: ../tools/duplicity/DuplicityJob.vala:458
1022#, c-format1070#, c-format
1023msgid "Could not restore ‘%s’: Not a valid file location"1071msgid "Could not restore ‘%s’: Not a valid file location"
1024msgstr ""1072msgstr ""
10251073
1026#. Tiny backup location. Suggest they get a larger one.1074#. Tiny backup location. Suggest they get a larger one.
1027#: ../tools/duplicity/DuplicityJob.vala:5101075#: ../tools/duplicity/DuplicityJob.vala:524
1028msgid "Backup location is too small. Try using one with more space."1076msgid "Backup location is too small. Try using one with more space."
1029msgstr ""1077msgstr ""
10301078
1031#: ../tools/duplicity/DuplicityJob.vala:5321079#: ../tools/duplicity/DuplicityJob.vala:547
1032msgid "Backup location does not have enough free space."1080msgid "Backup location does not have enough free space."
1033msgstr ""1081msgstr ""
10341082
1035#: ../tools/duplicity/DuplicityJob.vala:5511083#: ../tools/duplicity/DuplicityJob.vala:567
1036#: ../tools/duplicity/DuplicityJob.vala:5651084#: ../tools/duplicity/DuplicityJob.vala:581
1037msgid "Cleaning up…"1085msgid "Cleaning up…"
1038msgstr ""1086msgstr ""
10391087
1040#. OK, we succeeded yay! But some files didn't make it into the backup1088#. OK, we succeeded yay! But some files didn't make it into the backup
1041#. because we couldn't read them. So tell the user so they don't think1089#. because we couldn't read them. So tell the user so they don't think
1042#. everything is hunky dory.1090#. everything is hunky dory.
1043#: ../tools/duplicity/DuplicityJob.vala:6611091#: ../tools/duplicity/DuplicityJob.vala:677
1044msgid ""1092msgid ""
1045"Could not back up the following files. Please make sure you are able to "1093"Could not back up the following files. Please make sure you are able to "
1046"open them."1094"open them."
@@ -1049,13 +1097,13 @@
1049#. OK, we succeeded yay! But some files didn't actually restore1097#. OK, we succeeded yay! But some files didn't actually restore
1050#. because we couldn't write to them. So tell the user so they1098#. because we couldn't write to them. So tell the user so they
1051#. don't think everything is hunky dory.1099#. don't think everything is hunky dory.
1052#: ../tools/duplicity/DuplicityJob.vala:6771100#: ../tools/duplicity/DuplicityJob.vala:693
1053msgid ""1101msgid ""
1054"Could not restore the following files. Please make sure you are able to "1102"Could not restore the following files. Please make sure you are able to "
1055"write to them."1103"write to them."
1056msgstr ""1104msgstr ""
10571105
1058#: ../tools/duplicity/DuplicityJob.vala:9241106#: ../tools/duplicity/DuplicityJob.vala:940
1059#, c-format1107#, c-format
1060msgid "Could not restore ‘%s’: File not found in backup"1108msgid "Could not restore ‘%s’: File not found in backup"
1061msgstr ""1109msgstr ""
@@ -1063,17 +1111,17 @@
1063#. notify upper layers, if they want to do anything1111#. notify upper layers, if they want to do anything
1064#. Duplicity tried to ask the user what the encryption password is.1112#. Duplicity tried to ask the user what the encryption password is.
1065#. notify upper layers, if they want to do anything1113#. notify upper layers, if they want to do anything
1066#: ../tools/duplicity/DuplicityJob.vala:9301114#: ../tools/duplicity/DuplicityJob.vala:946
1067#: ../tools/duplicity/DuplicityJob.vala:10281115#: ../tools/duplicity/DuplicityJob.vala:1044
1068#: ../tools/duplicity/DuplicityJob.vala:10321116#: ../tools/duplicity/DuplicityJob.vala:1048
1069msgid "Bad encryption password."1117msgid "Bad encryption password."
1070msgstr ""1118msgstr ""
10711119
1072#: ../tools/duplicity/DuplicityJob.vala:9351120#: ../tools/duplicity/DuplicityJob.vala:951
1073msgid "Computer name changed"1121msgid "Computer name changed"
1074msgstr ""1122msgstr ""
10751123
1076#: ../tools/duplicity/DuplicityJob.vala:9351124#: ../tools/duplicity/DuplicityJob.vala:951
1077#, c-format1125#, c-format
1078msgid ""1126msgid ""
1079"The existing backup is of a computer named %s, but the current computer’s "1127"The existing backup is of a computer named %s, but the current computer’s "
@@ -1081,69 +1129,69 @@
1081"location."1129"location."
1082msgstr ""1130msgstr ""
10831131
1084#: ../tools/duplicity/DuplicityJob.vala:9701132#: ../tools/duplicity/DuplicityJob.vala:986
1085#, c-format1133#, c-format
1086msgid "Permission denied when trying to create ‘%s’."1134msgid "Permission denied when trying to create ‘%s’."
1087msgstr ""1135msgstr ""
10881136
1089#. assume error is on backend side1137#. assume error is on backend side
1090#: ../tools/duplicity/DuplicityJob.vala:9741138#: ../tools/duplicity/DuplicityJob.vala:990
1091#: ../tools/duplicity/DuplicityJob.vala:9781139#: ../tools/duplicity/DuplicityJob.vala:994
1092#, c-format1140#, c-format
1093msgid "Permission denied when trying to read ‘%s’."1141msgid "Permission denied when trying to read ‘%s’."
1094msgstr ""1142msgstr ""
10951143
1096#: ../tools/duplicity/DuplicityJob.vala:9821144#: ../tools/duplicity/DuplicityJob.vala:998
1097#, c-format1145#, c-format
1098msgid "Permission denied when trying to delete ‘%s’."1146msgid "Permission denied when trying to delete ‘%s’."
1099msgstr ""1147msgstr ""
11001148
1101#: ../tools/duplicity/DuplicityJob.vala:9891149#: ../tools/duplicity/DuplicityJob.vala:1005
1102#, c-format1150#, c-format
1103msgid "Backup location ‘%s’ does not exist."1151msgid "Backup location ‘%s’ does not exist."
1104msgstr ""1152msgstr ""
11051153
1106#: ../tools/duplicity/DuplicityJob.vala:9951154#: ../tools/duplicity/DuplicityJob.vala:1011
1107#: ../tools/duplicity/DuplicityJob.vala:10471155#: ../tools/duplicity/DuplicityJob.vala:1063
1108msgid "No space left."1156msgid "No space left."
1109msgstr ""1157msgstr ""
11101158
1111#: ../tools/duplicity/DuplicityJob.vala:10091159#: ../tools/duplicity/DuplicityJob.vala:1025
1112msgid "Invalid ID."1160msgid "Invalid ID."
1113msgstr ""1161msgstr ""
11141162
1115#: ../tools/duplicity/DuplicityJob.vala:10111163#: ../tools/duplicity/DuplicityJob.vala:1027
1116msgid "Invalid secret key."1164msgid "Invalid secret key."
1117msgstr ""1165msgstr ""
11181166
1119#: ../tools/duplicity/DuplicityJob.vala:10131167#: ../tools/duplicity/DuplicityJob.vala:1029
1120msgid "Your Amazon Web Services account is not signed up for the S3 service."1168msgid "Your Amazon Web Services account is not signed up for the S3 service."
1121msgstr ""1169msgstr ""
11221170
1123#: ../tools/duplicity/DuplicityJob.vala:10221171#: ../tools/duplicity/DuplicityJob.vala:1038
1124msgid "S3 bucket name is not available."1172msgid "S3 bucket name is not available."
1125msgstr ""1173msgstr ""
11261174
1127#: ../tools/duplicity/DuplicityJob.vala:10361175#: ../tools/duplicity/DuplicityJob.vala:1052
1128#, c-format1176#, c-format
1129msgid "Error reading file ‘%s’."1177msgid "Error reading file ‘%s’."
1130msgstr ""1178msgstr ""
11311179
1132#: ../tools/duplicity/DuplicityJob.vala:10381180#: ../tools/duplicity/DuplicityJob.vala:1054
1133#, c-format1181#, c-format
1134msgid "Error writing file ‘%s’."1182msgid "Error writing file ‘%s’."
1135msgstr ""1183msgstr ""
11361184
1137#: ../tools/duplicity/DuplicityJob.vala:10491185#: ../tools/duplicity/DuplicityJob.vala:1065
1138#, c-format1186#, c-format
1139msgid "No space left in ‘%s’."1187msgid "No space left in ‘%s’."
1140msgstr ""1188msgstr ""
11411189
1142#: ../tools/duplicity/DuplicityJob.vala:10571190#: ../tools/duplicity/DuplicityJob.vala:1073
1143msgid "No backup files found"1191msgid "No backup files found"
1144msgstr ""1192msgstr ""
11451193
1146#: ../tools/duplicity/DuplicityJob.vala:11071194#: ../tools/duplicity/DuplicityJob.vala:1123
1147msgid "Uploading…"1195msgid "Uploading…"
1148msgstr ""1196msgstr ""
11491197
11501198
=== modified file 'tests/runner/mock/duplicity'
--- tests/runner/mock/duplicity 2012-08-13 23:03:55 +0000
+++ tests/runner/mock/duplicity 2012-08-21 01:36:28 +0000
@@ -77,6 +77,7 @@
77delay = 077delay = 0
78script = ''78script = ''
79passphrase = None79passphrase = None
80tmp_archive = False
8081
81while len(lines) > curline and lines[curline].strip():82while len(lines) > curline and lines[curline].strip():
82 tokens = lines[curline].split()83 tokens = lines[curline].split()
@@ -90,8 +91,19 @@
90 script = ' '.join(tokens[1:])91 script = ' '.join(tokens[1:])
91 elif tokens[0] == 'PASSPHRASE:':92 elif tokens[0] == 'PASSPHRASE:':
92 passphrase = tokens[1] if len(tokens) > 1 else ''93 passphrase = tokens[1] if len(tokens) > 1 else ''
94 elif lines[curline].strip() == 'TMP_ARCHIVE':
95 tmp_archive = True
93 curline += 196 curline += 1
9497
98if tmp_archive:
99 for i in xrange(len(sys.argv)):
100 split = sys.argv[i].split('=', 1)
101 if len(split) > 1 and split[0] == "--archive-dir":
102 if split[1].find("/cache/") != -1:
103 print >> logfd, "TESTFAIL: expected random /tmp archive dir"
104 sys.exit(-1)
105 sys.argv[i] = "--archive-dir=?"
106
95if expected_args != sys.argv[1:]:107if expected_args != sys.argv[1:]:
96 print >> logfd, "TESTFAIL: expected\n%s\nvs\n%s" % (expected_args, sys.argv[1:])108 print >> logfd, "TESTFAIL: expected\n%s\nvs\n%s" % (expected_args, sys.argv[1:])
97 sys.exit(-1)109 sys.exit(-1)
98110
=== modified file 'tests/runner/runner.vala'
--- tests/runner/runner.vala 2012-08-13 23:44:06 +0000
+++ tests/runner/runner.vala 2012-08-21 01:36:28 +0000
@@ -103,21 +103,23 @@
103 LIST,103 LIST,
104}104}
105105
106string default_args(BackupRunner br, Mode mode = Mode.NONE, bool encrypted = false, string extra = "")106string default_args(BackupRunner br, Mode mode = Mode.NONE, bool encrypted = false, string extra = "", bool tmp_archive = false)
107{107{
108 var cachedir = Environment.get_variable("XDG_CACHE_HOME");108 var cachedir = Environment.get_variable("XDG_CACHE_HOME");
109 var test_home = Environment.get_variable("DEJA_DUP_TEST_HOME");109 var test_home = Environment.get_variable("DEJA_DUP_TEST_HOME");
110 var backupdir = Path.build_filename(test_home, "backup");110 var backupdir = Path.build_filename(test_home, "backup");
111 var restoredir = Path.build_filename(test_home, "restore");111 var restoredir = Path.build_filename(test_home, "restore");
112112
113 var archive = tmp_archive ? "?" : "%s/deja-dup".printf(cachedir);
114
113 if (mode == Mode.CLEANUP)115 if (mode == Mode.CLEANUP)
114 return "cleanup '--force' 'file://%s' '--gio' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s/deja-dup' '--log-fd=?'".printf(backupdir, encrypted ? "" : "'--no-encryption' ", cachedir);116 return "cleanup '--force' 'file://%s' '--gio' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s' '--log-fd=?'".printf(backupdir, encrypted ? "" : "'--no-encryption' ", archive);
115 else if (mode == Mode.RESTORE)117 else if (mode == Mode.RESTORE)
116 return "'restore' '--gio' '--force' 'file://%s' '%s' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s/deja-dup' '--log-fd=?'".printf(backupdir, restoredir, encrypted ? "" : "'--no-encryption' ", cachedir);118 return "'restore' '--gio' '--force' 'file://%s' '%s' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s' '--log-fd=?'".printf(backupdir, restoredir, encrypted ? "" : "'--no-encryption' ", archive);
117 else if (mode == Mode.VERIFY)119 else if (mode == Mode.VERIFY)
118 return "'restore' '--file-to-restore=%s/deja-dup/metadata' '--gio' '--force' 'file://%s' '%s/deja-dup/metadata' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s/deja-dup' '--log-fd=?'".printf(cachedir.substring(1), backupdir, cachedir, encrypted ? "" : "'--no-encryption' ", cachedir);120 return "'restore' '--file-to-restore=%s/deja-dup/metadata' '--gio' '--force' 'file://%s' '%s/deja-dup/metadata' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s' '--log-fd=?'".printf(cachedir.substring(1), backupdir, cachedir, encrypted ? "" : "'--no-encryption' ", archive);
119 else if (mode == Mode.LIST)121 else if (mode == Mode.LIST)
120 return "'list-current-files' '--gio' 'file://%s' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s/deja-dup' '--log-fd=?'".printf(backupdir, encrypted ? "" : "'--no-encryption' ", cachedir);122 return "'list-current-files' '--gio' 'file://%s' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s' '--log-fd=?'".printf(backupdir, encrypted ? "" : "'--no-encryption' ", archive);
121123
122 string source_str = "";124 string source_str = "";
123 if (mode == Mode.DRY || mode == Mode.BACKUP)125 if (mode == Mode.DRY || mode == Mode.BACKUP)
@@ -164,7 +166,7 @@
164 args += "'--exclude=%s/deja-dup' '--exclude=%s' '--exclude=**' ".printf(cachedir, cachedir);166 args += "'--exclude=%s/deja-dup' '--exclude=%s' '--exclude=**' ".printf(cachedir, cachedir);
165 }167 }
166168
167 args += "%s%s'--gio' %s'file://%s' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s/deja-dup' '--log-fd=?'".printf(extra, dry_str, source_str, backupdir, enc_str, cachedir);169 args += "%s%s'--gio' %s'file://%s' %s'--verbosity=9' '--gpg-options=--no-use-agent' '--archive-dir=%s' '--log-fd=?'".printf(extra, dry_str, source_str, backupdir, enc_str, archive);
168170
169 return args;171 return args;
170}172}
@@ -297,14 +299,20 @@
297{299{
298 var home = Environment.get_home_dir();300 var home = Environment.get_home_dir();
299 var cachedir = Environment.get_variable("XDG_CACHE_HOME");301 var cachedir = Environment.get_variable("XDG_CACHE_HOME");
300 return in.replace("@HOME@", home).replace("@XDG_CACHE_HOME@", cachedir);302 var test_home = Environment.get_variable("DEJA_DUP_TEST_HOME");
303 return in.replace("@HOME@", home).
304 replace("@XDG_CACHE_HOME@", cachedir).
305 replace("@TEST_HOME@", test_home);
301}306}
302307
303string run_script(string in)308string run_script(string in)
304{309{
305 string output;310 string output;
311 string errstr;
306 try {312 try {
307 Process.spawn_sync(null, {"/bin/sh", "-c", in}, null, 0, null, out output, null, null);313 Process.spawn_sync(null, {"/bin/sh", "-c", in}, null, 0, null, out output, out errstr, null);
314 if (errstr != null && errstr != "")
315 warning("Error running script: %s", errstr);
308 }316 }
309 catch (SpawnError e) {317 catch (SpawnError e) {
310 warning(e.message);318 warning(e.message);
@@ -343,6 +351,22 @@
343 br.error_detail = keyfile.get_string(group, "ErrorDetail");351 br.error_detail = keyfile.get_string(group, "ErrorDetail");
344 if (keyfile.has_key(group, "Passphrases"))352 if (keyfile.has_key(group, "Passphrases"))
345 br.passphrases = keyfile.get_integer(group, "Passphrases");353 br.passphrases = keyfile.get_integer(group, "Passphrases");
354 if (keyfile.has_key(group, "Settings")) {
355 var settings_list = keyfile.get_string_list(group, "Settings");
356 var settings = DejaDup.get_settings();
357 foreach (var setting in settings_list) {
358 try {
359 var tokens = setting.split("=");
360 var key = tokens[0];
361 var val = Variant.parse(null, tokens[1]);
362 settings.set_value(key, val);
363 }
364 catch (Error e) {
365 warning("%s\n", e.message);
366 assert_not_reached();
367 }
368 }
369 }
346}370}
347371
348void process_duplicity_run_block(KeyFile keyfile, string run, BackupRunner br) throws Error372void process_duplicity_run_block(KeyFile keyfile, string run, BackupRunner br) throws Error
@@ -353,6 +377,7 @@
353 bool cancel = false;377 bool cancel = false;
354 bool stop = false;378 bool stop = false;
355 bool passphrase = false;379 bool passphrase = false;
380 bool tmp_archive = false;
356 string script = null;381 string script = null;
357 Mode mode = Mode.NONE;382 Mode mode = Mode.NONE;
358383
@@ -361,6 +386,8 @@
361 var group = "Duplicity " + run;386 var group = "Duplicity " + run;
362387
363 if (keyfile.has_group(group)) {388 if (keyfile.has_group(group)) {
389 if (keyfile.has_key(group, "ArchiveDirIsTmp"))
390 tmp_archive = keyfile.get_boolean(group, "ArchiveDirIsTmp");
364 if (keyfile.has_key(group, "Cancel"))391 if (keyfile.has_key(group, "Cancel"))
365 cancel = keyfile.get_boolean(group, "Cancel");392 cancel = keyfile.get_boolean(group, "Cancel");
366 if (keyfile.has_key(group, "Encrypted"))393 if (keyfile.has_key(group, "Encrypted"))
@@ -403,7 +430,10 @@
403430
404 var cachedir = Environment.get_variable("XDG_CACHE_HOME");431 var cachedir = Environment.get_variable("XDG_CACHE_HOME");
405432
406 var dupscript = "ARGS: " + default_args(br, mode, encrypted, extra_args);433 var dupscript = "ARGS: " + default_args(br, mode, encrypted, extra_args, tmp_archive);
434
435 if (tmp_archive)
436 dupscript += "\n" + "TMP_ARCHIVE";
407437
408 if (cancel) {438 if (cancel) {
409 dupscript += "\n" + "DELAY: 10";439 dupscript += "\n" + "DELAY: 10";
410440
=== added file 'tests/scripts/nag.test'
--- tests/scripts/nag.test 1970-01-01 00:00:00 +0000
+++ tests/scripts/nag.test 2012-08-21 01:36:28 +0000
@@ -0,0 +1,58 @@
1# Tests whether we correctly nag the user about their password during some
2# verify checks.
3
4[Operation]
5Type=backup
6Settings=nag-check='1970-01-01T00:32:08.916885Z'
7Passphrases=2
8
9[Duplicity]
10Runs=status 1;status 2;dry;backup;status-restore 1;status-restore 2;list;verify;
11
12[Duplicity status 1]
13#DEBUG 1
14#. ['duplicity.gpg']
15#
16#ERROR 31
17Output=true
18
19[Duplicity status 2]
20#DEBUG 1
21#. ['duplicity.gpg']
22Output=true
23Encrypted=true
24Passphrase=true
25
26[Duplicity dry]
27Encrypted=true
28Passphrase=true
29
30[Duplicity backup]
31Encrypted=true
32Passphrase=true
33
34[Duplicity status-restore 1]
35#DEBUG 1
36#. ['duplicity.gpg']
37#
38#ERROR 31
39Output=true
40ArchiveDirIsTmp=true
41
42[Duplicity status-restore 2]
43#DEBUG 1
44#. ['duplicity.gpg']
45Output=true
46Encrypted=true
47Passphrase=true
48ArchiveDirIsTmp=true
49
50[Duplicity list]
51Encrypted=true
52Passphrase=true
53ArchiveDirIsTmp=true
54
55[Duplicity verify]
56Encrypted=true
57Passphrase=true
58ArchiveDirIsTmp=true
059
=== modified file 'tools/duplicity/DuplicityInstance.vala'
--- tools/duplicity/DuplicityInstance.vala 2012-08-10 18:33:29 +0000
+++ tools/duplicity/DuplicityInstance.vala 2012-08-21 01:36:28 +0000
@@ -27,6 +27,7 @@
27 string user_text);27 string user_text);
28 28
29 public bool verbose {get; private set; default = false;}29 public bool verbose {get; private set; default = false;}
30 public string forced_cache_dir {get; set; default = null;}
30 31
31 public virtual void start(List<string> argv_in, List<string>? envp_in,32 public virtual void start(List<string> argv_in, List<string>? envp_in,
32 bool as_root = false) throws Error33 bool as_root = false) throws Error
@@ -71,7 +72,9 @@
71 argv.append("--gpg-options=--no-use-agent");72 argv.append("--gpg-options=--no-use-agent");
7273
73 // Cache signature files74 // Cache signature files
74 var cache_dir = Environment.get_user_cache_dir();75 var cache_dir = forced_cache_dir;
76 if (cache_dir == null)
77 cache_dir = Environment.get_user_cache_dir();
75 if (cache_dir != null) {78 if (cache_dir != null) {
76 bool add_dir = false;79 bool add_dir = false;
77 var cache_file = File.new_for_path(cache_dir);80 var cache_file = File.new_for_path(cache_dir);
7881
=== modified file 'tools/duplicity/DuplicityJob.vala'
--- tools/duplicity/DuplicityJob.vala 2012-08-21 00:49:25 +0000
+++ tools/duplicity/DuplicityJob.vala 2012-08-21 01:36:28 +0000
@@ -80,6 +80,7 @@
80 int delete_age = 0;80 int delete_age = 0;
81 81
82 File last_touched_file = null;82 File last_touched_file = null;
83 string forced_cache_dir = null;
8384
84 void network_changed()85 void network_changed()
85 {86 {
@@ -109,6 +110,9 @@
109110
110 ~DuplicityJob() {111 ~DuplicityJob() {
111 DejaDup.Network.get().notify["connected"].disconnect(network_changed);112 DejaDup.Network.get().notify["connected"].disconnect(network_changed);
113
114 if (forced_cache_dir != null)
115 new DejaDup.RecursiveDelete(File.new_for_path(forced_cache_dir)).start_async.begin();
112 }116 }
113117
114 public override void start()118 public override void start()
@@ -125,7 +129,17 @@
125 129
126 if (mode == DejaDup.ToolJob.Mode.BACKUP)130 if (mode == DejaDup.ToolJob.Mode.BACKUP)
127 process_include_excludes();131 process_include_excludes();
128 132
133 /* Fake cache dir if we need to */
134 if ((flags & DejaDup.ToolJob.Flags.NO_CACHE) != 0) {
135 try {
136 forced_cache_dir = DirUtils.make_tmp("deja-dup-XXXXXX");
137 }
138 catch (Error e) {
139 warning("%s\n", e.message);
140 }
141 }
142
129 var settings = DejaDup.get_settings();143 var settings = DejaDup.get_settings();
130 delete_age = settings.get_int(DejaDup.DELETE_AFTER_KEY);144 delete_age = settings.get_int(DejaDup.DELETE_AFTER_KEY);
131145
@@ -1372,6 +1386,9 @@
1372 inst = new DuplicityInstance();1386 inst = new DuplicityInstance();
1373 inst.done.connect(handle_done);1387 inst.done.connect(handle_done);
13741388
1389 if (forced_cache_dir != null)
1390 inst.forced_cache_dir = forced_cache_dir;
1391
1375 /* As duplicity's data is returned via a signal, handle_message begins post-raw stream processing */1392 /* As duplicity's data is returned via a signal, handle_message begins post-raw stream processing */
1376 inst.message.connect(handle_message);1393 inst.message.connect(handle_message);
13771394

Subscribers

People subscribed via source and target branches