From 48256e0743b5339c256e3943d1e045a8abb4cfb8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 15 Sep 2017 15:16:58 +0100 Subject: [PATCH] Add a patch to fix the new test-help.sh when ostree trivial-httpd is enabled At the moment we still build that tool. --- debian/changelog | 2 + ...the-case-where-ostree-trivial-httpd-.patch | 72 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 75 insertions(+) create mode 100644 debian/patches/Fix-test-help.sh-for-the-case-where-ostree-trivial-httpd-.patch create mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index 752ac181..c271ff80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ ostree (2017.11-1) UNRELEASED; urgency=medium don't install it yet * Stop copying an old ostree-trivial-httpd.xml from debian/dist/ into source tree. Upstream distributes it again. + * Add a patch to fix the new test-help.sh when ostree trivial-httpd + is enabled. At the moment we still build that tool. -- Simon McVittie Wed, 30 Aug 2017 10:09:26 +0100 diff --git a/debian/patches/Fix-test-help.sh-for-the-case-where-ostree-trivial-httpd-.patch b/debian/patches/Fix-test-help.sh-for-the-case-where-ostree-trivial-httpd-.patch new file mode 100644 index 00000000..12997727 --- /dev/null +++ b/debian/patches/Fix-test-help.sh-for-the-case-where-ostree-trivial-httpd-.patch @@ -0,0 +1,72 @@ +From: Simon McVittie +Date: Fri, 15 Sep 2017 15:15:43 +0100 +Subject: Fix test-help.sh for the case where ostree trivial-httpd is enabled +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +It's deprecated, but as long as it's still supported at all, it +shouldn't make the tests fail. + +$ ostree trivial-httpd --help +Usage: + /usr/lib/libostree/ostree-trivial-httpd [OPTION…] [DIR] - Simple webserver + +Signed-off-by: Simon McVittie +--- + tests/test-help.sh | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/tests/test-help.sh b/tests/test-help.sh +index 75fe0c1..2fda2c3 100755 +--- a/tests/test-help.sh ++++ b/tests/test-help.sh +@@ -25,13 +25,13 @@ echo "1..1" + + test_usage_output() { + file=$1; shift +- cmd=$1; shift ++ regex=$1; shift + assert_file_has_content $file '^Usage' + # check that it didn't print twice somehow + if [ "$(grep --count '^Usage' $file)" != 1 ]; then + _fatal_print_file "$file" "File '$file' has '^Usage' more than once." + fi +- assert_file_has_content $file "$cmd" ++ assert_file_has_content $file "$regex" + } + + # check that we found at least one command with subcommands +@@ -42,8 +42,13 @@ test_recursive() { + + echo "$cmd" 1>&2 + $cmd --help 1>out 2>err ++ ++ # Usage for "ostree foo" can contain either "ostree foo" or "ostree-foo" ++ # (the latter for ostree trivial-httpd) ++ regex="${cmd/ostree /ostree[- ]}" ++ + # --help message goes to standard output +- test_usage_output out "$cmd" ++ test_usage_output out "$regex" + assert_file_empty err + + builtins=`sed -n '/^Builtin \("[^"]*" \)\?Commands:$/,/^$/p'