diff --git a/Makefile-decls.am b/Makefile-decls.am index e41586d1..06018594 100644 --- a/Makefile-decls.am +++ b/Makefile-decls.am @@ -30,6 +30,7 @@ sbin_PROGRAMS = bin_SCRIPTS = lib_LTLIBRARIES = libexec_PROGRAMS = +pkglibexec_PROGRAMS = pkglibexec_SCRIPTS = noinst_LTLIBRARIES = noinst_PROGRAMS = diff --git a/Makefile-libostree.am b/Makefile-libostree.am index a7d7b11b..88210c75 100644 --- a/Makefile-libostree.am +++ b/Makefile-libostree.am @@ -161,6 +161,8 @@ if USE_LIBSOUP libostree_1_la_SOURCES += \ src/libostree/ostree-fetcher.h \ src/libostree/ostree-fetcher.c \ + src/libostree/ostree-fetcher-util.h \ + src/libostree/ostree-fetcher-util.c \ src/libostree/ostree-metalink.h \ src/libostree/ostree-metalink.c \ $(NULL) diff --git a/Makefile-ostree.am b/Makefile-ostree.am index e6b1eabe..05fec155 100644 --- a/Makefile-ostree.am +++ b/Makefile-ostree.am @@ -102,20 +102,25 @@ src/ostree/parse-datetime.c: src/ostree/parse-datetime.y Makefile EXTRA_DIST += src/ostree/parse-datetime.y CLEANFILES += src/ostree/parse-datetime.c -ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree \ - $(NULL) -ostree_bin_shared_ldadd = libglnx.la libbsdiff.la libotutil.la libostree-kernel-args.la libostree-1.la +ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree \ + -I$(srcdir)/src/ostree -I$(srcdir)/libglnx $(OT_INTERNAL_GIO_UNIX_CFLAGS) \ + -DPKGLIBEXECDIR=\"$(pkglibexecdir)\" +ostree_bin_shared_ldadd = $(AM_LDFLAGS) libglnx.la libotutil.la libostree-1.la \ + $(OT_INTERNAL_GIO_UNIX_LIBS) + +ostree_CFLAGS = $(ostree_bin_shared_cflags) +ostree_LDADD = $(ostree_bin_shared_ldadd) libbsdiff.la libostree-kernel-args.la $(LIBSYSTEMD_LIBS) -ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx -ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS) $(LIBSYSTEMD_LIBS) if USE_LIBSOUP -ostree_SOURCES += \ - src/ostree/ot-builtin-pull.c \ - src/ostree/ot-builtin-trivial-httpd.c \ - $(NULL) +ostree_SOURCES += src/ostree/ot-builtin-pull.c src/ostree/ot-builtin-trivial-httpd.c ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS) ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS) + +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) endif if USE_LIBARCHIVE diff --git a/Makefile-tests.am b/Makefile-tests.am index 1f9cad48..a0c05488 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -28,6 +28,7 @@ EXTRA_DIST += \ # include the builddir in $PATH so we find our just-built ostree # binary. TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \ + OSTREE_UNINSTALLED=$(abs_top_builddir) \ G_DEBUG=fatal-warnings \ GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH} \ LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd)$${LD_LIBRARY_PATH:+:$${LD_LIBRARY_PATH}} \ @@ -44,6 +45,7 @@ dist_uninstalled_test_scripts = tests/test-symbols.sh dist_test_scripts = \ tests/test-basic.sh \ + tests/test-basic-user.sh \ tests/test-pull-subpath.sh \ tests/test-archivez.sh \ tests/test-remote-add.sh \ @@ -64,6 +66,7 @@ dist_test_scripts = \ tests/test-pull-resume.sh \ tests/test-pull-repeated.sh \ tests/test-pull-untrusted.sh \ + tests/test-pull-many.sh \ tests/test-pull-override-url.sh \ tests/test-local-pull.sh \ tests/test-local-pull-depth.sh \ @@ -118,16 +121,17 @@ dist_installed_test_data = tests/archive-test.sh \ tests/pull-test.sh \ tests/admin-test.sh \ tests/basic-test.sh \ - tests/test-basic-user.sh \ - tests/corrupt-repo-ref.js \ tests/pre-endian-deltas-repo-big.tar.xz \ tests/pre-endian-deltas-repo-little.tar.xz \ $(NULL) EXTRA_DIST += tests/libtest.sh -dist_test_extra_scripts = tests/bootloader-entries-crosscheck.py \ - tests/ostree-grub-generator +dist_test_extra_scripts = \ + tests/bootloader-entries-crosscheck.py \ + tests/corrupt-repo-ref.js \ + tests/ostree-grub-generator \ + $(NULL) # We can't use nobase_ as we need to strip off the tests/, can't # use plain installed_ as we do need the gpghome/ prefix. diff --git a/Makefile.in b/Makefile.in index b471c3a0..20cc20a6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -340,9 +340,10 @@ host_triplet = @host@ bin_PROGRAMS = ostree$(EXEEXT) $(am__EXEEXT_1) sbin_PROGRAMS = libexec_PROGRAMS = +pkglibexec_PROGRAMS = $(am__EXEEXT_11) noinst_PROGRAMS = $(am__EXEEXT_8) tests/test-rollsum-cli$(EXEEXT) ostree_boot_PROGRAMS = $(am__EXEEXT_9) $(am__EXEEXT_10) -TESTS = $(am__EXEEXT_3) $(am__EXEEXT_12) \ +TESTS = $(am__EXEEXT_3) $(am__EXEEXT_13) \ $(dist_uninstalled_test_scripts) installed_test_PROGRAMS = $(am__EXEEXT_7) check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) @@ -389,6 +390,8 @@ check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) @USE_LIBSOUP_TRUE@am__append_21 = \ @USE_LIBSOUP_TRUE@ src/libostree/ostree-fetcher.h \ @USE_LIBSOUP_TRUE@ src/libostree/ostree-fetcher.c \ +@USE_LIBSOUP_TRUE@ src/libostree/ostree-fetcher-util.h \ +@USE_LIBSOUP_TRUE@ src/libostree/ostree-fetcher-util.c \ @USE_LIBSOUP_TRUE@ src/libostree/ostree-metalink.h \ @USE_LIBSOUP_TRUE@ src/libostree/ostree-metalink.c \ @USE_LIBSOUP_TRUE@ $(NULL) @@ -408,38 +411,38 @@ check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) @USE_LIBSOUP_TRUE@ src/ostree/ot-remote-builtin-delete-cookie.c \ @USE_LIBSOUP_TRUE@ src/ostree/ot-remote-builtin-list-cookies.c \ @USE_LIBSOUP_TRUE@ $(NULL) src/ostree/ot-builtin-pull.c \ -@USE_LIBSOUP_TRUE@ src/ostree/ot-builtin-trivial-httpd.c \ -@USE_LIBSOUP_TRUE@ $(NULL) +@USE_LIBSOUP_TRUE@ src/ostree/ot-builtin-trivial-httpd.c @USE_LIBSOUP_TRUE@am__append_33 = $(OT_INTERNAL_SOUP_CFLAGS) @USE_LIBSOUP_TRUE@am__append_34 = $(OT_INTERNAL_SOUP_LIBS) -@USE_LIBARCHIVE_TRUE@am__append_35 = $(OT_DEP_LIBARCHIVE_CFLAGS) -@USE_LIBARCHIVE_TRUE@am__append_36 = $(OT_DEP_LIBARCHIVE_LIBS) -@BUILDOPT_SYSTEMD_TRUE@am__append_37 = ostree-remount +@USE_LIBSOUP_TRUE@am__append_35 = ostree-trivial-httpd +@USE_LIBARCHIVE_TRUE@am__append_36 = $(OT_DEP_LIBARCHIVE_CFLAGS) +@USE_LIBARCHIVE_TRUE@am__append_37 = $(OT_DEP_LIBARCHIVE_LIBS) +@BUILDOPT_SYSTEMD_TRUE@am__append_38 = ostree-remount # It is built anyway as a side-effect of having the symlink in tests/, # and if we declare it here, it gets cleaned up properly -@BUILDOPT_SYSTEMD_FALSE@am__append_38 = ostree-remount -@BUILDOPT_USE_STATIC_COMPILER_FALSE@am__append_39 = ostree-prepare-root -@BUILDOPT_FUSE_TRUE@am__append_40 = rofiles-fuse -@BUILDOPT_ASAN_TRUE@am__append_41 = OT_SKIP_READDIR_RAND=1 G_SLICE=always-malloc -@BUILDOPT_FUSE_TRUE@am__append_42 = tests/test-rofiles-fuse.sh -@BUILDOPT_FUSE_FALSE@am__append_43 = tests/test-rofiles-fuse.sh -@USE_LIBSOUP_TRUE@am__append_44 = tests/test-remote-cookies.sh -@BUILDOPT_GJS_TRUE@am__append_45 = $(js_tests) -@BUILDOPT_GJS_FALSE@am__append_46 = $(js_tests) -@BUILDOPT_GJS_FALSE@am__append_47 = $(js_installed_tests) -@ENABLE_INSTALLED_TESTS_FALSE@am__append_48 = -rpath $(abs_builddir) -@USE_LIBARCHIVE_TRUE@am__append_49 = tests/test-libarchive-import -@ENABLE_INSTALLED_TESTS_TRUE@am__append_50 = install-installed-tests-extra +@BUILDOPT_SYSTEMD_FALSE@am__append_39 = ostree-remount +@BUILDOPT_USE_STATIC_COMPILER_FALSE@am__append_40 = ostree-prepare-root +@BUILDOPT_FUSE_TRUE@am__append_41 = rofiles-fuse +@BUILDOPT_ASAN_TRUE@am__append_42 = OT_SKIP_READDIR_RAND=1 G_SLICE=always-malloc +@BUILDOPT_FUSE_TRUE@am__append_43 = tests/test-rofiles-fuse.sh +@BUILDOPT_FUSE_FALSE@am__append_44 = tests/test-rofiles-fuse.sh +@USE_LIBSOUP_TRUE@am__append_45 = tests/test-remote-cookies.sh +@BUILDOPT_GJS_TRUE@am__append_46 = $(js_tests) +@BUILDOPT_GJS_FALSE@am__append_47 = $(js_tests) +@BUILDOPT_GJS_FALSE@am__append_48 = $(js_installed_tests) +@ENABLE_INSTALLED_TESTS_FALSE@am__append_49 = -rpath $(abs_builddir) +@USE_LIBARCHIVE_TRUE@am__append_50 = tests/test-libarchive-import +@ENABLE_INSTALLED_TESTS_TRUE@am__append_51 = install-installed-tests-extra # Allow the distcheck install under $prefix test to pass -@BUILDOPT_SYSTEMD_TRUE@am__append_51 = --with-systemdsystemunitdir='$${libdir}/systemd/system' +@BUILDOPT_SYSTEMD_TRUE@am__append_52 = --with-systemdsystemunitdir='$${libdir}/systemd/system' # We're using the system grub2-mkconfig generator -@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_52 = src/boot/grub2/grub2-15_ostree -@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_53 = install-grub2-config-hook -@BUILDOPT_FUSE_TRUE@@ENABLE_MAN_TRUE@am__append_54 = rofiles-fuse.1 -@ENABLE_MAN_TRUE@am__append_55 = $(man1_MANS) $(man5_MANS) $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml) -@ENABLE_MAN_TRUE@am__append_56 = \ +@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_53 = src/boot/grub2/grub2-15_ostree +@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_54 = install-grub2-config-hook +@BUILDOPT_FUSE_TRUE@@ENABLE_MAN_TRUE@am__append_55 = rofiles-fuse.1 +@ENABLE_MAN_TRUE@am__append_56 = $(man1_MANS) $(man5_MANS) $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml) +@ENABLE_MAN_TRUE@am__append_57 = \ @ENABLE_MAN_TRUE@ $(man1_MANS) \ @ENABLE_MAN_TRUE@ $(man5_MANS) \ @ENABLE_MAN_TRUE@ $(NULL) @@ -500,8 +503,9 @@ am__installdirs = "$(DESTDIR)$(installed_testdir)" \ "$(DESTDIR)$(libdir)" "$(DESTDIR)$(privlibdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(installed_testdir)" \ "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(ostree_bootdir)" \ - "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(dracutmoddir)" "$(DESTDIR)$(installed_testdir)" \ + "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(sbindir)" \ + "$(DESTDIR)$(bindir)" "$(DESTDIR)$(dracutmoddir)" \ + "$(DESTDIR)$(installed_testdir)" \ "$(DESTDIR)$(mkinitcpioinstalldir)" \ "$(DESTDIR)$(ostree_bootdir)" "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ @@ -628,6 +632,8 @@ am__libostree_1_la_SOURCES_DIST = src/libostree/ostree-enumtypes.h \ src/libostree/ostree-tls-cert-interaction.c \ src/libostree/ostree-tls-cert-interaction.h \ src/libostree/ostree-fetcher.h src/libostree/ostree-fetcher.c \ + src/libostree/ostree-fetcher-util.h \ + src/libostree/ostree-fetcher-util.c \ src/libostree/ostree-metalink.h \ src/libostree/ostree-metalink.c am__objects_2 = src/libostree/libostree_1_la-ostree-enumtypes.lo \ @@ -637,6 +643,7 @@ am__objects_2 = src/libostree/libostree_1_la-ostree-enumtypes.lo \ @HAVE_LIBSOUP_CLIENT_CERTS_TRUE@am__objects_4 = src/libostree/libostree_1_la-ostree-tls-cert-interaction.lo \ @HAVE_LIBSOUP_CLIENT_CERTS_TRUE@ $(am__objects_1) @USE_LIBSOUP_TRUE@am__objects_5 = src/libostree/libostree_1_la-ostree-fetcher.lo \ +@USE_LIBSOUP_TRUE@ src/libostree/libostree_1_la-ostree-fetcher-util.lo \ @USE_LIBSOUP_TRUE@ src/libostree/libostree_1_la-ostree-metalink.lo \ @USE_LIBSOUP_TRUE@ $(am__objects_1) am_libostree_1_la_OBJECTS = $(am__objects_2) \ @@ -698,8 +705,10 @@ libostree_kernel_args_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libostree_kernel_args_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -am__DEPENDENCIES_9 = $(ostree_bin_shared_ldadd) $(am__DEPENDENCIES_2) -libostreetest_la_DEPENDENCIES = $(am__DEPENDENCIES_9) +am__DEPENDENCIES_9 = libglnx.la libotutil.la libostree-1.la \ + $(am__DEPENDENCIES_2) +am__DEPENDENCIES_10 = $(am__DEPENDENCIES_9) $(am__DEPENDENCIES_2) +libostreetest_la_DEPENDENCIES = $(am__DEPENDENCIES_10) am_libostreetest_la_OBJECTS = tests/libostreetest_la-libostreetest.lo libostreetest_la_OBJECTS = $(am_libostreetest_la_OBJECTS) libostreetest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ @@ -759,9 +768,10 @@ am__EXEEXT_4 = $(am__EXEEXT_3) @ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__EXEEXT_8 = $(am__EXEEXT_4) @BUILDOPT_SYSTEMD_TRUE@am__EXEEXT_9 = ostree-remount$(EXEEXT) @BUILDOPT_USE_STATIC_COMPILER_FALSE@am__EXEEXT_10 = ostree-prepare-root$(EXEEXT) +@USE_LIBSOUP_TRUE@am__EXEEXT_11 = ostree-trivial-httpd$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(installed_test_PROGRAMS) \ $(libexec_PROGRAMS) $(noinst_PROGRAMS) $(ostree_boot_PROGRAMS) \ - $(sbin_PROGRAMS) + $(pkglibexec_PROGRAMS) $(sbin_PROGRAMS) am__ostree_SOURCES_DIST = src/ostree/main.c \ src/ostree/ot-builtin-admin.c src/ostree/ot-builtins.h \ src/ostree/ot-builtin-cat.c src/ostree/ot-builtin-config.c \ @@ -817,8 +827,7 @@ am__ostree_SOURCES_DIST = src/ostree/main.c \ @USE_LIBSOUP_TRUE@ src/ostree/ostree-ot-remote-builtin-list-cookies.$(OBJEXT) \ @USE_LIBSOUP_TRUE@ $(am__objects_1) \ @USE_LIBSOUP_TRUE@ src/ostree/ostree-ot-builtin-pull.$(OBJEXT) \ -@USE_LIBSOUP_TRUE@ src/ostree/ostree-ot-builtin-trivial-httpd.$(OBJEXT) \ -@USE_LIBSOUP_TRUE@ $(am__objects_1) +@USE_LIBSOUP_TRUE@ src/ostree/ostree-ot-builtin-trivial-httpd.$(OBJEXT) am_ostree_OBJECTS = src/ostree/ostree-main.$(OBJEXT) \ src/ostree/ostree-ot-builtin-admin.$(OBJEXT) \ src/ostree/ostree-ot-builtin-cat.$(OBJEXT) \ @@ -872,9 +881,9 @@ am_ostree_OBJECTS = src/ostree/ostree-main.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-summary.$(OBJEXT) \ $(am__objects_1) $(am__objects_6) ostree_OBJECTS = $(am_ostree_OBJECTS) -ostree_DEPENDENCIES = $(ostree_bin_shared_ldadd) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_6) \ - $(am__DEPENDENCIES_4) +ostree_DEPENDENCIES = $(am__DEPENDENCIES_9) libbsdiff.la \ + libostree-kernel-args.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_6) $(am__DEPENDENCIES_4) ostree_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(ostree_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -895,6 +904,16 @@ ostree_remount_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(ostree_remount_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ +am__ostree_trivial_httpd_SOURCES_DIST = \ + src/ostree/ostree-trivial-httpd.c +@USE_LIBSOUP_TRUE@am_ostree_trivial_httpd_OBJECTS = src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.$(OBJEXT) +ostree_trivial_httpd_OBJECTS = $(am_ostree_trivial_httpd_OBJECTS) +@USE_LIBSOUP_TRUE@ostree_trivial_httpd_DEPENDENCIES = \ +@USE_LIBSOUP_TRUE@ $(am__DEPENDENCIES_9) $(am__DEPENDENCIES_2) +ostree_trivial_httpd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(ostree_trivial_httpd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ am__rofiles_fuse_SOURCES_DIST = src/rofiles-fuse/main.c @BUILDOPT_FUSE_TRUE@am_rofiles_fuse_OBJECTS = src/rofiles-fuse/rofiles_fuse-main.$(OBJEXT) rofiles_fuse_OBJECTS = $(am_rofiles_fuse_OBJECTS) @@ -907,8 +926,8 @@ rofiles_fuse_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ tests_test_basic_c_SOURCES = tests/test-basic-c.c tests_test_basic_c_OBJECTS = \ tests/tests_test_basic_c-test-basic-c.$(OBJEXT) -am__DEPENDENCIES_10 = $(am__DEPENDENCIES_9) libostreetest.la -tests_test_basic_c_DEPENDENCIES = $(am__DEPENDENCIES_10) +am__DEPENDENCIES_11 = $(am__DEPENDENCIES_10) libostreetest.la +tests_test_basic_c_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_basic_c_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_basic_c_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -916,7 +935,7 @@ tests_test_basic_c_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_bsdiff_SOURCES = tests/test-bsdiff.c tests_test_bsdiff_OBJECTS = \ tests/tests_test_bsdiff-test-bsdiff.$(OBJEXT) -tests_test_bsdiff_DEPENDENCIES = libbsdiff.la $(am__DEPENDENCIES_10) +tests_test_bsdiff_DEPENDENCIES = libbsdiff.la $(am__DEPENDENCIES_11) tests_test_bsdiff_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_bsdiff_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ @@ -925,7 +944,7 @@ am_tests_test_checksum_OBJECTS = \ src/libostree/tests_test_checksum-ostree-core.$(OBJEXT) \ tests/tests_test_checksum-test-checksum.$(OBJEXT) tests_test_checksum_OBJECTS = $(am_tests_test_checksum_OBJECTS) -tests_test_checksum_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_checksum_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_checksum_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_checksum_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -933,7 +952,7 @@ tests_test_checksum_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ am_tests_test_gpg_verify_result_OBJECTS = tests/tests_test_gpg_verify_result-test-gpg-verify-result.$(OBJEXT) tests_test_gpg_verify_result_OBJECTS = \ $(am_tests_test_gpg_verify_result_OBJECTS) -tests_test_gpg_verify_result_DEPENDENCIES = $(am__DEPENDENCIES_10) \ +tests_test_gpg_verify_result_DEPENDENCIES = $(am__DEPENDENCIES_11) \ $(am__DEPENDENCIES_3) tests_test_gpg_verify_result_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -942,7 +961,7 @@ tests_test_gpg_verify_result_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_keyfile_utils_SOURCES = tests/test-keyfile-utils.c tests_test_keyfile_utils_OBJECTS = \ tests/tests_test_keyfile_utils-test-keyfile-utils.$(OBJEXT) -tests_test_keyfile_utils_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_keyfile_utils_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_keyfile_utils_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_keyfile_utils_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -950,7 +969,7 @@ tests_test_keyfile_utils_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ am_tests_test_libarchive_import_OBJECTS = tests/tests_test_libarchive_import-test-libarchive-import.$(OBJEXT) tests_test_libarchive_import_OBJECTS = \ $(am_tests_test_libarchive_import_OBJECTS) -tests_test_libarchive_import_DEPENDENCIES = $(am__DEPENDENCIES_10) \ +tests_test_libarchive_import_DEPENDENCIES = $(am__DEPENDENCIES_11) \ $(am__DEPENDENCIES_1) tests_test_libarchive_import_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -962,7 +981,7 @@ am_tests_test_lzma_OBJECTS = \ src/libostree/tests_test_lzma-ostree-lzma-decompressor.$(OBJEXT) \ tests/tests_test_lzma-test-lzma.$(OBJEXT) tests_test_lzma_OBJECTS = $(am_tests_test_lzma_OBJECTS) -tests_test_lzma_DEPENDENCIES = $(am__DEPENDENCIES_10) \ +tests_test_lzma_DEPENDENCIES = $(am__DEPENDENCIES_11) \ $(am__DEPENDENCIES_1) tests_test_lzma_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -971,7 +990,7 @@ tests_test_lzma_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_mutable_tree_SOURCES = tests/test-mutable-tree.c tests_test_mutable_tree_OBJECTS = \ tests/tests_test_mutable_tree-test-mutable-tree.$(OBJEXT) -tests_test_mutable_tree_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_mutable_tree_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_mutable_tree_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_mutable_tree_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -979,7 +998,7 @@ tests_test_mutable_tree_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_ot_opt_utils_SOURCES = tests/test-ot-opt-utils.c tests_test_ot_opt_utils_OBJECTS = \ tests/tests_test_ot_opt_utils-test-ot-opt-utils.$(OBJEXT) -tests_test_ot_opt_utils_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_ot_opt_utils_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_ot_opt_utils_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_ot_opt_utils_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -987,7 +1006,7 @@ tests_test_ot_opt_utils_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_ot_tool_util_SOURCES = tests/test-ot-tool-util.c tests_test_ot_tool_util_OBJECTS = \ tests/tests_test_ot_tool_util-test-ot-tool-util.$(OBJEXT) -tests_test_ot_tool_util_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_ot_tool_util_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_ot_tool_util_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_ot_tool_util_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -995,7 +1014,7 @@ tests_test_ot_tool_util_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_ot_unix_utils_SOURCES = tests/test-ot-unix-utils.c tests_test_ot_unix_utils_OBJECTS = \ tests/tests_test_ot_unix_utils-test-ot-unix-utils.$(OBJEXT) -tests_test_ot_unix_utils_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_ot_unix_utils_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_ot_unix_utils_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_ot_unix_utils_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -1003,7 +1022,7 @@ tests_test_ot_unix_utils_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_pull_c_SOURCES = tests/test-pull-c.c tests_test_pull_c_OBJECTS = \ tests/tests_test_pull_c-test-pull-c.$(OBJEXT) -tests_test_pull_c_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_pull_c_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_pull_c_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_pull_c_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ @@ -1013,7 +1032,7 @@ am_tests_test_rollsum_OBJECTS = \ tests/tests_test_rollsum-test-rollsum.$(OBJEXT) tests_test_rollsum_OBJECTS = $(am_tests_test_rollsum_OBJECTS) tests_test_rollsum_DEPENDENCIES = libbupsplit.la \ - $(am__DEPENDENCIES_10) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_11) $(am__DEPENDENCIES_1) tests_test_rollsum_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_rollsum_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -1023,7 +1042,7 @@ am_tests_test_rollsum_cli_OBJECTS = \ tests/tests_test_rollsum_cli-test-rollsum-cli.$(OBJEXT) tests_test_rollsum_cli_OBJECTS = $(am_tests_test_rollsum_cli_OBJECTS) tests_test_rollsum_cli_DEPENDENCIES = libbupsplit.la \ - $(am__DEPENDENCIES_10) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_11) $(am__DEPENDENCIES_1) tests_test_rollsum_cli_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_rollsum_cli_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -1031,7 +1050,7 @@ tests_test_rollsum_cli_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ tests_test_sysroot_c_SOURCES = tests/test-sysroot-c.c tests_test_sysroot_c_OBJECTS = \ tests/tests_test_sysroot_c-test-sysroot-c.$(OBJEXT) -tests_test_sysroot_c_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_sysroot_c_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_sysroot_c_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_sysroot_c_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -1040,7 +1059,7 @@ am_tests_test_varint_OBJECTS = \ src/libostree/tests_test_varint-ostree-varint.$(OBJEXT) \ tests/tests_test_varint-test-varint.$(OBJEXT) tests_test_varint_OBJECTS = $(am_tests_test_varint_OBJECTS) -tests_test_varint_DEPENDENCIES = $(am__DEPENDENCIES_10) +tests_test_varint_DEPENDENCIES = $(am__DEPENDENCIES_11) tests_test_varint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(tests_test_varint_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ @@ -1088,8 +1107,9 @@ SOURCES = $(libbsdiff_la_SOURCES) $(libbupsplit_la_SOURCES) \ $(libostreetest_la_SOURCES) $(libotutil_la_SOURCES) \ $(libreaddir_rand_la_SOURCES) $(ostree_SOURCES) \ $(ostree_prepare_root_SOURCES) $(ostree_remount_SOURCES) \ - $(rofiles_fuse_SOURCES) tests/test-basic-c.c \ - tests/test-bsdiff.c $(tests_test_checksum_SOURCES) \ + $(ostree_trivial_httpd_SOURCES) $(rofiles_fuse_SOURCES) \ + tests/test-basic-c.c tests/test-bsdiff.c \ + $(tests_test_checksum_SOURCES) \ $(tests_test_gpg_verify_result_SOURCES) \ tests/test-keyfile-utils.c \ $(tests_test_libarchive_import_SOURCES) \ @@ -1105,6 +1125,7 @@ DIST_SOURCES = $(libbsdiff_la_SOURCES) $(libbupsplit_la_SOURCES) \ $(libostreetest_la_SOURCES) $(libotutil_la_SOURCES) \ $(libreaddir_rand_la_SOURCES) $(am__ostree_SOURCES_DIST) \ $(ostree_prepare_root_SOURCES) $(ostree_remount_SOURCES) \ + $(am__ostree_trivial_httpd_SOURCES_DIST) \ $(am__rofiles_fuse_SOURCES_DIST) tests/test-basic-c.c \ tests/test-bsdiff.c $(tests_test_checksum_SOURCES) \ $(tests_test_gpg_verify_result_SOURCES) \ @@ -1333,20 +1354,21 @@ am__set_TESTS_bases = \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) -am__EXEEXT_11 = -am__EXEEXT_12 = tests/test-basic.sh tests/test-pull-subpath.sh \ - tests/test-archivez.sh tests/test-remote-add.sh \ - tests/test-remote-headers.sh tests/test-remote-gpg-import.sh \ - tests/test-commit-sign.sh tests/test-export.sh \ - tests/test-help.sh tests/test-libarchive.sh \ - tests/test-parent.sh tests/test-pull-archive-z.sh \ - tests/test-pull-commit-only.sh tests/test-pull-depth.sh \ - tests/test-pull-mirror-summary.sh \ +am__EXEEXT_12 = +am__EXEEXT_13 = tests/test-basic.sh tests/test-basic-user.sh \ + tests/test-pull-subpath.sh tests/test-archivez.sh \ + tests/test-remote-add.sh tests/test-remote-headers.sh \ + tests/test-remote-gpg-import.sh tests/test-commit-sign.sh \ + tests/test-export.sh tests/test-help.sh \ + tests/test-libarchive.sh tests/test-parent.sh \ + tests/test-pull-archive-z.sh tests/test-pull-commit-only.sh \ + tests/test-pull-depth.sh tests/test-pull-mirror-summary.sh \ tests/test-pull-large-metadata.sh tests/test-pull-metalink.sh \ tests/test-pull-summary-sigs.sh tests/test-pull-resume.sh \ tests/test-pull-repeated.sh tests/test-pull-untrusted.sh \ - tests/test-pull-override-url.sh tests/test-local-pull.sh \ - tests/test-local-pull-depth.sh tests/test-gpg-signed-commit.sh \ + tests/test-pull-many.sh tests/test-pull-override-url.sh \ + tests/test-local-pull.sh tests/test-local-pull-depth.sh \ + tests/test-gpg-signed-commit.sh \ tests/test-admin-upgrade-unconfigured.sh \ tests/test-admin-deploy-syslinux.sh \ tests/test-admin-deploy-2.sh tests/test-admin-deploy-karg.sh \ @@ -1365,8 +1387,8 @@ am__EXEEXT_12 = tests/test-basic.sh tests/test-pull-subpath.sh \ tests/test-auto-summary.sh tests/test-prune.sh \ tests/test-refs.sh tests/test-demo-buildsystem.sh \ tests/test-switchroot.sh tests/test-pull-contenturl.sh \ - tests/test-pull-mirrorlist.sh $(am__EXEEXT_11) \ - $(am__append_42) $(am__append_44) $(am__append_45) + tests/test-pull-mirrorlist.sh $(am__EXEEXT_12) \ + $(am__append_43) $(am__append_45) $(am__append_46) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) @@ -1642,7 +1664,7 @@ AM_CPPFLAGS = -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"' \ -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_2_48 AM_CFLAGS = -std=gnu99 $(WARN_CFLAGS) AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man \ - --disable-maintainer-mode $(NULL) $(am__append_51) + --disable-maintainer-mode $(NULL) $(am__append_52) SUBDIRS = . $(am__append_14) NULL = BUILT_SOURCES = $(ENUM_GENERATED) @@ -1654,7 +1676,7 @@ CLEANFILES = $(am__append_13) $(BUILT_SOURCES) $(am__append_31) \ tests/ostree-remount-symlink-stamp \ tests/rofiles-fuse-symlink-stamp tests/ostree \ tests/ostree-prepare-root tests/ostree-remount \ - tests/rofiles-fuse $(am__append_56) + tests/rofiles-fuse $(am__append_57) EXTRA_DIST = $(all_dist_test_scripts) $(all_dist_test_data) autogen.sh \ COPYING README.md libglnx/README.md libglnx/COPYING \ libglnx/libglnx.m4 $(NULL) libglnx/Makefile-libglnx.am \ @@ -1668,17 +1690,17 @@ EXTRA_DIST = $(all_dist_test_scripts) $(all_dist_test_data) autogen.sh \ src/libostree/ostree-repo-deprecated.h \ src/ostree/parse-datetime.y buildutil/tap-driver.sh \ buildutil/tap-test tests/glib.supp tests/ostree.supp $(NULL) \ - $(am__append_43) $(am__append_46) tests/libtest.sh \ - $(am__append_47) tests/libostreetest.h tests/libtest.sh \ + $(am__append_44) $(am__append_47) tests/libtest.sh \ + $(am__append_48) tests/libostreetest.h tests/libtest.sh \ tests/gpg-verify-data/README.md $(NULL) \ src/boot/dracut/module-setup.sh src/boot/dracut/ostree.conf \ src/boot/mkinitcpio/ostree \ src/boot/ostree-prepare-root.service \ src/boot/ostree-remount.service src/boot/grub2/grub2-15_ostree \ - src/boot/grub2/ostree-grub-generator $(NULL) $(am__append_55) + src/boot/grub2/ostree-grub-generator $(NULL) $(am__append_56) bin_SCRIPTS = lib_LTLIBRARIES = libostree-1.la -pkglibexec_SCRIPTS = $(am__append_52) +pkglibexec_SCRIPTS = $(am__append_53) noinst_LTLIBRARIES = $(am__append_1) libglnx.la libbsdiff.la \ libotutil.la libostree-kernel-args.la libbupsplit.la \ libostreetest.la @@ -1701,12 +1723,13 @@ TESTS_ENVIRONMENT = G_TEST_SRCDIR="$(abs_srcdir)" \ G_TEST_BUILDDIR="$(abs_builddir)" UNINSTALLEDTESTS=1 \ G_DEBUG=gc-friendly MALLOC_CHECK_=2 \ MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) OT_TESTS_DEBUG=1 \ - G_DEBUG=fatal-warnings GI_TYPELIB_PATH=$$(cd $(top_builddir) \ - && pwd)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH} \ + OSTREE_UNINSTALLED=$(abs_top_builddir) G_DEBUG=fatal-warnings \ + GI_TYPELIB_PATH=$$(cd $(top_builddir) && \ + pwd)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH} \ LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && \ pwd)$${LD_LIBRARY_PATH:+:$${LD_LIBRARY_PATH}} PATH=$$(cd \ $(top_builddir)/tests && pwd):$${PATH} $(NULL) \ - $(am__append_41) + $(am__append_42) LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/buildutil/tap-driver.sh LOG_COMPILER = $(top_srcdir)/buildutil/tap-test installed_test_LTLIBRARIES = $(am__append_12) @@ -1746,8 +1769,8 @@ all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installe # This initializes some more variables # This is a special facility to chain together hooks easily -INSTALL_DATA_HOOKS = install-mkdir-remotes-d-hook $(am__append_50) \ - $(am__append_53) +INSTALL_DATA_HOOKS = install-mkdir-remotes-d-hook $(am__append_51) \ + $(am__append_54) ALL_LOCAL_RULES = tests/libreaddir-rand.so shortened_sysconfdir = $$(echo "$(sysconfdir)" | sed -e 's|^$(prefix)||' -e 's|^/||') ACLOCAL_AMFLAGS = -I buildutil -I libglnx ${ACLOCAL_FLAGS} @@ -2009,15 +2032,21 @@ ostree_SOURCES = src/ostree/main.c src/ostree/ot-builtin-admin.c \ src/ostree/ot-remote-builtin-refs.c \ src/ostree/ot-remote-builtin-summary.c $(NULL) \ $(am__append_32) -ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree \ - $(NULL) +ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree \ + -I$(srcdir)/src/ostree -I$(srcdir)/libglnx $(OT_INTERNAL_GIO_UNIX_CFLAGS) \ + -DPKGLIBEXECDIR=\"$(pkglibexecdir)\" -ostree_bin_shared_ldadd = libglnx.la libbsdiff.la libotutil.la libostree-kernel-args.la libostree-1.la -ostree_CFLAGS = $(ostree_bin_shared_cflags) \ - $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx \ - $(am__append_33) $(am__append_35) -ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS) \ - $(LIBSYSTEMD_LIBS) $(am__append_34) $(am__append_36) +ostree_bin_shared_ldadd = $(AM_LDFLAGS) libglnx.la libotutil.la libostree-1.la \ + $(OT_INTERNAL_GIO_UNIX_LIBS) + +ostree_CFLAGS = $(ostree_bin_shared_cflags) $(am__append_33) \ + $(am__append_36) +ostree_LDADD = $(ostree_bin_shared_ldadd) libbsdiff.la \ + libostree-kernel-args.la $(LIBSYSTEMD_LIBS) $(am__append_34) \ + $(am__append_37) +@USE_LIBSOUP_TRUE@ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c +@USE_LIBSOUP_TRUE@ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS) +@USE_LIBSOUP_TRUE@ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS) ostree_prepare_root_SOURCES = \ src/switchroot/ostree-mount-util.h \ src/switchroot/ostree-prepare-root.c \ @@ -2051,19 +2080,20 @@ uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-sym tests/ostree-remount-symlink-stamp tests/rofiles-fuse-symlink-stamp dist_uninstalled_test_scripts = tests/test-symbols.sh -dist_test_scripts = tests/test-basic.sh tests/test-pull-subpath.sh \ - tests/test-archivez.sh tests/test-remote-add.sh \ - tests/test-remote-headers.sh tests/test-remote-gpg-import.sh \ - tests/test-commit-sign.sh tests/test-export.sh \ - tests/test-help.sh tests/test-libarchive.sh \ - tests/test-parent.sh tests/test-pull-archive-z.sh \ - tests/test-pull-commit-only.sh tests/test-pull-depth.sh \ - tests/test-pull-mirror-summary.sh \ +dist_test_scripts = tests/test-basic.sh tests/test-basic-user.sh \ + tests/test-pull-subpath.sh tests/test-archivez.sh \ + tests/test-remote-add.sh tests/test-remote-headers.sh \ + tests/test-remote-gpg-import.sh tests/test-commit-sign.sh \ + tests/test-export.sh tests/test-help.sh \ + tests/test-libarchive.sh tests/test-parent.sh \ + tests/test-pull-archive-z.sh tests/test-pull-commit-only.sh \ + tests/test-pull-depth.sh tests/test-pull-mirror-summary.sh \ tests/test-pull-large-metadata.sh tests/test-pull-metalink.sh \ tests/test-pull-summary-sigs.sh tests/test-pull-resume.sh \ tests/test-pull-repeated.sh tests/test-pull-untrusted.sh \ - tests/test-pull-override-url.sh tests/test-local-pull.sh \ - tests/test-local-pull-depth.sh tests/test-gpg-signed-commit.sh \ + tests/test-pull-many.sh tests/test-pull-override-url.sh \ + tests/test-local-pull.sh tests/test-local-pull-depth.sh \ + tests/test-gpg-signed-commit.sh \ tests/test-admin-upgrade-unconfigured.sh \ tests/test-admin-deploy-syslinux.sh \ tests/test-admin-deploy-2.sh tests/test-admin-deploy-karg.sh \ @@ -2082,8 +2112,8 @@ dist_test_scripts = tests/test-basic.sh tests/test-pull-subpath.sh \ tests/test-auto-summary.sh tests/test-prune.sh \ tests/test-refs.sh tests/test-demo-buildsystem.sh \ tests/test-switchroot.sh tests/test-pull-contenturl.sh \ - tests/test-pull-mirrorlist.sh $(NULL) $(am__append_42) \ - $(am__append_44) $(am__append_45) + tests/test-pull-mirrorlist.sh $(NULL) $(am__append_43) \ + $(am__append_45) $(am__append_46) # These call into gjs scripts js_tests = tests/test-corruption.sh tests/test-pull-corruption.sh @@ -2091,14 +2121,15 @@ dist_installed_test_data = tests/archive-test.sh \ tests/pull-test.sh \ tests/admin-test.sh \ tests/basic-test.sh \ - tests/test-basic-user.sh \ - tests/corrupt-repo-ref.js \ tests/pre-endian-deltas-repo-big.tar.xz \ tests/pre-endian-deltas-repo-little.tar.xz \ $(NULL) -dist_test_extra_scripts = tests/bootloader-entries-crosscheck.py \ - tests/ostree-grub-generator +dist_test_extra_scripts = \ + tests/bootloader-entries-crosscheck.py \ + tests/corrupt-repo-ref.js \ + tests/ostree-grub-generator \ + $(NULL) # We can't use nobase_ as we need to strip off the tests/, can't @@ -2133,14 +2164,14 @@ libreaddir_rand_la_LIBADD = \ $(NULL) libreaddir_rand_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version \ - $(am__append_48) + $(am__append_49) test_programs = tests/test-varint tests/test-ot-unix-utils \ tests/test-bsdiff tests/test-mutable-tree \ tests/test-keyfile-utils tests/test-ot-opt-utils \ tests/test-ot-tool-util 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 \ - $(am__append_49) + $(am__append_50) common_tests_cflags = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx common_tests_ldadd = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS) libostreetest_la_SOURCES = tests/libostreetest.c @@ -2224,7 +2255,7 @@ tests_test_gpg_verify_result_LDADD = $(TESTS_LDADD) $(OT_INTERNAL_GPGME_LIBS) @ENABLE_MAN_TRUE@ ostree-reset.1 ostree-rev-parse.1 \ @ENABLE_MAN_TRUE@ ostree-show.1 ostree-summary.1 \ @ENABLE_MAN_TRUE@ ostree-static-delta.1 ostree-trivial-httpd.1 \ -@ENABLE_MAN_TRUE@ $(am__append_54) +@ENABLE_MAN_TRUE@ $(am__append_55) @ENABLE_MAN_TRUE@man5_files = ostree.repo.5 ostree.repo-config.5 @ENABLE_MAN_TRUE@man1_MANS = $(addprefix man/,$(man1_files)) @ENABLE_MAN_TRUE@man5_MANS = $(addprefix man/,$(man5_files)) @@ -2609,6 +2640,9 @@ src/libostree/libostree_1_la-ostree-tls-cert-interaction.lo: \ src/libostree/libostree_1_la-ostree-fetcher.lo: \ src/libostree/$(am__dirstamp) \ src/libostree/$(DEPDIR)/$(am__dirstamp) +src/libostree/libostree_1_la-ostree-fetcher-util.lo: \ + src/libostree/$(am__dirstamp) \ + src/libostree/$(DEPDIR)/$(am__dirstamp) src/libostree/libostree_1_la-ostree-metalink.lo: \ src/libostree/$(am__dirstamp) \ src/libostree/$(DEPDIR)/$(am__dirstamp) @@ -2895,6 +2929,55 @@ clean-ostree_bootPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkglibexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files + +clean-pkglibexecPROGRAMS: + @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ @@ -3134,6 +3217,13 @@ src/switchroot/ostree_remount-ostree-remount.$(OBJEXT): \ ostree-remount$(EXEEXT): $(ostree_remount_OBJECTS) $(ostree_remount_DEPENDENCIES) $(EXTRA_ostree_remount_DEPENDENCIES) @rm -f ostree-remount$(EXEEXT) $(AM_V_CCLD)$(ostree_remount_LINK) $(ostree_remount_OBJECTS) $(ostree_remount_LDADD) $(LIBS) +src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.$(OBJEXT): \ + src/ostree/$(am__dirstamp) \ + src/ostree/$(DEPDIR)/$(am__dirstamp) + +ostree-trivial-httpd$(EXEEXT): $(ostree_trivial_httpd_OBJECTS) $(ostree_trivial_httpd_DEPENDENCIES) $(EXTRA_ostree_trivial_httpd_DEPENDENCIES) + @rm -f ostree-trivial-httpd$(EXEEXT) + $(AM_V_CCLD)$(ostree_trivial_httpd_LINK) $(ostree_trivial_httpd_OBJECTS) $(ostree_trivial_httpd_LDADD) $(LIBS) src/rofiles-fuse/$(am__dirstamp): @$(MKDIR_P) src/rofiles-fuse @: > src/rofiles-fuse/$(am__dirstamp) @@ -3520,6 +3610,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/libostree/$(DEPDIR)/libostree_1_la-ostree-diff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libostree/$(DEPDIR)/libostree_1_la-ostree-dummy-enumtypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libostree/$(DEPDIR)/libostree_1_la-ostree-enumtypes.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libostree/$(DEPDIR)/libostree_1_la-ostree-fetcher-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libostree/$(DEPDIR)/libostree_1_la-ostree-fetcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libostree/$(DEPDIR)/libostree_1_la-ostree-gpg-verifier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/libostree/$(DEPDIR)/libostree_1_la-ostree-gpg-verify-result.Plo@am__quote@ @@ -3627,6 +3718,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-summary.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-parse-datetime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree_trivial_httpd-ostree-trivial-httpd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/rofiles-fuse/$(DEPDIR)/rofiles_fuse-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/switchroot/$(DEPDIR)/ostree_prepare_root-ostree-prepare-root.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/switchroot/$(DEPDIR)/ostree_remount-ostree-remount.Po@am__quote@ @@ -4065,6 +4157,13 @@ src/libostree/libostree_1_la-ostree-fetcher.lo: src/libostree/ostree-fetcher.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libostree_1_la_CFLAGS) $(CFLAGS) -c -o src/libostree/libostree_1_la-ostree-fetcher.lo `test -f 'src/libostree/ostree-fetcher.c' || echo '$(srcdir)/'`src/libostree/ostree-fetcher.c +src/libostree/libostree_1_la-ostree-fetcher-util.lo: src/libostree/ostree-fetcher-util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libostree_1_la_CFLAGS) $(CFLAGS) -MT src/libostree/libostree_1_la-ostree-fetcher-util.lo -MD -MP -MF src/libostree/$(DEPDIR)/libostree_1_la-ostree-fetcher-util.Tpo -c -o src/libostree/libostree_1_la-ostree-fetcher-util.lo `test -f 'src/libostree/ostree-fetcher-util.c' || echo '$(srcdir)/'`src/libostree/ostree-fetcher-util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libostree/$(DEPDIR)/libostree_1_la-ostree-fetcher-util.Tpo src/libostree/$(DEPDIR)/libostree_1_la-ostree-fetcher-util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libostree/ostree-fetcher-util.c' object='src/libostree/libostree_1_la-ostree-fetcher-util.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libostree_1_la_CFLAGS) $(CFLAGS) -c -o src/libostree/libostree_1_la-ostree-fetcher-util.lo `test -f 'src/libostree/ostree-fetcher-util.c' || echo '$(srcdir)/'`src/libostree/ostree-fetcher-util.c + src/libostree/libostree_1_la-ostree-metalink.lo: src/libostree/ostree-metalink.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libostree_1_la_CFLAGS) $(CFLAGS) -MT src/libostree/libostree_1_la-ostree-metalink.lo -MD -MP -MF src/libostree/$(DEPDIR)/libostree_1_la-ostree-metalink.Tpo -c -o src/libostree/libostree_1_la-ostree-metalink.lo `test -f 'src/libostree/ostree-metalink.c' || echo '$(srcdir)/'`src/libostree/ostree-metalink.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libostree/$(DEPDIR)/libostree_1_la-ostree-metalink.Tpo src/libostree/$(DEPDIR)/libostree_1_la-ostree-metalink.Plo @@ -4975,6 +5074,20 @@ src/switchroot/ostree_remount-ostree-remount.obj: src/switchroot/ostree-remount. @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_remount_CFLAGS) $(CFLAGS) -c -o src/switchroot/ostree_remount-ostree-remount.obj `if test -f 'src/switchroot/ostree-remount.c'; then $(CYGPATH_W) 'src/switchroot/ostree-remount.c'; else $(CYGPATH_W) '$(srcdir)/src/switchroot/ostree-remount.c'; fi` +src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.o: src/ostree/ostree-trivial-httpd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_trivial_httpd_CFLAGS) $(CFLAGS) -MT src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree_trivial_httpd-ostree-trivial-httpd.Tpo -c -o src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.o `test -f 'src/ostree/ostree-trivial-httpd.c' || echo '$(srcdir)/'`src/ostree/ostree-trivial-httpd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree_trivial_httpd-ostree-trivial-httpd.Tpo src/ostree/$(DEPDIR)/ostree_trivial_httpd-ostree-trivial-httpd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ostree-trivial-httpd.c' object='src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_trivial_httpd_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.o `test -f 'src/ostree/ostree-trivial-httpd.c' || echo '$(srcdir)/'`src/ostree/ostree-trivial-httpd.c + +src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.obj: src/ostree/ostree-trivial-httpd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_trivial_httpd_CFLAGS) $(CFLAGS) -MT src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree_trivial_httpd-ostree-trivial-httpd.Tpo -c -o src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.obj `if test -f 'src/ostree/ostree-trivial-httpd.c'; then $(CYGPATH_W) 'src/ostree/ostree-trivial-httpd.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ostree-trivial-httpd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree_trivial_httpd-ostree-trivial-httpd.Tpo src/ostree/$(DEPDIR)/ostree_trivial_httpd-ostree-trivial-httpd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ostree-trivial-httpd.c' object='src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_trivial_httpd_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.obj `if test -f 'src/ostree/ostree-trivial-httpd.c'; then $(CYGPATH_W) 'src/ostree/ostree-trivial-httpd.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ostree-trivial-httpd.c'; fi` + src/rofiles-fuse/rofiles_fuse-main.o: src/rofiles-fuse/main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rofiles_fuse_CFLAGS) $(CFLAGS) -MT src/rofiles-fuse/rofiles_fuse-main.o -MD -MP -MF src/rofiles-fuse/$(DEPDIR)/rofiles_fuse-main.Tpo -c -o src/rofiles-fuse/rofiles_fuse-main.o `test -f 'src/rofiles-fuse/main.c' || echo '$(srcdir)/'`src/rofiles-fuse/main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/rofiles-fuse/$(DEPDIR)/rofiles_fuse-main.Tpo src/rofiles-fuse/$(DEPDIR)/rofiles_fuse-main.Po @@ -6063,6 +6176,13 @@ tests/test-basic.sh.log: tests/test-basic.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/test-basic-user.sh.log: tests/test-basic-user.sh + @p='tests/test-basic-user.sh'; \ + b='tests/test-basic-user.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test-pull-subpath.sh.log: tests/test-pull-subpath.sh @p='tests/test-pull-subpath.sh'; \ b='tests/test-pull-subpath.sh'; \ @@ -6203,6 +6323,13 @@ tests/test-pull-untrusted.sh.log: tests/test-pull-untrusted.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/test-pull-many.sh.log: tests/test-pull-many.sh + @p='tests/test-pull-many.sh'; \ + b='tests/test-pull-many.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test-pull-override-url.sh.log: tests/test-pull-override-url.sh @p='tests/test-pull-override-url.sh'; \ b='tests/test-pull-override-url.sh'; \ @@ -6662,7 +6789,7 @@ install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(privlibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(ostree_bootdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(dracutmoddir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(mkinitcpioinstalldir)" "$(DESTDIR)$(ostree_bootdir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(gpginsttestdir)" "$(DESTDIR)$(gpginsttest_trusteddir)" "$(DESTDIR)$(gpgvinsttestdir)" "$(DESTDIR)$(dracutconfdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(gpgreadmedir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(installed_test_metadir)" "$(DESTDIR)$(mkinitcpioconfdir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(libostreeincludedir)"; do \ + for dir in "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(privlibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(ostree_bootdir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(dracutmoddir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(mkinitcpioinstalldir)" "$(DESTDIR)$(ostree_bootdir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(gpginsttestdir)" "$(DESTDIR)$(gpginsttest_trusteddir)" "$(DESTDIR)$(gpgvinsttestdir)" "$(DESTDIR)$(dracutconfdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(gpgreadmedir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(installed_test_metadir)" "$(DESTDIR)$(mkinitcpioconfdir)" "$(DESTDIR)$(installed_testdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(libostreeincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -6724,7 +6851,8 @@ clean-am: clean-binPROGRAMS clean-checkLTLIBRARIES clean-checkPROGRAMS \ clean-installed_testPROGRAMS clean-libLTLIBRARIES \ clean-libexecPROGRAMS clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS clean-ostree_bootPROGRAMS \ - clean-privlibLTLIBRARIES clean-sbinPROGRAMS mostlyclean-am + clean-pkglibexecPROGRAMS clean-privlibLTLIBRARIES \ + clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) @@ -6766,7 +6894,8 @@ install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS \ install-libLTLIBRARIES install-libexecPROGRAMS \ - install-pkglibexecSCRIPTS install-sbinPROGRAMS + install-pkglibexecPROGRAMS install-pkglibexecSCRIPTS \ + install-sbinPROGRAMS install-html: install-html-recursive @@ -6823,9 +6952,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-mkinitcpioinstallSCRIPTS \ uninstall-nobase_installed_testDATA \ uninstall-ostree_bootPROGRAMS uninstall-ostree_bootSCRIPTS \ - uninstall-pkgconfigDATA uninstall-pkglibexecSCRIPTS \ - uninstall-privlibLTLIBRARIES uninstall-sbinPROGRAMS \ - uninstall-systemdsystemunitDATA uninstall-typelibDATA + uninstall-pkgconfigDATA uninstall-pkglibexecPROGRAMS \ + uninstall-pkglibexecSCRIPTS uninstall-privlibLTLIBRARIES \ + uninstall-sbinPROGRAMS uninstall-systemdsystemunitDATA \ + uninstall-typelibDATA uninstall-man: uninstall-man1 uninstall-man5 @@ -6839,15 +6969,15 @@ uninstall-man: uninstall-man1 uninstall-man5 clean-installed_testPROGRAMS clean-libLTLIBRARIES \ clean-libexecPROGRAMS clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS clean-ostree_bootPROGRAMS \ - clean-privlibLTLIBRARIES clean-sbinPROGRAMS cscope \ - cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-binPROGRAMS \ - install-binSCRIPTS install-data install-data-am \ - install-data-hook install-dist_gpginsttestDATA \ + clean-pkglibexecPROGRAMS clean-privlibLTLIBRARIES \ + clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-binSCRIPTS install-data \ + install-data-am install-data-hook install-dist_gpginsttestDATA \ install-dist_gpginsttest_trustedDATA \ install-dist_gpgvinsttestDATA install-dracutconfDATA \ install-dracutmodSCRIPTS install-dvi install-dvi-am \ @@ -6862,9 +6992,9 @@ uninstall-man: uninstall-man1 uninstall-man5 install-mkinitcpioconfDATA install-mkinitcpioinstallSCRIPTS \ install-nobase_installed_testDATA install-ostree_bootPROGRAMS \ install-ostree_bootSCRIPTS install-pdf install-pdf-am \ - install-pkgconfigDATA install-pkglibexecSCRIPTS \ - install-privlibLTLIBRARIES install-ps install-ps-am \ - install-sbinPROGRAMS install-strip \ + install-pkgconfigDATA install-pkglibexecPROGRAMS \ + install-pkglibexecSCRIPTS install-privlibLTLIBRARIES \ + install-ps install-ps-am install-sbinPROGRAMS install-strip \ install-systemdsystemunitDATA install-typelibDATA installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ @@ -6886,9 +7016,10 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-mkinitcpioinstallSCRIPTS \ uninstall-nobase_installed_testDATA \ uninstall-ostree_bootPROGRAMS uninstall-ostree_bootSCRIPTS \ - uninstall-pkgconfigDATA uninstall-pkglibexecSCRIPTS \ - uninstall-privlibLTLIBRARIES uninstall-sbinPROGRAMS \ - uninstall-systemdsystemunitDATA uninstall-typelibDATA + uninstall-pkgconfigDATA uninstall-pkglibexecPROGRAMS \ + uninstall-pkglibexecSCRIPTS uninstall-privlibLTLIBRARIES \ + uninstall-sbinPROGRAMS uninstall-systemdsystemunitDATA \ + uninstall-typelibDATA .PRECIOUS: Makefile diff --git a/apidoc/html/index.html b/apidoc/html/index.html index 2cf1bcc6..0ec9a6bf 100644 --- a/apidoc/html/index.html +++ b/apidoc/html/index.html @@ -14,7 +14,7 @@
OSTree API references |
|---|
for OSTree 2016.14
for OSTree 2016.15
out_objects
-Map of serialized object name to variant data.
Map of serialized object name to variant data.
cancellable
start
out_commits
Array of GVariants
Map of serialized commit name to variant data.
cancellable
gboolean +ostree_repo_prune_from_reachable (+OstreeRepo *self, +OstreeRepoPruneOptions *options, +gint *out_objects_total, +gint *out_objects_pruned, +guint64 *out_pruned_object_size_total, +GCancellable *cancellable, +GError **error);
Delete content from the repository. This function is the "backend"
+half of the higher level ostree_repo_prune(). To use this function,
+you determine the root set yourself, and this function finds all other
+unreferenced objects and deletes them.
Use this API when you want to perform more selective pruning - for example, +retain all commits from a production branch, but just GC some history from +your dev branch.
+The OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE flag may be specified to just determine
+statistics on objects that would be deleted, without actually deleting them.
self |
+Repo |
++ |
options |
+Options controlling prune process |
++ |
out_objects_total |
+Number of objects found. |
+[out] | +
out_objects_pruned |
+Number of objects deleted. |
+[out] | +
out_pruned_object_size_total |
+Storage size in bytes of objects deleted. |
+[out] | +
cancellable |
+Cancellable |
++ |
error |
+Error |
++ |
gboolean ostree_repo_pull (OstreeRepo *self, diff --git a/apidoc/html/ostree.devhelp2 b/apidoc/html/ostree.devhelp2 index 734596e6..08fa2960 100644 --- a/apidoc/html/ostree.devhelp2 +++ b/apidoc/html/ostree.devhelp2 @@ -186,6 +186,7 @@+ diff --git a/apidoc/html/reference.html b/apidoc/html/reference.html index 5643d548..fa2e25d8 100644 --- a/apidoc/html/reference.html +++ b/apidoc/html/reference.html @@ -918,6 +918,10 @@
\r\n", escaped);
+ g_free (escaped);
+ for (i = 0; i < entries->len; i++)
+ {
+ g_string_append_printf (listing, "%s \r\n", escaped);
- g_free (escaped);
- for (i = 0; i < entries->len; i++)
- {
- g_string_append_printf (listing, "%s
\r\n",
+ (char *)entries->pdata[i],
+ (char *)entries->pdata[i]);
+ g_free (g_steal_pointer (&entries->pdata[i]));
+ }
+ g_string_append (listing, "\r\n\r\n");
+ out:
+ if (local_error)
+ g_printerr ("%s\n", local_error->message);
+ return listing;
+}
+
+/* Only allow reading files that have o+r, and for directories, o+x.
+ * This makes this server relatively safe to use on multiuser
+ * machines.
+ */
+static gboolean
+is_safe_to_access (struct stat *stbuf)
+{
+ /* Only regular files or directores */
+ if (!(S_ISREG (stbuf->st_mode) || S_ISDIR (stbuf->st_mode)))
+ return FALSE;
+ /* Must be o+r */
+ if (!(stbuf->st_mode & S_IROTH))
+ return FALSE;
+ /* For directories, must be o+x */
+ if (S_ISDIR (stbuf->st_mode) && !(stbuf->st_mode & S_IXOTH))
+ return FALSE;
+ return TRUE;
+}
+
+static void
+close_socket (SoupMessage *msg, gpointer user_data)
+{
+ SoupSocket *sock = user_data;
+ int sockfd;
+
+ /* Actually calling soup_socket_disconnect() here would cause
+ * us to leak memory, so just shutdown the socket instead.
+ */
+ sockfd = soup_socket_get_fd (sock);
+#ifdef G_OS_WIN32
+ shutdown (sockfd, SD_SEND);
+#else
+ shutdown (sockfd, SHUT_WR);
+#endif
+}
+
+static void
+do_get (OtTrivialHttpd *self,
+ SoupServer *server,
+ SoupMessage *msg,
+ const char *path,
+ SoupClientContext *context)
+{
+ char *slash;
+ int ret;
+ struct stat stbuf;
+
+ httpd_log (self, "serving %s\n", path);
+
+ if (opt_expected_cookies)
+ {
+ GSList *cookies = soup_cookies_from_request (msg);
+ GSList *l;
+ int i;
+
+ for (i = 0 ; opt_expected_cookies[i] != NULL; i++)
+ {
+ gboolean found = FALSE;
+ gchar *k = opt_expected_cookies[i];
+ gchar *v = strchr (k, '=') + 1;
+
+ for (l = cookies; l != NULL ; l = g_slist_next (l))
+ {
+ SoupCookie *c = l->data;
+
+ if (!strncmp (k, soup_cookie_get_name (c), v - k - 1) &&
+ !strcmp (v, soup_cookie_get_value (c)))
+ {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (!found)
+ {
+ httpd_log (self, "Expected cookie not found %s\n", k);
+ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
+ soup_cookies_free (cookies);
+ goto out;
+ }
+ }
+ soup_cookies_free (cookies);
+ }
+
+ if (opt_expected_headers)
+ {
+ for (int i = 0 ; opt_expected_headers[i] != NULL; i++)
+ {
+ const gchar *kv = opt_expected_headers[i];
+ const gchar *eq = strchr (kv, '=');
+
+ g_assert (eq);
+
+ {
+ g_autofree char *k = g_strndup (kv, eq - kv);
+ const gchar *expected_v = eq + 1;
+ const gchar *found_v = soup_message_headers_get_one (msg->request_headers, k);
+
+ if (!found_v)
+ {
+ httpd_log (self, "Expected header not found %s\n", k);
+ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
+ goto out;
+ }
+ if (strcmp (found_v, expected_v) != 0)
+ {
+ httpd_log (self, "Expected header %s: %s but found %s\n", k, expected_v, found_v);
+ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
+ goto out;
+ }
+ }
+ }
+ }
+
+ if (strstr (path, "../") != NULL)
+ {
+ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
+ goto out;
+ }
+
+ if (opt_random_500s_percentage > 0 &&
+ emitted_random_500s_count < opt_random_500s_max &&
+ g_random_int_range (0, 100) < opt_random_500s_percentage)
+ {
+ emitted_random_500s_count++;
+ soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
+ goto out;
+ }
+
+ while (path[0] == '/')
+ path++;
+
+ do
+ ret = fstatat (self->root_dfd, path, &stbuf, 0);
+ while (ret == -1 && errno == EINTR);
+ if (ret == -1)
+ {
+ if (errno == EPERM)
+ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
+ else if (errno == ENOENT)
+ soup_message_set_status (msg, SOUP_STATUS_NOT_FOUND);
+ else
+ soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
+ goto out;
+ }
+
+ if (!is_safe_to_access (&stbuf))
+ {
+ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
+ goto out;
+ }
+
+ if (S_ISDIR (stbuf.st_mode))
+ {
+ slash = strrchr (path, '/');
+ if (!slash || slash[1])
+ {
+ g_autofree char *redir_uri = NULL;
+
+ redir_uri = g_strdup_printf ("%s/", soup_message_get_uri (msg)->path);
+ soup_message_set_redirect (msg, SOUP_STATUS_MOVED_PERMANENTLY,
+ redir_uri);
+ }
+ else
+ {
+ g_autofree char *index_realpath = g_strconcat (path, "/index.html", NULL);
+ if (fstatat (self->root_dfd, index_realpath, &stbuf, 0) != -1)
+ {
+ g_autofree char *index_path = g_strconcat (path, "/index.html", NULL);
+ do_get (self, server, msg, index_path, context);
+ }
+ else
+ {
+ GString *listing = get_directory_listing (self->root_dfd, path);
+ soup_message_set_response (msg, "text/html",
+ SOUP_MEMORY_TAKE,
+ listing->str, listing->len);
+ soup_message_set_status (msg, SOUP_STATUS_OK);
+ g_string_free (listing, FALSE);
+ }
+ }
+ }
+ else
+ {
+ if (!S_ISREG (stbuf.st_mode))
+ {
+ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
+ goto out;
+ }
+
+ if (msg->method == SOUP_METHOD_GET)
+ {
+ glnx_fd_close int fd = -1;
+ g_autoptr(GMappedFile) mapping = NULL;
+ gsize buffer_length, file_size;
+ SoupRange *ranges;
+ int ranges_length;
+ gboolean have_ranges;
+
+ fd = openat (self->root_dfd, path, O_RDONLY | O_CLOEXEC);
+ if (fd < 0)
+ {
+ soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
+ goto out;
+ }
+
+ mapping = g_mapped_file_new_from_fd (fd, FALSE, NULL);
+ if (!mapping)
+ {
+ soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
+ goto out;
+ }
+ (void) close (fd); fd = -1;
+
+ file_size = g_mapped_file_get_length (mapping);
+ have_ranges = soup_message_headers_get_ranges(msg->request_headers, file_size, &ranges, &ranges_length);
+ if (opt_force_ranges && !have_ranges && g_strrstr (path, "/objects") != NULL)
+ {
+ SoupSocket *sock;
+ buffer_length = file_size/2;
+ soup_message_headers_set_content_length (msg->response_headers, file_size);
+ soup_message_headers_append (msg->response_headers,
+ "Connection", "close");
+
+ /* soup-message-io will wait for us to add
+ * another chunk after the first, to fill out
+ * the declared Content-Length. Instead, we
+ * forcibly close the socket at that point.
+ */
+ sock = soup_client_context_get_socket (context);
+ g_signal_connect (msg, "wrote-chunk", G_CALLBACK (close_socket), sock);
+ }
+ else
+ buffer_length = file_size;
+
+ if (have_ranges)
+ {
+ if (ranges_length > 0 && ranges[0].start >= file_size)
+ {
+ soup_message_set_status (msg, SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE);
+ soup_message_headers_free_ranges (msg->request_headers, ranges);
+ goto out;
+ }
+ soup_message_headers_free_ranges (msg->request_headers, ranges);
+ }
+ if (buffer_length > 0)
+ {
+ SoupBuffer *buffer;
+
+ buffer = soup_buffer_new_with_owner (g_mapped_file_get_contents (mapping),
+ buffer_length,
+ g_mapped_file_ref (mapping),
+ (GDestroyNotify)g_mapped_file_unref);
+ soup_message_body_append_buffer (msg->response_body, buffer);
+ soup_buffer_free (buffer);
+ }
+ }
+ else /* msg->method == SOUP_METHOD_HEAD */
+ {
+ g_autofree char *length = NULL;
+
+ /* We could just use the same code for both GET and
+ * HEAD (soup-message-server-io.c will fix things up).
+ * But we'll optimize and avoid the extra I/O.
+ */
+ length = g_strdup_printf ("%lu", (gulong)stbuf.st_size);
+ soup_message_headers_append (msg->response_headers,
+ "Content-Length", length);
+ }
+ soup_message_set_status (msg, SOUP_STATUS_OK);
+ }
+ out:
+ {
+ guint status = 0;
+ g_autofree gchar *reason = NULL;
+
+ g_object_get (msg,
+ "status-code", &status,
+ "reason-phrase", &reason,
+ NULL);
+ httpd_log (self, " status: %s (%u)\n", reason, status);
+ }
+ return;
+}
+
+static void
+httpd_callback (SoupServer *server, SoupMessage *msg,
+ const char *path, GHashTable *query,
+ SoupClientContext *context, gpointer data)
+{
+ OtTrivialHttpd *self = data;
+
+ if (msg->method == SOUP_METHOD_GET || msg->method == SOUP_METHOD_HEAD)
+ do_get (self, server, msg, path, context);
+ else
+ soup_message_set_status (msg, SOUP_STATUS_NOT_IMPLEMENTED);
+}
+
+static void
+on_dir_changed (GFileMonitor *mon,
+ GFile *file,
+ GFile *other,
+ GFileMonitorEvent event,
+ gpointer user_data)
+{
+ OtTrivialHttpd *self = user_data;
+
+ if (event == G_FILE_MONITOR_EVENT_DELETED)
+ {
+ self->running = FALSE;
+ g_main_context_wakeup (NULL);
+ }
+}
+
+static gboolean
+run (int argc, char **argv, GCancellable *cancellable, GError **error)
+{
+ gboolean ret = FALSE;
+ g_autoptr(GOptionContext) context = NULL;
+ const char *dirpath;
+ OtTrivialHttpd appstruct = { 0, };
+ OtTrivialHttpd *app = &appstruct;
+ glnx_unref_object SoupServer *server = NULL;
+ g_autoptr(GFileMonitor) dirmon = NULL;
+
+ context = g_option_context_new ("[DIR] - Simple webserver");
+ g_option_context_add_main_entries (context, options, NULL);
+
+ app->root_dfd = -1;
+
+ if (!g_option_context_parse (context, &argc, &argv, error))
+ goto out;
+
+ if (argc > 1)
+ dirpath = argv[1];
+ else
+ dirpath = ".";
+
+ if (!glnx_opendirat (AT_FDCWD, dirpath, TRUE, &app->root_dfd, error))
+ goto out;
+
+ if (!(opt_random_500s_percentage >= 0 && opt_random_500s_percentage <= 99))
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Invalid --random-500s=%u", opt_random_500s_percentage);
+ goto out;
+ }
+
+ if (opt_log)
+ {
+ GOutputStream *stream = NULL;
+
+ if (g_strcmp0 (opt_log, "-") == 0)
+ {
+ if (opt_daemonize)
+ {
+ ot_util_usage_error (context, "Cannot use --log-file=- and --daemonize at the same time", error);
+ goto out;
+ }
+ stream = G_OUTPUT_STREAM (g_unix_output_stream_new (STDOUT_FILENO, FALSE));
+ }
+ else
+ {
+ g_autoptr(GFile) log_file;
+ GFileOutputStream* log_stream;
+
+ log_file = g_file_new_for_path (opt_log);
+ log_stream = g_file_create (log_file,
+ G_FILE_CREATE_PRIVATE,
+ cancellable,
+ error);
+ if (!log_stream)
+ goto out;
+ stream = G_OUTPUT_STREAM (log_stream);
+ }
+
+ app->log = stream;
+ }
+
+#if SOUP_CHECK_VERSION(2, 48, 0)
+ server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "ostree-httpd ", NULL);
+ if (!soup_server_listen_all (server, opt_port, 0, error))
+ goto out;
+#else
+ server = soup_server_new (SOUP_SERVER_PORT, opt_port,
+ SOUP_SERVER_SERVER_HEADER, "ostree-httpd ",
+ NULL);
+#endif
+
+ soup_server_add_handler (server, NULL, httpd_callback, app, NULL);
+ if (opt_port_file)
+ {
+ g_autofree char *portstr = NULL;
+#if SOUP_CHECK_VERSION(2, 48, 0)
+ GSList *listeners = soup_server_get_listeners (server);
+ g_autoptr(GSocket) listener = NULL;
+ g_autoptr(GSocketAddress) addr = NULL;
+
+ g_assert (listeners);
+ listener = g_object_ref (listeners->data);
+ g_slist_free (listeners);
+ listeners = NULL;
+ addr = g_socket_get_local_address (listener, error);
+ if (!addr)
+ goto out;
+
+ g_assert (G_IS_INET_SOCKET_ADDRESS (addr));
+
+ portstr = g_strdup_printf ("%u\n", g_inet_socket_address_get_port ((GInetSocketAddress*)addr));
+#else
+ portstr = g_strdup_printf ("%u\n", soup_server_get_port (server));
+#endif
+
+ if (g_strcmp0 ("-", opt_port_file) == 0)
+ {
+ fputs (portstr, stdout); // not g_print - this must go to stdout, not a handler
+ fflush (stdout);
+ }
+ else if (!g_file_set_contents (opt_port_file, portstr, strlen (portstr), error))
+ goto out;
+ }
+#if !SOUP_CHECK_VERSION(2, 48, 0)
+ soup_server_run_async (server);
+#endif
+
+ if (opt_daemonize)
+ {
+ pid_t pid = fork();
+ if (pid == -1)
+ {
+ int errsv = errno;
+ g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errsv),
+ g_strerror (errsv));
+ goto out;
+ }
+ else if (pid > 0)
+ {
+ ret = TRUE;
+ goto out;
+ }
+ /* Child, continue */
+ if (setsid () < 0)
+ err (1, "setsid");
+ /* Daemonising: close stdout/stderr so $() et al work on us */
+ freopen("/dev/null", "r", stdin);
+ freopen("/dev/null", "w", stdout);
+ freopen("/dev/null", "w", stderr);
+ }
+ else
+ {
+ /* Since we're used for testing purposes, let's just do this by
+ * default. This ensures we exit when our parent does.
+ */
+ if (prctl (PR_SET_PDEATHSIG, SIGTERM) != 0)
+ {
+ if (errno != ENOSYS)
+ {
+ glnx_set_error_from_errno (error);
+ goto out;
+ }
+ }
+ }
+
+ app->running = TRUE;
+ if (opt_autoexit)
+ {
+ gboolean is_symlink = FALSE;
+ g_autoptr(GFile) root = NULL;
+ g_autoptr(GFileInfo) info = NULL;
+
+ root = g_file_new_for_path (dirpath);
+ info = g_file_query_info (root,
+ G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ cancellable, error);
+ if (!info)
+ goto out;
+
+ is_symlink = g_file_info_get_is_symlink (info);
+
+ if (is_symlink)
+ dirmon = g_file_monitor_file (root, 0, cancellable, error);
+ else
+ dirmon = g_file_monitor_directory (root, 0, cancellable, error);
+
+ if (!dirmon)
+ goto out;
+ g_signal_connect (dirmon, "changed", G_CALLBACK (on_dir_changed), app);
+ }
+ httpd_log (app, "serving at root %s\n", dirpath);
+ while (app->running)
+ g_main_context_iteration (NULL, TRUE);
+
+ ret = TRUE;
+ out:
+ if (app->root_dfd != -1)
+ (void) close (app->root_dfd);
+ g_clear_object (&app->log);
+ return ret;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GCancellable) cancellable = NULL;
+
+ setlocale (LC_ALL, "");
+
+ g_set_prgname (argv[0]);
+
+ if (!run (argc, argv, cancellable, &error))
+ {
+ int is_tty = isatty (1);
+ const char *prefix = "";
+ const char *suffix = "";
+ if (is_tty)
+ {
+ prefix = "\x1b[31m\x1b[1m"; /* red, bold */
+ suffix = "\x1b[22m\x1b[0m"; /* bold off, color reset */
+ }
+ g_printerr ("%serror: %s%s\n", prefix, suffix, error->message);
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/src/ostree/ot-admin-builtin-unlock.c b/src/ostree/ot-admin-builtin-unlock.c
index 0f22d0a6..aecba51b 100644
--- a/src/ostree/ot-admin-builtin-unlock.c
+++ b/src/ostree/ot-admin-builtin-unlock.c
@@ -34,7 +34,7 @@
static gboolean opt_hotfix;
static GOptionEntry options[] = {
- { "hotfix", 0, 0, G_OPTION_ARG_NONE, &opt_hotfix, "Keep the current deployment as default", NULL },
+ { "hotfix", 0, 0, G_OPTION_ARG_NONE, &opt_hotfix, "Retain changes across reboots", NULL },
{ NULL }
};
diff --git a/src/ostree/ot-admin-functions.c b/src/ostree/ot-admin-functions.c
index ed4dfdfb..7ba2207e 100644
--- a/src/ostree/ot-admin-functions.c
+++ b/src/ostree/ot-admin-functions.c
@@ -164,7 +164,7 @@ ot_admin_execve_reboot (OstreeSysroot *sysroot, GError **error)
if (g_file_equal (ostree_sysroot_get_path (sysroot), real_sysroot))
{
- if (execl ("systemctl", "systemctl", "reboot", NULL) < 0)
+ if (execlp ("systemctl", "systemctl", "reboot", NULL) < 0)
{
glnx_set_error_from_errno (error);
return FALSE;
diff --git a/src/ostree/ot-builtin-prune.c b/src/ostree/ot-builtin-prune.c
index d226c84b..853c051f 100644
--- a/src/ostree/ot-builtin-prune.c
+++ b/src/ostree/ot-builtin-prune.c
@@ -34,6 +34,7 @@ static gint opt_depth = -1;
static gboolean opt_refs_only;
static char *opt_delete_commit;
static char *opt_keep_younger_than;
+static char **opt_retain_branch_depth;
static GOptionEntry options[] = {
{ "no-prune", 0, 0, G_OPTION_ARG_NONE, &opt_no_prune, "Only display unreachable objects; don't delete", NULL },
@@ -42,6 +43,7 @@ static GOptionEntry options[] = {
{ "delete-commit", 0, 0, G_OPTION_ARG_STRING, &opt_delete_commit, "Specify a commit to delete", "COMMIT" },
{ "keep-younger-than", 0, 0, G_OPTION_ARG_STRING, &opt_keep_younger_than, "Prune all commits older than the specified date", "DATE" },
{ "static-deltas-only", 0, 0, G_OPTION_ARG_NONE, &opt_static_deltas_only, "Change the behavior of delete-commit and keep-younger-than to prune only static deltas" },
+ { "retain-branch-depth", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_retain_branch_depth, "Additionally retain BRANCH=DEPTH commits", "BRANCH=DEPTH" },
{ NULL }
};
@@ -82,87 +84,53 @@ delete_commit (OstreeRepo *repo, const char *commit_to_delete, GCancellable *can
}
static gboolean
-prune_commits_keep_younger_than_date (OstreeRepo *repo, const char *date, GCancellable *cancellable, GError **error)
+traverse_keep_younger_than (OstreeRepo *repo, const char *checksum,
+ struct timespec *ts,
+ GHashTable *reachable,
+ GCancellable *cancellable, GError **error)
{
- g_autoptr(GHashTable) refs = NULL;
- g_autoptr(GHashTable) ref_heads = g_hash_table_new (g_str_hash, g_str_equal);
- g_autoptr(GHashTable) objects = NULL;
- GHashTableIter hash_iter;
- gpointer key, value;
- struct timespec ts;
- gboolean ret = FALSE;
+ g_autofree char *next_checksum = g_strdup (checksum);
+ g_autoptr(GVariant) commit = NULL;
- if (!parse_datetime (&ts, date, NULL))
- {
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Could not parse '%s'", date);
- goto out;
- }
-
- if (!ot_enable_tombstone_commits (repo, error))
- goto out;
-
- if (!ostree_repo_list_refs (repo, NULL, &refs, cancellable, error))
- goto out;
-
- /* We used to prune the HEAD of a given ref by default, but that's
- * broken for a few reasons. One is that people may use branches as
- * tags. Second is that if we do it, we should be deleting the ref
- * too, otherwise e.g. `summary -u` breaks trying to load it, etc.
+ /* This is the first commit in our loop, which has a ref pointing to it. We
+ * don't want to auto-prune it.
*/
- g_hash_table_iter_init (&hash_iter, refs);
- while (g_hash_table_iter_next (&hash_iter, &key, &value))
+ if (!ostree_repo_traverse_commit_union (repo, checksum, 0, reachable,
+ cancellable, error))
+ return FALSE;
+
+ while (TRUE)
{
- /* Value is lifecycle bound to refs */
- g_hash_table_add (ref_heads, (char*)value);
- }
-
- if (!ostree_repo_list_objects (repo, OSTREE_REPO_LIST_OBJECTS_ALL, &objects,
- cancellable, error))
- goto out;
-
- g_hash_table_iter_init (&hash_iter, objects);
-
- while (g_hash_table_iter_next (&hash_iter, &key, &value))
- {
- GVariant *serialized_key = key;
- const char *checksum;
- OstreeObjectType objtype;
guint64 commit_timestamp;
- g_autoptr(GVariant) commit = NULL;
- ostree_object_name_deserialize (serialized_key, &checksum, &objtype);
+ if (!ostree_repo_load_variant_if_exists (repo, OSTREE_OBJECT_TYPE_COMMIT, next_checksum,
+ &commit, error))
+ return FALSE;
- if (objtype != OSTREE_OBJECT_TYPE_COMMIT)
- continue;
-
- if (g_hash_table_contains (ref_heads, checksum))
- continue;
-
- if (!ostree_repo_load_variant (repo, OSTREE_OBJECT_TYPE_COMMIT, checksum,
- &commit, error))
- goto out;
+ if (!commit)
+ break; /* This commit was pruned, so we're done */
commit_timestamp = ostree_commit_get_timestamp (commit);
- if (commit_timestamp < ts.tv_sec)
+ /* Is this commit newer than our --keep-younger-than spec? */
+ if (commit_timestamp >= ts->tv_sec)
{
- if (opt_static_deltas_only)
- {
- if(!ostree_repo_prune_static_deltas (repo, checksum, cancellable, error))
- goto out;
- }
+ /* It's newer, traverse it */
+ if (!ostree_repo_traverse_commit_union (repo, next_checksum, 0, reachable,
+ cancellable, error))
+ return FALSE;
+
+ g_free (next_checksum);
+ next_checksum = ostree_commit_get_parent (commit);
+ if (next_checksum)
+ g_clear_pointer (&commit, (GDestroyNotify)g_variant_unref);
else
- {
- if (!ostree_repo_delete_object (repo, OSTREE_OBJECT_TYPE_COMMIT, checksum, cancellable, error))
- goto out;
- }
+ break; /* No parent, we're done */
}
+ else
+ break; /* It's older than our spec, we're done */
}
- ret = TRUE;
-
- out:
- return ret;
+ return TRUE;
}
gboolean
@@ -185,6 +153,9 @@ ostree_builtin_prune (int argc, char **argv, GCancellable *cancellable, GError *
if (!opt_no_prune && !ostree_ensure_repo_writable (repo, error))
goto out;
+ /* Special handling for explicit commit deletion here - we do this
+ * first.
+ */
if (opt_delete_commit)
{
if (opt_no_prune)
@@ -200,26 +171,133 @@ ostree_builtin_prune (int argc, char **argv, GCancellable *cancellable, GError *
else if (!delete_commit (repo, opt_delete_commit, cancellable, error))
goto out;
}
- if (opt_keep_younger_than)
- {
- if (opt_no_prune)
- {
- ot_util_usage_error (context, "Cannot specify both --keep-younger-than and --no-prune", error);
- goto out;
- }
- if (!prune_commits_keep_younger_than_date (repo, opt_keep_younger_than, cancellable, error))
- goto out;
- }
if (opt_refs_only)
pruneflags |= OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY;
if (opt_no_prune)
pruneflags |= OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE;
- if (!ostree_repo_prune (repo, pruneflags, opt_depth,
- &n_objects_total, &n_objects_pruned, &objsize_total,
- cancellable, error))
- goto out;
+ /* If no newer more complex options are specified, drop down to the original
+ * prune API - both to avoid code duplication, and to keep it run from the
+ * test suite.
+ */
+ if (!(opt_retain_branch_depth || opt_keep_younger_than))
+ {
+ if (!ostree_repo_prune (repo, pruneflags, opt_depth,
+ &n_objects_total, &n_objects_pruned, &objsize_total,
+ cancellable, error))
+ goto out;
+ }
+ else
+ {
+ g_autoptr(GHashTable) all_refs = NULL;
+ g_autoptr(GHashTable) reachable = ostree_repo_traverse_new_reachable ();
+ g_autoptr(GHashTable) retain_branch_depth = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+ struct timespec keep_younger_than_ts;
+ GHashTableIter hash_iter;
+ gpointer key, value;
+
+ /* Otherwise, the default is --refs-only; we set this just as a note */
+ opt_refs_only = TRUE;
+
+ if (opt_keep_younger_than)
+ {
+ if (!parse_datetime (&keep_younger_than_ts, opt_keep_younger_than, NULL))
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Could not parse '%s'", opt_keep_younger_than);
+ goto out;
+ }
+ }
+
+ for (char **iter = opt_retain_branch_depth; iter && *iter; iter++)
+ {
+ /* bd should look like BRANCH=DEPTH where DEPTH is an int */
+ const char *bd = *iter;
+ const char *eq = strchr (bd, '=');
+ const char *depthstr;
+ gint64 depth;
+ char *endptr;
+
+ if (!eq)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Invalid value %s, must specify BRANCH=DEPTH",
+ bd);
+ goto out;
+ }
+ depthstr = eq + 1;
+ errno = EPERM;
+ depth = g_ascii_strtoll (depthstr, &endptr, 10);
+ if (depth == 0)
+ {
+ if (errno == EINVAL)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Out of range depth %s", depthstr);
+ goto out;
+ }
+ else if (endptr == depthstr)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Invalid depth %s", depthstr);
+ goto out;
+ }
+ }
+ g_hash_table_insert (retain_branch_depth, g_strndup (bd, eq - bd),
+ GINT_TO_POINTER ((int)depth));
+ }
+
+ /* We start from the refs */
+ if (!ostree_repo_list_refs (repo, NULL, &all_refs,
+ cancellable, error))
+ return FALSE;
+
+ g_hash_table_iter_init (&hash_iter, all_refs);
+ while (g_hash_table_iter_next (&hash_iter, &key, &value))
+ {
+ const char *checksum = value;
+ gpointer depthp = g_hash_table_lookup (retain_branch_depth, key);
+ gint depth;
+
+ /* Here, we handle a spec like
+ * --retain-branch-depth=myos/x86_64/stable=-1
+ * --retain-branch-depth=myos/x86_64/dev=5
+ */
+ if (depthp)
+ depth = GPOINTER_TO_INT(depthp);
+ else if (opt_keep_younger_than)
+ {
+ if (!traverse_keep_younger_than (repo, checksum,
+ &keep_younger_than_ts,
+ reachable,
+ cancellable, error))
+ goto out;
+
+ /* Okay, we handled the younger-than case; the other
+ * two fall through to plain depth-based handling below.
+ */
+ continue; /* Note again, we're skipping the below bit */
+ }
+ else
+ depth = opt_depth; /* No --retain-branch-depth for this branch, use
+ the global default */
+
+ g_debug ("Finding objects to keep for commit %s", checksum);
+ if (!ostree_repo_traverse_commit_union (repo, checksum, depth, reachable,
+ cancellable, error))
+ return FALSE;
+ }
+
+ { OstreeRepoPruneOptions opts = { pruneflags, reachable };
+ if (!ostree_repo_prune_from_reachable (repo, &opts,
+ &n_objects_total,
+ &n_objects_pruned,
+ &objsize_total,
+ cancellable, error))
+ goto out;
+ }
+ }
formatted_freed_size = g_format_size_full (objsize_total, 0);
diff --git a/src/ostree/ot-builtin-trivial-httpd.c b/src/ostree/ot-builtin-trivial-httpd.c
index 0a553858..206970c5 100644
--- a/src/ostree/ot-builtin-trivial-httpd.c
+++ b/src/ostree/ot-builtin-trivial-httpd.c
@@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
- * Copyright (C) 2011,2013 Colin Walters Index of %s
\r\n
\r\n",
- (char *)entries->pdata[i],
- (char *)entries->pdata[i]);
- g_free (g_steal_pointer (&entries->pdata[i]));
- }
- g_string_append (listing, "\r\n\r\n");
- out:
- if (local_error)
- g_printerr ("%s\n", local_error->message);
- return listing;
-}
-
-/* Only allow reading files that have o+r, and for directories, o+x.
- * This makes this server relatively safe to use on multiuser
- * machines.
- */
-static gboolean
-is_safe_to_access (struct stat *stbuf)
-{
- /* Only regular files or directores */
- if (!(S_ISREG (stbuf->st_mode) || S_ISDIR (stbuf->st_mode)))
- return FALSE;
- /* Must be o+r */
- if (!(stbuf->st_mode & S_IROTH))
- return FALSE;
- /* For directories, must be o+x */
- if (S_ISDIR (stbuf->st_mode) && !(stbuf->st_mode & S_IXOTH))
- return FALSE;
- return TRUE;
-}
-
-static void
-close_socket (SoupMessage *msg, gpointer user_data)
-{
- SoupSocket *sock = user_data;
- int sockfd;
-
- /* Actually calling soup_socket_disconnect() here would cause
- * us to leak memory, so just shutdown the socket instead.
- */
- sockfd = soup_socket_get_fd (sock);
-#ifdef G_OS_WIN32
- shutdown (sockfd, SD_SEND);
-#else
- shutdown (sockfd, SHUT_WR);
-#endif
-}
-
-static void
-do_get (OtTrivialHttpd *self,
- SoupServer *server,
- SoupMessage *msg,
- const char *path,
- SoupClientContext *context)
-{
- char *slash;
- int ret;
- struct stat stbuf;
-
- httpd_log (self, "serving %s\n", path);
-
- if (opt_expected_cookies)
- {
- GSList *cookies = soup_cookies_from_request (msg);
- GSList *l;
- int i;
-
- for (i = 0 ; opt_expected_cookies[i] != NULL; i++)
- {
- gboolean found = FALSE;
- gchar *k = opt_expected_cookies[i];
- gchar *v = strchr (k, '=') + 1;
-
- for (l = cookies; l != NULL ; l = g_slist_next (l))
- {
- SoupCookie *c = l->data;
-
- if (!strncmp (k, soup_cookie_get_name (c), v - k - 1) &&
- !strcmp (v, soup_cookie_get_value (c)))
- {
- found = TRUE;
- break;
- }
- }
-
- if (!found)
- {
- httpd_log (self, "Expected cookie not found %s\n", k);
- soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
- soup_cookies_free (cookies);
- goto out;
- }
- }
- soup_cookies_free (cookies);
- }
-
- if (opt_expected_headers)
- {
- for (int i = 0 ; opt_expected_headers[i] != NULL; i++)
- {
- const gchar *kv = opt_expected_headers[i];
- const gchar *eq = strchr (kv, '=');
-
- g_assert (eq);
-
- {
- g_autofree char *k = g_strndup (kv, eq - kv);
- const gchar *expected_v = eq + 1;
- const gchar *found_v = soup_message_headers_get_one (msg->request_headers, k);
-
- if (!found_v)
- {
- httpd_log (self, "Expected header not found %s\n", k);
- soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
- goto out;
- }
- if (strcmp (found_v, expected_v) != 0)
- {
- httpd_log (self, "Expected header %s: %s but found %s\n", k, expected_v, found_v);
- soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
- goto out;
- }
- }
- }
- }
-
- if (strstr (path, "../") != NULL)
- {
- soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
- goto out;
- }
-
- if (opt_random_500s_percentage > 0 &&
- emitted_random_500s_count < opt_random_500s_max &&
- g_random_int_range (0, 100) < opt_random_500s_percentage)
- {
- emitted_random_500s_count++;
- soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
- goto out;
- }
-
- while (path[0] == '/')
- path++;
-
- do
- ret = fstatat (self->root_dfd, path, &stbuf, 0);
- while (ret == -1 && errno == EINTR);
- if (ret == -1)
- {
- if (errno == EPERM)
- soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
- else if (errno == ENOENT)
- soup_message_set_status (msg, SOUP_STATUS_NOT_FOUND);
- else
- soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
- goto out;
- }
-
- if (!is_safe_to_access (&stbuf))
- {
- soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
- goto out;
- }
-
- if (S_ISDIR (stbuf.st_mode))
- {
- slash = strrchr (path, '/');
- if (!slash || slash[1])
- {
- g_autofree char *redir_uri = NULL;
-
- redir_uri = g_strdup_printf ("%s/", soup_message_get_uri (msg)->path);
- soup_message_set_redirect (msg, SOUP_STATUS_MOVED_PERMANENTLY,
- redir_uri);
- }
- else
- {
- g_autofree char *index_realpath = g_strconcat (path, "/index.html", NULL);
- if (fstatat (self->root_dfd, index_realpath, &stbuf, 0) != -1)
- {
- g_autofree char *index_path = g_strconcat (path, "/index.html", NULL);
- do_get (self, server, msg, index_path, context);
- }
- else
- {
- GString *listing = get_directory_listing (self->root_dfd, path);
- soup_message_set_response (msg, "text/html",
- SOUP_MEMORY_TAKE,
- listing->str, listing->len);
- soup_message_set_status (msg, SOUP_STATUS_OK);
- g_string_free (listing, FALSE);
- }
- }
- }
- else
- {
- if (!S_ISREG (stbuf.st_mode))
- {
- soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
- goto out;
- }
-
- if (msg->method == SOUP_METHOD_GET)
- {
- glnx_fd_close int fd = -1;
- g_autoptr(GMappedFile) mapping = NULL;
- gsize buffer_length, file_size;
- SoupRange *ranges;
- int ranges_length;
- gboolean have_ranges;
-
- fd = openat (self->root_dfd, path, O_RDONLY | O_CLOEXEC);
- if (fd < 0)
- {
- soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
- goto out;
- }
-
- mapping = g_mapped_file_new_from_fd (fd, FALSE, NULL);
- if (!mapping)
- {
- soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
- goto out;
- }
- (void) close (fd); fd = -1;
-
- file_size = g_mapped_file_get_length (mapping);
- have_ranges = soup_message_headers_get_ranges(msg->request_headers, file_size, &ranges, &ranges_length);
- if (opt_force_ranges && !have_ranges && g_strrstr (path, "/objects") != NULL)
- {
- SoupSocket *sock;
- buffer_length = file_size/2;
- soup_message_headers_set_content_length (msg->response_headers, file_size);
- soup_message_headers_append (msg->response_headers,
- "Connection", "close");
-
- /* soup-message-io will wait for us to add
- * another chunk after the first, to fill out
- * the declared Content-Length. Instead, we
- * forcibly close the socket at that point.
- */
- sock = soup_client_context_get_socket (context);
- g_signal_connect (msg, "wrote-chunk", G_CALLBACK (close_socket), sock);
- }
- else
- buffer_length = file_size;
-
- if (have_ranges)
- {
- if (ranges_length > 0 && ranges[0].start >= file_size)
- {
- soup_message_set_status (msg, SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE);
- soup_message_headers_free_ranges (msg->request_headers, ranges);
- goto out;
- }
- soup_message_headers_free_ranges (msg->request_headers, ranges);
- }
- if (buffer_length > 0)
- {
- SoupBuffer *buffer;
-
- buffer = soup_buffer_new_with_owner (g_mapped_file_get_contents (mapping),
- buffer_length,
- g_mapped_file_ref (mapping),
- (GDestroyNotify)g_mapped_file_unref);
- soup_message_body_append_buffer (msg->response_body, buffer);
- soup_buffer_free (buffer);
- }
- }
- else /* msg->method == SOUP_METHOD_HEAD */
- {
- g_autofree char *length = NULL;
-
- /* We could just use the same code for both GET and
- * HEAD (soup-message-server-io.c will fix things up).
- * But we'll optimize and avoid the extra I/O.
- */
- length = g_strdup_printf ("%lu", (gulong)stbuf.st_size);
- soup_message_headers_append (msg->response_headers,
- "Content-Length", length);
- }
- soup_message_set_status (msg, SOUP_STATUS_OK);
- }
- out:
- {
- guint status = 0;
- g_autofree gchar *reason = NULL;
-
- g_object_get (msg,
- "status-code", &status,
- "reason-phrase", &reason,
- NULL);
- httpd_log (self, " status: %s (%u)\n", reason, status);
- }
- return;
-}
-
-static void
-httpd_callback (SoupServer *server, SoupMessage *msg,
- const char *path, GHashTable *query,
- SoupClientContext *context, gpointer data)
-{
- OtTrivialHttpd *self = data;
-
- if (msg->method == SOUP_METHOD_GET || msg->method == SOUP_METHOD_HEAD)
- do_get (self, server, msg, path, context);
- else
- soup_message_set_status (msg, SOUP_STATUS_NOT_IMPLEMENTED);
-}
-
-static void
-on_dir_changed (GFileMonitor *mon,
- GFile *file,
- GFile *other,
- GFileMonitorEvent event,
- gpointer user_data)
-{
- OtTrivialHttpd *self = user_data;
-
- if (event == G_FILE_MONITOR_EVENT_DELETED)
- {
- self->running = FALSE;
- g_main_context_wakeup (NULL);
- }
-}
-
gboolean
ostree_builtin_trivial_httpd (int argc, char **argv, GCancellable *cancellable, GError **error)
{
- gboolean ret = FALSE;
- g_autoptr(GOptionContext) context = NULL;
- const char *dirpath;
- OtTrivialHttpd appstruct = { 0, };
- OtTrivialHttpd *app = &appstruct;
- glnx_unref_object SoupServer *server = NULL;
- g_autoptr(GFileMonitor) dirmon = NULL;
+ g_autoptr(GPtrArray) new_argv = g_ptr_array_new ();
- context = g_option_context_new ("[DIR] - Simple webserver");
-
- app->root_dfd = -1;
-
- if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NO_REPO, NULL, cancellable, error))
- goto out;
-
- if (argc > 1)
- dirpath = argv[1];
- else
- dirpath = ".";
-
- if (!glnx_opendirat (AT_FDCWD, dirpath, TRUE, &app->root_dfd, error))
- goto out;
-
- if (!(opt_random_500s_percentage >= 0 && opt_random_500s_percentage <= 99))
- {
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Invalid --random-500s=%u", opt_random_500s_percentage);
- goto out;
- }
-
- if (opt_log)
- {
- GOutputStream *stream = NULL;
-
- if (g_strcmp0 (opt_log, "-") == 0)
- {
- if (opt_daemonize)
- {
- ot_util_usage_error (context, "Cannot use --log-file=- and --daemonize at the same time", error);
- goto out;
- }
- stream = G_OUTPUT_STREAM (g_unix_output_stream_new (STDOUT_FILENO, FALSE));
- }
- else
- {
- g_autoptr(GFile) log_file;
- GFileOutputStream* log_stream;
-
- log_file = g_file_new_for_path (opt_log);
- log_stream = g_file_create (log_file,
- G_FILE_CREATE_PRIVATE,
- cancellable,
- error);
- if (!log_stream)
- goto out;
- stream = G_OUTPUT_STREAM (log_stream);
- }
-
- app->log = stream;
- }
-
-#if SOUP_CHECK_VERSION(2, 48, 0)
- server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "ostree-httpd ", NULL);
- if (!soup_server_listen_all (server, opt_port, 0, error))
- goto out;
-#else
- server = soup_server_new (SOUP_SERVER_PORT, opt_port,
- SOUP_SERVER_SERVER_HEADER, "ostree-httpd ",
- NULL);
-#endif
-
- soup_server_add_handler (server, NULL, httpd_callback, app, NULL);
- if (opt_port_file)
- {
- g_autofree char *portstr = NULL;
-#if SOUP_CHECK_VERSION(2, 48, 0)
- GSList *listeners = soup_server_get_listeners (server);
- g_autoptr(GSocket) listener = NULL;
- g_autoptr(GSocketAddress) addr = NULL;
-
- g_assert (listeners);
- listener = g_object_ref (listeners->data);
- g_slist_free (listeners);
- listeners = NULL;
- addr = g_socket_get_local_address (listener, error);
- if (!addr)
- goto out;
-
- g_assert (G_IS_INET_SOCKET_ADDRESS (addr));
-
- portstr = g_strdup_printf ("%u\n", g_inet_socket_address_get_port ((GInetSocketAddress*)addr));
-#else
- portstr = g_strdup_printf ("%u\n", soup_server_get_port (server));
-#endif
-
- if (g_strcmp0 ("-", opt_port_file) == 0)
- {
- fputs (portstr, stdout); // not g_print - this must go to stdout, not a handler
- fflush (stdout);
- }
- else if (!g_file_set_contents (opt_port_file, portstr, strlen (portstr), error))
- goto out;
- }
-#if !SOUP_CHECK_VERSION(2, 48, 0)
- soup_server_run_async (server);
-#endif
-
- if (opt_daemonize)
- {
- pid_t pid = fork();
- if (pid == -1)
- {
- int errsv = errno;
- g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errsv),
- g_strerror (errsv));
- goto out;
- }
- else if (pid > 0)
- {
- ret = TRUE;
- goto out;
- }
- /* Child, continue */
- /* Daemonising: close stdout/stderr so $() et al work on us */
- fclose (stdout);
- fclose (stdin);
- }
- else
- {
- /* Since we're used for testing purposes, let's just do this by
- * default. This ensures we exit when our parent does.
- */
- if (prctl (PR_SET_PDEATHSIG, SIGTERM) != 0)
- {
- if (errno != ENOSYS)
- {
- glnx_set_error_from_errno (error);
- goto out;
- }
- }
- }
-
- app->running = TRUE;
- if (opt_autoexit)
- {
- gboolean is_symlink = FALSE;
- g_autoptr(GFile) root = NULL;
- g_autoptr(GFileInfo) info = NULL;
-
- root = g_file_new_for_path (dirpath);
- info = g_file_query_info (root,
- G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK,
- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
- cancellable, error);
- if (!info)
- goto out;
-
- is_symlink = g_file_info_get_is_symlink (info);
-
- if (is_symlink)
- dirmon = g_file_monitor_file (root, 0, cancellable, error);
- else
- dirmon = g_file_monitor_directory (root, 0, cancellable, error);
-
- if (!dirmon)
- goto out;
- g_signal_connect (dirmon, "changed", G_CALLBACK (on_dir_changed), app);
- }
- httpd_log (app, "serving at root %s\n", dirpath);
- while (app->running)
- g_main_context_iteration (NULL, TRUE);
-
- ret = TRUE;
- out:
- if (app->root_dfd != -1)
- (void) close (app->root_dfd);
- g_clear_object (&app->log);
- return ret;
+ g_ptr_array_add (new_argv, PKGLIBEXECDIR "/ostree-trivial-httpd");
+ for (int i = 1; i < argc; i++)
+ g_ptr_array_add (new_argv, argv[i]);
+ g_ptr_array_add (new_argv, NULL);
+ execvp (new_argv->pdata[0], (char**)new_argv->pdata);
+ /* Fall through on error */
+ glnx_set_error_from_errno (error);
+ return FALSE;
}
diff --git a/tests/admin-test.sh b/tests/admin-test.sh
old mode 100755
new mode 100644
index 76fc8b85..cc06fe6f
--- a/tests/admin-test.sh
+++ b/tests/admin-test.sh
@@ -1,4 +1,5 @@
-#!/bin/bash
+# This file is to be sourced, not executed
+
# Copyright (C) 2011,2014 Colin Walters