From 8634c79096f14b787713b175956566e8d379ec9f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 21 Dec 2014 15:32:38 +0000 Subject: Fix tar commands to work on OpenBSD. BSD tar seems to not like additional options after the first block. --- test/bbackupd/testbbackupd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/bbackupd/testbbackupd.cpp') diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 20eed16d..f84625ce 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -337,16 +337,16 @@ bool unpack_files(const std::string& archive_file, << ": " << archive_file); #ifdef WIN32 - std::string cmd("tar xz "); + std::string cmd("tar xz"); cmd += tar_options + " -f testfiles/" + archive_file + ".tgz " + "-C " + destination_dir; #else std::string cmd("gzip -d < testfiles/"); - cmd += archive_file + ".tgz | ( cd " + destination_dir + " && tar xf - " + - tar_options + ")"; + cmd += archive_file + ".tgz | ( cd " + destination_dir + " && tar xf" + + tar_options + " -)"; #endif - TEST_THAT_OR(::system(cmd.c_str()) == 0, return false); + TEST_LINE_OR(::system(cmd.c_str()) == 0, cmd, return false); return true; } @@ -3682,7 +3682,7 @@ bool test_sync_new_files() { // Add some more files and modify others // Use the m flag this time so they have a recent modification time - TEST_THAT(unpack_files("test3", "testfiles", "-m")); + TEST_THAT(unpack_files("test3", "testfiles", "m")); // Wait and test bbackupd.RunSyncNow(); -- cgit v1.2.3