From a9a62d7c7adf6fc0237c7d04937b538a4cea87ad Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 19 Jun 2018 09:34:18 -0400 Subject: [PATCH] Drop "ostree trivial-httpd" CLI, move to tests directory See https://github.com/ostreedev/ostree/issues/1593 Basically this makes it easier for people packaging, as the trivial-httpd is only for tests, and this way the binary will live with the tests. Also at this point nothing should depend on `ostree trivial-httpd`. --- Makefile-man.am | 6 -- Makefile-ostree.am | 7 --- Makefile-tests.am | 7 +++ configure.ac | 10 --- man/ostree-trivial-httpd.xml | 118 ----------------------------------- src/ostree/main.c | 5 -- tests/libtest.sh | 13 ++-- 7 files changed, 12 insertions(+), 154 deletions(-) delete mode 100644 man/ostree-trivial-httpd.xml diff --git a/Makefile-man.am b/Makefile-man.am index 8ccbba8c..d204aa3e 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -34,12 +34,6 @@ ostree-init.1 ostree-log.1 ostree-ls.1 ostree-prune.1 ostree-pull-local.1 \ ostree-pull.1 ostree-refs.1 ostree-remote.1 ostree-reset.1 \ ostree-rev-parse.1 ostree-show.1 ostree-summary.1 \ ostree-static-delta.1 -if BUILDOPT_TRIVIAL_HTTPD -man1_files += ostree-trivial-httpd.1 -else -# We still want to distribute the source, even if we are not building it -EXTRA_DIST += man/ostree-trivial-httpd.xml -endif if BUILDOPT_FUSE man1_files += rofiles-fuse.1 diff --git a/Makefile-ostree.am b/Makefile-ostree.am index 8d352e38..1471b3e5 100644 --- a/Makefile-ostree.am +++ b/Makefile-ostree.am @@ -133,13 +133,6 @@ ostree_SOURCES += src/ostree/ot-builtin-pull.c endif if USE_LIBSOUP -# Eventually once we stop things from using this, we should support disabling this -ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c -pkglibexec_PROGRAMS += ostree-trivial-httpd -ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c -ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS) -ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS) - if !USE_CURL # This is necessary for the cookie jar bits ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS) diff --git a/Makefile-tests.am b/Makefile-tests.am index 2c0916f6..b11fde89 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -248,6 +248,13 @@ _installed_or_uninstalled_test_programs = tests/test-varint tests/test-ot-unix-u tests/test-gpg-verify-result tests/test-checksum tests/test-lzma tests/test-rollsum \ tests/test-basic-c tests/test-sysroot-c tests/test-pull-c tests/test-repo tests/test-include-ostree-h +if USE_LIBSOUP +test_extra_programs += ostree-trivial-httpd +ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c +ostree_trivial_httpd_CFLAGS = $(common_tests_cflags) $(OT_INTERNAL_SOUP_CFLAGS) +ostree_trivial_httpd_LDADD = $(common_tests_ldadd) $(OT_INTERNAL_SOUP_LIBS) +endif + if USE_AVAHI test_programs += tests/test-repo-finder-avahi endif diff --git a/configure.ac b/configure.ac index e6e145db..1e36e6a0 100644 --- a/configure.ac +++ b/configure.ac @@ -187,15 +187,6 @@ if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libsoup"; fi AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno) AM_CONDITIONAL(HAVE_LIBSOUP_CLIENT_CERTS, test x$have_libsoup_client_certs = xyes) -AC_ARG_ENABLE(trivial-httpd-cmdline, - [AS_HELP_STRING([--enable-trivial-httpd-cmdline], - [Continue to support "ostree trivial-httpd" [default=no]])],, - enable_trivial_httpd_cmdline=no) -AM_CONDITIONAL(BUILDOPT_TRIVIAL_HTTPD, test x$enable_trivial_httpd_cmdline = xyes) -AM_COND_IF(BUILDOPT_TRIVIAL_HTTPD, - [AC_DEFINE([BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE], 1, [Define if we are enabling ostree trivial-httpd entrypoint])] -) - AS_IF([test x$with_curl = xyes && test x$with_soup = xno], [ AC_MSG_WARN([Curl enabled, but libsoup is not; libsoup is needed for tests (make check, etc.)]) ]) @@ -602,7 +593,6 @@ echo " Rust (internal oxidation): $rust_debug_release rofiles-fuse: $enable_rofiles_fuse HTTP backend: $fetcher_backend - \"ostree trivial-httpd\": $enable_trivial_httpd_cmdline SELinux: $with_selinux cryptographic checksums: $with_crypto systemd: $have_libsystemd diff --git a/man/ostree-trivial-httpd.xml b/man/ostree-trivial-httpd.xml deleted file mode 100644 index d03c12be..00000000 --- a/man/ostree-trivial-httpd.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - ostree trivial-httpd - OSTree - - - - Developer - Colin - Walters - walters@verbum.org - - - - - - ostree trivial-httpd - 1 - - - - ostree-trivial-httpd - Simple webserver - - - - - ostree trivial-httpd OPTIONS DIR - - - - - - Description - - - This runs a simple webserver and keeps it running until killed. If DIR is not specified, it defaults to the current directory. - - - - - Options - - - - , - - - Fork into background when ready. - - - - - - - - Automatically exit when directory is deleted. - - - - - ,="PATH" - - - Write port number to PATH (- for standard output). - - - - - , - - - Use the specified TCP port to listen on. - - - - - - - - Force range requests by only serving half of files. - - - - - - - - Example - $ ostree trivial-httpd - - diff --git a/src/ostree/main.c b/src/ostree/main.c index c5b45012..6478a62b 100644 --- a/src/ostree/main.c +++ b/src/ostree/main.c @@ -116,11 +116,6 @@ static OstreeCommand commands[] = { { "summary", OSTREE_BUILTIN_FLAG_NONE, ostree_builtin_summary, "Manage summary metadata" }, -#if defined(HAVE_LIBSOUP) && defined(BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE) - { "trivial-httpd", OSTREE_BUILTIN_FLAG_NONE, - ostree_builtin_trivial_httpd, - NULL }, -#endif { NULL } }; diff --git a/tests/libtest.sh b/tests/libtest.sh index e0022512..b07dc962 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -149,15 +149,12 @@ fi if test -n "${OSTREE_UNINSTALLED:-}"; then OSTREE_HTTPD=${OSTREE_UNINSTALLED}/ostree-trivial-httpd else - # trivial-httpd is now in $libexecdir by default, which we don't - # know at this point. Fortunately, libtest.sh is also in - # $libexecdir, so make an educated guess. If it's not found, assume - # it's still runnable as "ostree trivial-httpd". - if [ -x "${test_srcdir}/../../libostree/ostree-trivial-httpd" ]; then - OSTREE_HTTPD="${CMD_PREFIX} ${test_srcdir}/../../libostree/ostree-trivial-httpd" - else - OSTREE_HTTPD="${CMD_PREFIX} ostree trivial-httpd" + # trivial-httpd is now the test directory. + OSTREE_HTTPD="${G_TEST_BUILDDIR}/ostree-trivial-httpd" + if ! [ -x "${OSTREE_HTTPD}" ]; then + fatal "Failed to find ${OSTREE_HTTPD}" fi + OSTREE_HTTPD="${CMD_PREFIX} ${OSTREE_HTTPD}" fi files_are_hardlinked() { -- 2.22.0