Verified Commit 5a9aec88 authored by Iain Lane's avatar Iain Lane

Take patch from upstream MR !22 to fix many tests under GLib 2.59

g_key_file_get_comment() used to append a stray newline to its return
value, and it stopped doing this with 2.59. deja-dup was accidentally
relying on that behaviour.
parent 4ad3af55
test-runner-Ensure-outputscript-ends-with-n-n.patch
From: Iain Lane <iainl@gnome.org>
Date: Wed, 10 Apr 2019 11:32:12 +0100
Subject: test runner: Ensure outputscript ends with \n\n
Since glib ff8b731639893c35c42de027868ddd1931b2a8ba (2.59.0), GLib now
doesn't output an extraneous newline when parsing keyfile comments. In
the deja-dup testsuite we were making use of the fact that it did.
Strip any newlines off and then add them back ourselves, so that we work
with the old and new behaviour.
Forwarded: https://gitlab.gnome.org/World/deja-dup/merge_requests/22
Origin: https://gitlab.gnome.org/iainl/deja-dup/commit/60f784dbdf95d3d4bf42babd438b9db815719d92
---
libdeja/tests/runner.vala | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libdeja/tests/runner.vala b/libdeja/tests/runner.vala
index f1c31d1..065b3d5 100644
--- a/libdeja/tests/runner.vala
+++ b/libdeja/tests/runner.vala
@@ -613,8 +613,11 @@ void process_duplicity_run_block(KeyFile keyfile, string run, BackupRunner br) t
else if (!encrypted) // when not encrypted, we always expect empty string
dupscript += "\n" + "PASSPHRASE:";
- if (outputscript != null && outputscript != "")
- dupscript += "\n\n" + outputscript + "\n";
+ if (outputscript != null && outputscript != "") {
+ // GLib prior to 2.59 added an extra \n to outputscript, but we need \n\n
+ // here, so we add them ourselves.
+ dupscript += "\n\n" + outputscript.chomp() + "\n\n";
+ }
add_to_mockscript(dupscript);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment