Commit 74fa87f8 authored by Iain Lane's avatar Iain Lane Committed by Michael Terry

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.
parent 3663fa24
......@@ -627,8 +627,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