2022-02-23 08:42:33 +00:00
|
|
|
From 196c2e1036ed990bca57c199f271c0359509e9f9 Mon Sep 17 00:00:00 2001
|
2019-07-30 23:47:09 +01:00
|
|
|
From: Colin Walters <walters@verbum.org>
|
|
|
|
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 +++
|
2020-02-08 00:49:06 +00:00
|
|
|
configure.ac | 9 ---
|
2022-02-23 08:42:33 +00:00
|
|
|
man/ostree-trivial-httpd.xml | 116 -----------------------------------
|
2019-07-30 23:47:09 +01:00
|
|
|
src/ostree/main.c | 5 --
|
|
|
|
tests/libtest.sh | 13 ++--
|
2022-02-23 08:42:33 +00:00
|
|
|
7 files changed, 12 insertions(+), 151 deletions(-)
|
2019-07-30 23:47:09 +01:00
|
|
|
delete mode 100644 man/ostree-trivial-httpd.xml
|
|
|
|
|
|
|
|
diff --git a/Makefile-man.am b/Makefile-man.am
|
2022-02-23 08:42:33 +00:00
|
|
|
index 78025fff..4aa668f6 100644
|
2019-07-30 23:47:09 +01:00
|
|
|
--- a/Makefile-man.am
|
|
|
|
+++ b/Makefile-man.am
|
2022-02-23 08:42:33 +00:00
|
|
|
@@ -32,12 +32,6 @@ ostree-init.1 ostree-log.1 ostree-ls.1 ostree-prune.1 ostree-pull-local.1 \
|
2019-07-30 23:47:09 +01:00
|
|
|
ostree-pull.1 ostree-refs.1 ostree-remote.1 ostree-reset.1 \
|
2022-02-23 08:42:33 +00:00
|
|
|
ostree-rev-parse.1 ostree-show.1 ostree-sign.1 ostree-summary.1 \
|
2019-07-30 23:47:09 +01:00
|
|
|
ostree-static-delta.1
|
2020-02-08 00:49:06 +00:00
|
|
|
-if USE_LIBSOUP
|
2019-07-30 23:47:09 +01:00
|
|
|
-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
|
2022-02-23 08:42:33 +00:00
|
|
|
index 82af1681..dabc7004 100644
|
2019-07-30 23:47:09 +01:00
|
|
|
--- a/Makefile-ostree.am
|
|
|
|
+++ b/Makefile-ostree.am
|
2022-02-23 08:42:33 +00:00
|
|
|
@@ -138,13 +138,6 @@ ostree_SOURCES += src/ostree/ot-builtin-pull.c
|
2019-07-30 23:47:09 +01:00
|
|
|
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
|
2022-02-23 08:42:33 +00:00
|
|
|
index 6bae65cf..47b3ab20 100644
|
2019-07-30 23:47:09 +01:00
|
|
|
--- a/Makefile-tests.am
|
|
|
|
+++ b/Makefile-tests.am
|
2022-02-23 08:42:33 +00:00
|
|
|
@@ -275,6 +275,13 @@ _installed_or_uninstalled_test_programs += \
|
2020-02-08 00:49:06 +00:00
|
|
|
$(NULL)
|
|
|
|
endif
|
2019-07-30 23:47:09 +01:00
|
|
|
|
|
|
|
+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
|
2022-02-23 08:42:33 +00:00
|
|
|
index 93b98cb9..a588eea6 100644
|
2019-07-30 23:47:09 +01:00
|
|
|
--- a/configure.ac
|
|
|
|
+++ b/configure.ac
|
2022-02-23 08:42:33 +00:00
|
|
|
@@ -186,14 +186,6 @@ if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libsoup"; fi
|
2019-07-30 23:47:09 +01:00
|
|
|
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)
|
2020-02-08 00:49:06 +00:00
|
|
|
-AS_IF([test x$enable_trivial_httpd_cmdline = xyes],
|
2019-07-30 23:47:09 +01:00
|
|
|
- [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.)])
|
|
|
|
])
|
2022-02-23 08:42:33 +00:00
|
|
|
@@ -606,7 +598,6 @@ echo "
|
|
|
|
introspection: $found_introspection
|
2019-07-30 23:47:09 +01:00
|
|
|
rofiles-fuse: $enable_rofiles_fuse
|
|
|
|
HTTP backend: $fetcher_backend
|
|
|
|
- \"ostree trivial-httpd\": $enable_trivial_httpd_cmdline
|
|
|
|
SELinux: $with_selinux
|
2022-02-23 08:42:33 +00:00
|
|
|
fs-verity: $ac_cv_header_linux_fsverity_h
|
2019-07-30 23:47:09 +01:00
|
|
|
cryptographic checksums: $with_crypto
|
|
|
|
diff --git a/man/ostree-trivial-httpd.xml b/man/ostree-trivial-httpd.xml
|
|
|
|
deleted file mode 100644
|
2022-02-23 08:42:33 +00:00
|
|
|
index 7ba1dae8..00000000
|
2019-07-30 23:47:09 +01:00
|
|
|
--- a/man/ostree-trivial-httpd.xml
|
|
|
|
+++ /dev/null
|
2022-02-23 08:42:33 +00:00
|
|
|
@@ -1,116 +0,0 @@
|
2019-07-30 23:47:09 +01:00
|
|
|
-<?xml version='1.0'?> <!--*-nxml-*-->
|
|
|
|
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
|
|
|
- "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
|
|
|
-
|
|
|
|
-<!--
|
|
|
|
-Copyright 2011,2013 Colin Walters <walters@verbum.org>
|
|
|
|
-
|
|
|
|
-SPDX-License-Identifier: LGPL-2.0+
|
|
|
|
-
|
|
|
|
-This library is free software; you can redistribute it and/or
|
|
|
|
-modify it under the terms of the GNU Lesser General Public
|
|
|
|
-License as published by the Free Software Foundation; either
|
|
|
|
-version 2 of the License, or (at your option) any later version.
|
|
|
|
-
|
|
|
|
-This library is distributed in the hope that it will be useful,
|
|
|
|
-but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
-Lesser General Public License for more details.
|
|
|
|
-
|
|
|
|
-You should have received a copy of the GNU Lesser General Public
|
2022-02-23 08:42:33 +00:00
|
|
|
-License along with this library. If not, see <https://www.gnu.org/licenses/>.
|
2019-07-30 23:47:09 +01:00
|
|
|
--->
|
|
|
|
-
|
|
|
|
-<refentry id="ostree">
|
|
|
|
-
|
|
|
|
- <refentryinfo>
|
|
|
|
- <title>ostree trivial-httpd</title>
|
|
|
|
- <productname>OSTree</productname>
|
|
|
|
-
|
|
|
|
- <authorgroup>
|
|
|
|
- <author>
|
|
|
|
- <contrib>Developer</contrib>
|
|
|
|
- <firstname>Colin</firstname>
|
|
|
|
- <surname>Walters</surname>
|
|
|
|
- <email>walters@verbum.org</email>
|
|
|
|
- </author>
|
|
|
|
- </authorgroup>
|
|
|
|
- </refentryinfo>
|
|
|
|
-
|
|
|
|
- <refmeta>
|
|
|
|
- <refentrytitle>ostree trivial-httpd</refentrytitle>
|
|
|
|
- <manvolnum>1</manvolnum>
|
|
|
|
- </refmeta>
|
|
|
|
-
|
|
|
|
- <refnamediv>
|
|
|
|
- <refname>ostree-trivial-httpd</refname>
|
|
|
|
- <refpurpose>Simple webserver</refpurpose>
|
|
|
|
- </refnamediv>
|
|
|
|
-
|
|
|
|
- <refsynopsisdiv>
|
|
|
|
- <cmdsynopsis>
|
|
|
|
- <command>ostree trivial-httpd</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt">DIR</arg>
|
|
|
|
- </cmdsynopsis>
|
|
|
|
- </refsynopsisdiv>
|
|
|
|
-
|
|
|
|
-<!-- Don't entirely understand this command. Needs details, better content-->
|
|
|
|
- <refsect1>
|
|
|
|
- <title>Description</title>
|
|
|
|
-
|
|
|
|
- <para>
|
|
|
|
- This runs a simple webserver and keeps it running until killed. If DIR is not specified, it defaults to the current directory.
|
|
|
|
- </para>
|
|
|
|
- </refsect1>
|
|
|
|
-
|
|
|
|
- <refsect1>
|
|
|
|
- <title>Options</title>
|
|
|
|
-
|
|
|
|
- <variablelist>
|
|
|
|
- <varlistentry>
|
|
|
|
- <term><option>--daemonize</option>,<option>-d</option></term>
|
|
|
|
-
|
|
|
|
- <listitem><para>
|
|
|
|
- Fork into background when ready.
|
|
|
|
- </para></listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
-
|
|
|
|
- <varlistentry>
|
|
|
|
- <term><option>--autoexit</option></term>
|
|
|
|
-
|
|
|
|
- <listitem><para>
|
|
|
|
- Automatically exit when directory is deleted.
|
|
|
|
- </para></listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
-
|
|
|
|
- <varlistentry>
|
|
|
|
- <term><option>--port-file</option>,<option>-p</option>="PATH"</term>
|
|
|
|
-
|
|
|
|
- <listitem><para>
|
|
|
|
- Write port number to PATH (- for standard output).
|
|
|
|
- </para></listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
-
|
|
|
|
- <varlistentry>
|
|
|
|
- <term><option>--port</option>,<option>-P</option></term>
|
|
|
|
-
|
|
|
|
- <listitem><para>
|
|
|
|
- Use the specified TCP port to listen on.
|
|
|
|
- </para></listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
-
|
|
|
|
- <varlistentry>
|
|
|
|
- <term><option>--force-range-requests</option></term>
|
|
|
|
-
|
|
|
|
- <listitem><para>
|
|
|
|
- Force range requests by only serving half of files.
|
|
|
|
- </para></listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
- </variablelist>
|
|
|
|
- </refsect1>
|
|
|
|
-
|
|
|
|
-<!-- NEED EXAMPLE OUTPUT HERE!-->
|
|
|
|
- <refsect1>
|
|
|
|
- <title>Example</title>
|
|
|
|
- <para><command>$ ostree trivial-httpd</command></para>
|
|
|
|
- </refsect1>
|
|
|
|
-</refentry>
|
|
|
|
diff --git a/src/ostree/main.c b/src/ostree/main.c
|
2022-02-23 08:42:33 +00:00
|
|
|
index 7d17080c..19d9b8b0 100644
|
2019-07-30 23:47:09 +01:00
|
|
|
--- a/src/ostree/main.c
|
|
|
|
+++ b/src/ostree/main.c
|
2020-02-08 00:49:06 +00:00
|
|
|
@@ -118,11 +118,6 @@ static OstreeCommand commands[] = {
|
2019-07-30 23:47:09 +01:00
|
|
|
{ "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
|
2022-02-23 08:42:33 +00:00
|
|
|
index 686f08dc..79f8bd1f 100755
|
2019-07-30 23:47:09 +01:00
|
|
|
--- a/tests/libtest.sh
|
|
|
|
+++ b/tests/libtest.sh
|
2022-02-23 08:42:33 +00:00
|
|
|
@@ -174,15 +174,12 @@ fi
|
2019-07-30 23:47:09 +01:00
|
|
|
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() {
|
|
|
|
--
|
2022-02-23 08:42:33 +00:00
|
|
|
2.35.1
|
2019-07-30 23:47:09 +01:00
|
|
|
|