diff --git a/Makefile-decls.am b/Makefile-decls.am index df635706..e41586d1 100644 --- a/Makefile-decls.am +++ b/Makefile-decls.am @@ -46,6 +46,9 @@ gsettings_SCHEMAS = ostree_bootdir = $(prefix)/lib/ostree ostree_boot_PROGRAMS = +# This initializes some more variables +include $(top_srcdir)/buildutil/glib-tap.mk + # This is a special facility to chain together hooks easily INSTALL_DATA_HOOKS = install-data-hook: $(INSTALL_DATA_HOOKS) diff --git a/Makefile-libostree.am b/Makefile-libostree.am index 0be60a18..a7d7b11b 100644 --- a/Makefile-libostree.am +++ b/Makefile-libostree.am @@ -34,10 +34,7 @@ libostreeincludedir = $(includedir)/ostree-1 libostreeinclude_HEADERS = $(libostree_public_headers) ENUM_TYPES = $(NULL) - -if USE_LIBSOUP ENUM_TYPES += $(srcdir)/src/libostree/ostree-fetcher.h -endif src/libostree/ostree-enumtypes.h: src/libostree/ostree-enumtypes.h.template $(ENUM_TYPES) $(AM_V_GEN) $(GLIB_MKENUMS) \ @@ -50,14 +47,11 @@ src/libostree/ostree-enumtypes.c: src/libostree/ostree-enumtypes.c.template $(EN --fhead "#include \"ostree-enumtypes.h\"" \ $(ENUM_TYPES) > $@.tmp && mv $@.tmp $@ -if USE_LIBSOUP ENUM_GENERATED = \ src/libostree/ostree-enumtypes.h \ src/libostree/ostree-enumtypes.c \ $(NULL) - BUILT_SOURCES += $(ENUM_GENERATED) -endif CLEANFILES += $(BUILT_SOURCES) @@ -134,6 +128,7 @@ libostree_1_la_SOURCES = \ if USE_LIBARCHIVE libostree_1_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \ src/libostree/ostree-libarchive-input-stream.c \ + src/libostree/ostree-libarchive-private.h \ $(NULL) endif if HAVE_LIBSOUP_CLIENT_CERTS diff --git a/Makefile-ostree.am b/Makefile-ostree.am index 9f2119dc..e6b1eabe 100644 --- a/Makefile-ostree.am +++ b/Makefile-ostree.am @@ -80,17 +80,22 @@ ostree_SOURCES += \ ostree_SOURCES += \ src/ostree/ot-remote-builtins.h \ src/ostree/ot-remote-builtin-add.c \ - src/ostree/ot-remote-builtin-add-cookie.c \ src/ostree/ot-remote-builtin-delete.c \ - src/ostree/ot-remote-builtin-delete-cookie.c \ src/ostree/ot-remote-builtin-gpg-import.c \ src/ostree/ot-remote-builtin-list.c \ - src/ostree/ot-remote-builtin-list-cookies.c \ src/ostree/ot-remote-builtin-show-url.c \ src/ostree/ot-remote-builtin-refs.c \ src/ostree/ot-remote-builtin-summary.c \ $(NULL) +if USE_LIBSOUP +ostree_SOURCES += \ + src/ostree/ot-remote-builtin-add-cookie.c \ + src/ostree/ot-remote-builtin-delete-cookie.c \ + src/ostree/ot-remote-builtin-list-cookies.c \ + $(NULL) +endif + src/ostree/parse-datetime.c: src/ostree/parse-datetime.y Makefile $(AM_V_GEN) $(YACC) $< -o $@ diff --git a/Makefile-switchroot.am b/Makefile-switchroot.am index 0b30a965..6fd2f820 100644 --- a/Makefile-switchroot.am +++ b/Makefile-switchroot.am @@ -17,6 +17,10 @@ if BUILDOPT_SYSTEMD ostree_boot_PROGRAMS += ostree-remount +else +# 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 +check_PROGRAMS += ostree-remount endif ostree_prepare_root_SOURCES = \ diff --git a/Makefile-tests.am b/Makefile-tests.am index 2160cd55..1f9cad48 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -17,8 +17,6 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -include $(top_srcdir)/buildutil/glib-tap.mk - EXTRA_DIST += \ buildutil/tap-driver.sh \ buildutil/tap-test \ @@ -30,10 +28,14 @@ EXTRA_DIST += \ # include the builddir in $PATH so we find our just-built ostree # binary. TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \ - GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd) \ - LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd) \ + 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) +if BUILDOPT_ASAN +TESTS_ENVIRONMENT += OT_SKIP_READDIR_RAND=1 G_SLICE=always-malloc +endif uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-symlink-stamp \ tests/ostree-remount-symlink-stamp tests/rofiles-fuse-symlink-stamp @@ -45,7 +47,6 @@ dist_test_scripts = \ tests/test-pull-subpath.sh \ tests/test-archivez.sh \ tests/test-remote-add.sh \ - tests/test-remote-cookies.sh \ tests/test-remote-headers.sh \ tests/test-remote-gpg-import.sh \ tests/test-commit-sign.sh \ @@ -55,7 +56,6 @@ dist_test_scripts = \ tests/test-parent.sh \ tests/test-pull-archive-z.sh \ tests/test-pull-commit-only.sh \ - tests/test-pull-corruption.sh \ tests/test-pull-depth.sh \ tests/test-pull-mirror-summary.sh \ tests/test-pull-large-metadata.sh \ @@ -102,17 +102,20 @@ else EXTRA_DIST += tests/test-rofiles-fuse.sh endif -# This one uses corrupt-repo-ref.js -js_tests = tests/test-corruption.sh +if USE_LIBSOUP +dist_test_scripts += tests/test-remote-cookies.sh +endif + +# These call into gjs scripts +js_tests = tests/test-corruption.sh tests/test-pull-corruption.sh if BUILDOPT_GJS -dist_test_scripts += tests/test-corruption.sh +dist_test_scripts += $(js_tests) else EXTRA_DIST += $(js_tests) endif dist_installed_test_data = tests/archive-test.sh \ tests/pull-test.sh \ - tests/libtest.sh \ tests/admin-test.sh \ tests/basic-test.sh \ tests/test-basic-user.sh \ @@ -121,6 +124,8 @@ dist_installed_test_data = tests/archive-test.sh \ 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 @@ -276,10 +281,15 @@ tests/%-symlink-stamp: % Makefile # non-recursive Automake, so we change our code to canonically look # for tests/ which is just a symlink when installed. if ENABLE_INSTALLED_TESTS -install-test-data-file-path-hack: +install-installed-tests-extra: if test -L $(DESTDIR)$(installed_testdir)/tests; then \ rm $(DESTDIR)$(installed_testdir)/tests; \ fi ln -s . $(DESTDIR)$(installed_testdir)/tests -INSTALL_DATA_HOOKS += install-test-data-file-path-hack +if BUILDOPT_ASAN + sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh +else + install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh +endif +INSTALL_DATA_HOOKS += install-installed-tests-extra endif diff --git a/Makefile.in b/Makefile.in index 46a49b67..b471c3a0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,6 +48,8 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. +# GLIB - Library of useful C routines + # Copyright (C) 2015 Colin Walters # # This library is free software; you can redistribute it and/or @@ -219,8 +221,6 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -# GLIB - Library of useful C routines - # Makefile for boot module # # Copyright (C) 2013 Colin Walters @@ -340,69 +340,24 @@ host_triplet = @host@ bin_PROGRAMS = ostree$(EXEEXT) $(am__EXEEXT_1) sbin_PROGRAMS = libexec_PROGRAMS = -noinst_PROGRAMS = $(am__EXEEXT_7) tests/test-rollsum-cli$(EXEEXT) -ostree_boot_PROGRAMS = $(am__EXEEXT_8) $(am__EXEEXT_9) -@ENABLE_GTK_DOC_TRUE@am__append_1 = apidoc -@USE_LIBSOUP_TRUE@am__append_2 = $(srcdir)/src/libostree/ostree-fetcher.h -@USE_LIBSOUP_TRUE@am__append_3 = $(ENUM_GENERATED) -@USE_LIBARCHIVE_TRUE@am__append_4 = src/libostree/ostree-libarchive-input-stream.h \ -@USE_LIBARCHIVE_TRUE@ src/libostree/ostree-libarchive-input-stream.c \ -@USE_LIBARCHIVE_TRUE@ $(NULL) - -@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@am__append_5 = \ -@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@ src/libostree/ostree-tls-cert-interaction.c \ -@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@ src/libostree/ostree-tls-cert-interaction.h \ -@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@ $(NULL) - -@USE_LIBARCHIVE_TRUE@am__append_6 = $(OT_DEP_LIBARCHIVE_CFLAGS) -@USE_LIBARCHIVE_TRUE@am__append_7 = $(OT_DEP_LIBARCHIVE_LIBS) -@BUILDOPT_LIBSYSTEMD_TRUE@am__append_8 = $(LIBSYSTEMD_CFLAGS) -@BUILDOPT_LIBSYSTEMD_TRUE@am__append_9 = $(LIBSYSTEMD_LIBS) -@USE_LIBSOUP_TRUE@am__append_10 = \ -@USE_LIBSOUP_TRUE@ src/libostree/ostree-fetcher.h \ -@USE_LIBSOUP_TRUE@ src/libostree/ostree-fetcher.c \ -@USE_LIBSOUP_TRUE@ src/libostree/ostree-metalink.h \ -@USE_LIBSOUP_TRUE@ src/libostree/ostree-metalink.c \ -@USE_LIBSOUP_TRUE@ $(NULL) - -@USE_LIBSOUP_TRUE@am__append_11 = $(OT_INTERNAL_SOUP_CFLAGS) -@USE_LIBSOUP_TRUE@am__append_12 = $(OT_INTERNAL_SOUP_LIBS) -@USE_LIBMOUNT_TRUE@am__append_13 = $(OT_DEP_LIBMOUNT_CFLAGS) -@USE_LIBMOUNT_TRUE@am__append_14 = $(OT_DEP_LIBMOUNT_LIBS) -@USE_SELINUX_TRUE@am__append_15 = $(OT_DEP_SELINUX_CFLAGS) -@USE_SELINUX_TRUE@am__append_16 = $(OT_DEP_SELINUX_LIBS) -@BUILDOPT_INTROSPECTION_TRUE@am__append_17 = OSTree-1.0.gir -@BUILDOPT_INTROSPECTION_TRUE@am__append_18 = OSTree-1.0.gir -@BUILDOPT_INTROSPECTION_TRUE@am__append_19 = OSTree-1.0.typelib -@BUILDOPT_INTROSPECTION_TRUE@am__append_20 = $(gir_DATA) $(typelib_DATA) -@USE_LIBSOUP_TRUE@am__append_21 = \ -@USE_LIBSOUP_TRUE@ src/ostree/ot-builtin-pull.c \ -@USE_LIBSOUP_TRUE@ src/ostree/ot-builtin-trivial-httpd.c \ -@USE_LIBSOUP_TRUE@ $(NULL) - -@USE_LIBSOUP_TRUE@am__append_22 = $(OT_INTERNAL_SOUP_CFLAGS) -@USE_LIBSOUP_TRUE@am__append_23 = $(OT_INTERNAL_SOUP_LIBS) -@USE_LIBARCHIVE_TRUE@am__append_24 = $(OT_DEP_LIBARCHIVE_CFLAGS) -@USE_LIBARCHIVE_TRUE@am__append_25 = $(OT_DEP_LIBARCHIVE_LIBS) -@BUILDOPT_SYSTEMD_TRUE@am__append_26 = ostree-remount -@BUILDOPT_USE_STATIC_COMPILER_FALSE@am__append_27 = ostree-prepare-root -@BUILDOPT_FUSE_TRUE@am__append_28 = rofiles-fuse -TESTS = $(am__EXEEXT_3) $(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) \ $(dist_uninstalled_test_scripts) -installed_test_PROGRAMS = $(am__EXEEXT_6) -check_PROGRAMS = $(am__EXEEXT_5) -@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_29 = $(all_test_ltlibs) -@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_30 = $(all_test_programs) -@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_31 = $(all_test_scripts) -@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_32 = $(all_test_data) -@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_33 = $(all_test_ltlibs) -@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_34 = $(all_test_programs) -@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_35 = $(all_test_scripts) -@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_36 = $(all_test_data) -@ENABLE_INSTALLED_TESTS_TRUE@am__append_37 = $(test_programs) $(installed_test_programs) \ +installed_test_PROGRAMS = $(am__EXEEXT_7) +check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_1 = $(all_test_ltlibs) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_2 = $(all_test_programs) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_3 = $(all_test_scripts) +@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__append_4 = $(all_test_data) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_5 = $(all_test_ltlibs) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_6 = $(all_test_programs) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_7 = $(all_test_scripts) +@ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__append_8 = $(all_test_data) +@ENABLE_INSTALLED_TESTS_TRUE@am__append_9 = $(test_programs) $(installed_test_programs) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(test_extra_programs) $(installed_test_extra_programs) -@ENABLE_INSTALLED_TESTS_TRUE@am__append_38 = $(test_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@am__append_10 = $(test_scripts) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(installed_test_scripts) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(test_extra_scripts) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(test_installed_extra_scripts) \ @@ -410,29 +365,81 @@ check_PROGRAMS = $(am__EXEEXT_5) @ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_extra_scripts) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(dist_installed_test_scripts) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(dist_installed_test_extra_scripts) -@ENABLE_INSTALLED_TESTS_TRUE@am__append_39 = $(test_data) \ +@ENABLE_INSTALLED_TESTS_TRUE@am__append_11 = $(test_data) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(installed_test_data) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_data) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(dist_installed_test_data) -@ENABLE_INSTALLED_TESTS_TRUE@am__append_40 = $(test_ltlibraries) $(installed_test_ltlibraries) -@ENABLE_INSTALLED_TESTS_TRUE@am__append_41 = $(installed_test_meta_DATA) +@ENABLE_INSTALLED_TESTS_TRUE@am__append_12 = $(test_ltlibraries) $(installed_test_ltlibraries) +@ENABLE_INSTALLED_TESTS_TRUE@am__append_13 = $(installed_test_meta_DATA) +@ENABLE_GTK_DOC_TRUE@am__append_14 = apidoc +@USE_LIBARCHIVE_TRUE@am__append_15 = src/libostree/ostree-libarchive-input-stream.h \ +@USE_LIBARCHIVE_TRUE@ src/libostree/ostree-libarchive-input-stream.c \ +@USE_LIBARCHIVE_TRUE@ src/libostree/ostree-libarchive-private.h \ +@USE_LIBARCHIVE_TRUE@ $(NULL) + +@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@am__append_16 = \ +@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@ src/libostree/ostree-tls-cert-interaction.c \ +@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@ src/libostree/ostree-tls-cert-interaction.h \ +@HAVE_LIBSOUP_CLIENT_CERTS_TRUE@ $(NULL) + +@USE_LIBARCHIVE_TRUE@am__append_17 = $(OT_DEP_LIBARCHIVE_CFLAGS) +@USE_LIBARCHIVE_TRUE@am__append_18 = $(OT_DEP_LIBARCHIVE_LIBS) +@BUILDOPT_LIBSYSTEMD_TRUE@am__append_19 = $(LIBSYSTEMD_CFLAGS) +@BUILDOPT_LIBSYSTEMD_TRUE@am__append_20 = $(LIBSYSTEMD_LIBS) +@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-metalink.h \ +@USE_LIBSOUP_TRUE@ src/libostree/ostree-metalink.c \ +@USE_LIBSOUP_TRUE@ $(NULL) + +@USE_LIBSOUP_TRUE@am__append_22 = $(OT_INTERNAL_SOUP_CFLAGS) +@USE_LIBSOUP_TRUE@am__append_23 = $(OT_INTERNAL_SOUP_LIBS) +@USE_LIBMOUNT_TRUE@am__append_24 = $(OT_DEP_LIBMOUNT_CFLAGS) +@USE_LIBMOUNT_TRUE@am__append_25 = $(OT_DEP_LIBMOUNT_LIBS) +@USE_SELINUX_TRUE@am__append_26 = $(OT_DEP_SELINUX_CFLAGS) +@USE_SELINUX_TRUE@am__append_27 = $(OT_DEP_SELINUX_LIBS) +@BUILDOPT_INTROSPECTION_TRUE@am__append_28 = OSTree-1.0.gir +@BUILDOPT_INTROSPECTION_TRUE@am__append_29 = OSTree-1.0.gir +@BUILDOPT_INTROSPECTION_TRUE@am__append_30 = OSTree-1.0.typelib +@BUILDOPT_INTROSPECTION_TRUE@am__append_31 = $(gir_DATA) $(typelib_DATA) +@USE_LIBSOUP_TRUE@am__append_32 = \ +@USE_LIBSOUP_TRUE@ src/ostree/ot-remote-builtin-add-cookie.c \ +@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@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 +# 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 -@BUILDOPT_GJS_TRUE@am__append_44 = tests/test-corruption.sh -@BUILDOPT_GJS_FALSE@am__append_45 = $(js_tests) $(js_installed_tests) -@ENABLE_INSTALLED_TESTS_FALSE@am__append_46 = -rpath $(abs_builddir) -@USE_LIBARCHIVE_TRUE@am__append_47 = tests/test-libarchive-import -@ENABLE_INSTALLED_TESTS_TRUE@am__append_48 = install-test-data-file-path-hack +@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 # Allow the distcheck install under $prefix test to pass -@BUILDOPT_SYSTEMD_TRUE@am__append_49 = --with-systemdsystemunitdir='$${libdir}/systemd/system' +@BUILDOPT_SYSTEMD_TRUE@am__append_51 = --with-systemdsystemunitdir='$${libdir}/systemd/system' # We're using the system grub2-mkconfig generator -@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_50 = src/boot/grub2/grub2-15_ostree -@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_51 = install-grub2-config-hook -@BUILDOPT_FUSE_TRUE@@ENABLE_MAN_TRUE@am__append_52 = rofiles-fuse.1 -@ENABLE_MAN_TRUE@am__append_53 = $(man1_MANS) $(man5_MANS) $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml) -@ENABLE_MAN_TRUE@am__append_54 = \ +@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 = \ @ENABLE_MAN_TRUE@ $(man1_MANS) \ @ENABLE_MAN_TRUE@ $(man5_MANS) \ @ENABLE_MAN_TRUE@ $(NULL) @@ -617,13 +624,14 @@ am__libostree_1_la_SOURCES_DIST = src/libostree/ostree-enumtypes.h \ src/libostree/ostree-autocleanups.h \ src/libostree/ostree-libarchive-input-stream.h \ src/libostree/ostree-libarchive-input-stream.c \ + src/libostree/ostree-libarchive-private.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-metalink.h \ src/libostree/ostree-metalink.c -@USE_LIBSOUP_TRUE@am__objects_2 = src/libostree/libostree_1_la-ostree-enumtypes.lo \ -@USE_LIBSOUP_TRUE@ $(am__objects_1) +am__objects_2 = src/libostree/libostree_1_la-ostree-enumtypes.lo \ + $(am__objects_1) @USE_LIBARCHIVE_TRUE@am__objects_3 = src/libostree/libostree_1_la-ostree-libarchive-input-stream.lo \ @USE_LIBARCHIVE_TRUE@ $(am__objects_1) @HAVE_LIBSOUP_CLIENT_CERTS_TRUE@am__objects_4 = src/libostree/libostree_1_la-ostree-tls-cert-interaction.lo \ @@ -746,10 +754,11 @@ am__EXEEXT_3 = tests/test-varint$(EXEEXT) \ $(am__EXEEXT_2) am__EXEEXT_4 = $(am__EXEEXT_3) @ENABLE_ALWAYS_BUILD_TESTS_FALSE@am__EXEEXT_5 = $(am__EXEEXT_4) -@ENABLE_INSTALLED_TESTS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_3) -@ENABLE_ALWAYS_BUILD_TESTS_TRUE@am__EXEEXT_7 = $(am__EXEEXT_4) -@BUILDOPT_SYSTEMD_TRUE@am__EXEEXT_8 = ostree-remount$(EXEEXT) -@BUILDOPT_USE_STATIC_COMPILER_FALSE@am__EXEEXT_9 = ostree-prepare-root$(EXEEXT) +@BUILDOPT_SYSTEMD_FALSE@am__EXEEXT_6 = ostree-remount$(EXEEXT) +@ENABLE_INSTALLED_TESTS_TRUE@am__EXEEXT_7 = $(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) PROGRAMS = $(bin_PROGRAMS) $(installed_test_PROGRAMS) \ $(libexec_PROGRAMS) $(noinst_PROGRAMS) $(ostree_boot_PROGRAMS) \ $(sbin_PROGRAMS) @@ -792,18 +801,21 @@ am__ostree_SOURCES_DIST = src/ostree/main.c \ src/ostree/ot-admin-functions.c \ src/ostree/ot-remote-builtins.h \ src/ostree/ot-remote-builtin-add.c \ - src/ostree/ot-remote-builtin-add-cookie.c \ src/ostree/ot-remote-builtin-delete.c \ - src/ostree/ot-remote-builtin-delete-cookie.c \ src/ostree/ot-remote-builtin-gpg-import.c \ src/ostree/ot-remote-builtin-list.c \ - src/ostree/ot-remote-builtin-list-cookies.c \ src/ostree/ot-remote-builtin-show-url.c \ src/ostree/ot-remote-builtin-refs.c \ src/ostree/ot-remote-builtin-summary.c \ + src/ostree/ot-remote-builtin-add-cookie.c \ + src/ostree/ot-remote-builtin-delete-cookie.c \ + src/ostree/ot-remote-builtin-list-cookies.c \ src/ostree/ot-builtin-pull.c \ src/ostree/ot-builtin-trivial-httpd.c -@USE_LIBSOUP_TRUE@am__objects_6 = \ +@USE_LIBSOUP_TRUE@am__objects_6 = src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT) \ +@USE_LIBSOUP_TRUE@ src/ostree/ostree-ot-remote-builtin-delete-cookie.$(OBJEXT) \ +@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) @@ -852,12 +864,9 @@ am_ostree_OBJECTS = src/ostree/ostree-main.$(OBJEXT) \ src/ostree/ostree-ot-admin-functions.$(OBJEXT) \ $(am__objects_1) \ src/ostree/ostree-ot-remote-builtin-add.$(OBJEXT) \ - src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-delete.$(OBJEXT) \ - src/ostree/ostree-ot-remote-builtin-delete-cookie.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-gpg-import.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-list.$(OBJEXT) \ - src/ostree/ostree-ot-remote-builtin-list-cookies.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-show-url.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-refs.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-summary.$(OBJEXT) \ @@ -1324,15 +1333,14 @@ 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_10 = -am__EXEEXT_11 = tests/test-basic.sh tests/test-pull-subpath.sh \ +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-cookies.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-corruption.sh tests/test-pull-depth.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 \ @@ -1357,8 +1365,8 @@ am__EXEEXT_11 = 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_10) \ - $(am__append_42) $(am__append_44) + tests/test-pull-mirrorlist.sh $(am__EXEEXT_11) \ + $(am__append_42) $(am__append_44) $(am__append_45) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) @@ -1634,60 +1642,112 @@ 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_49) -SUBDIRS = . $(am__append_1) + --disable-maintainer-mode $(NULL) $(am__append_51) +SUBDIRS = . $(am__append_14) NULL = -BUILT_SOURCES = $(am__append_3) +BUILT_SOURCES = $(ENUM_GENERATED) MANPAGES = -CLEANFILES = $(BUILT_SOURCES) $(am__append_20) \ - src/ostree/parse-datetime.c $(am__append_41) \ - tests/libreaddir-rand.so tests/ostree-symlink-stamp \ +CLEANFILES = $(am__append_13) $(BUILT_SOURCES) $(am__append_31) \ + src/ostree/parse-datetime.c tests/libreaddir-rand.so \ + tests/ostree-symlink-stamp \ tests/ostree-prepare-root-symlink-stamp \ tests/ostree-remount-symlink-stamp \ tests/rofiles-fuse-symlink-stamp tests/ostree \ tests/ostree-prepare-root tests/ostree-remount \ - tests/rofiles-fuse $(am__append_54) -EXTRA_DIST = autogen.sh COPYING README.md libglnx/README.md \ - libglnx/COPYING libglnx/libglnx.m4 $(NULL) \ - libglnx/Makefile-libglnx.am bsdiff/bsdiff.h bsdiff/bspatch.h \ - bsdiff/LICENSE bsdiff/README.md bsdiff/Makefile-bsdiff.am \ + tests/rofiles-fuse $(am__append_56) +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 \ + bsdiff/bsdiff.h bsdiff/bspatch.h bsdiff/LICENSE \ + bsdiff/README.md bsdiff/Makefile-bsdiff.am \ src/libostree/libostree.sym src/libostree/README-gpg \ src/libostree/bupsplit.h \ src/libostree/ostree-enumtypes.h.template \ src/libostree/ostree-enumtypes.c.template \ src/libostree/ostree-deployment-private.h \ src/libostree/ostree-repo-deprecated.h \ - src/ostree/parse-datetime.y $(all_dist_test_scripts) \ - $(all_dist_test_data) buildutil/tap-driver.sh \ + src/ostree/parse-datetime.y buildutil/tap-driver.sh \ buildutil/tap-test tests/glib.supp tests/ostree.supp $(NULL) \ - $(am__append_43) $(am__append_45) tests/libostreetest.h \ - tests/libtest.sh tests/gpg-verify-data/README.md $(NULL) \ + $(am__append_43) $(am__append_46) tests/libtest.sh \ + $(am__append_47) 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_53) + src/boot/grub2/ostree-grub-generator $(NULL) $(am__append_55) bin_SCRIPTS = lib_LTLIBRARIES = libostree-1.la -pkglibexec_SCRIPTS = $(am__append_50) -noinst_LTLIBRARIES = libglnx.la libbsdiff.la libotutil.la \ - libostree-kernel-args.la libbupsplit.la $(am__append_29) \ +pkglibexec_SCRIPTS = $(am__append_52) +noinst_LTLIBRARIES = $(am__append_1) libglnx.la libbsdiff.la \ + libotutil.la libostree-kernel-args.la libbupsplit.la \ libostreetest.la privlibdir = $(pkglibdir) privlib_LTLIBRARIES = pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = src/libostree/ostree-1.pc -INTROSPECTION_GIRS = $(am__append_17) +INTROSPECTION_GIRS = $(am__append_28) girdir = $(datadir)/gir-1.0 -gir_DATA = $(am__append_18) +gir_DATA = $(am__append_29) typelibdir = $(libdir)/girepository-1.0 -typelib_DATA = $(am__append_19) +typelib_DATA = $(am__append_30) gsettings_SCHEMAS = ostree_bootdir = $(prefix)/lib/ostree +# We should probably consider flipping the default for DEBUG. Also, +# include the builddir in $PATH so we find our just-built ostree +# binary. +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} \ + 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) +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) +installed_test_SCRIPTS = $(am__append_10) +installed_test_DATA = $(am__append_11) +nobase_installed_test_DATA = +noinst_SCRIPTS = $(am__append_3) +noinst_DATA = $(am__append_4) +check_LTLIBRARIES = $(am__append_5) +check_SCRIPTS = $(am__append_7) +check_DATA = $(am__append_8) + +# Note: build even the installed-only targets during 'make check' to ensure that they still work. +# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to +# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were +# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'. +all_test_programs = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \ + $(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs) + +all_test_scripts = $(test_scripts) $(uninstalled_test_scripts) \ + $(installed_test_scripts) $(test_extra_scripts) \ + $(uninstalled_test_extra_scripts) \ + $(installed_test_extra_scripts) $(all_dist_test_scripts) +all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \ + $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts) + +all_test_data = $(test_data) $(uninstalled_test_data) \ + $(installed_test_data) $(all_dist_test_data) +all_dist_test_data = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data) +all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries) +@ENABLE_INSTALLED_TESTS_TRUE@installed_testcases = $(test_programs) $(installed_test_programs) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(test_scripts) $(installed_test_scripts) \ +@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_scripts) $(dist_installed_test_scripts) + +@ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test) + +# 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_48) \ - $(am__append_51) +INSTALL_DATA_HOOKS = install-mkdir-remotes-d-hook $(am__append_50) \ + $(am__append_53) 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} @@ -1802,11 +1862,11 @@ libostree_kernel_args_la_CFLAGS = -I$(srcdir)/libglnx $(OT_INTERNAL_GIO_UNIX_CFL libostree_kernel_args_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS) libostreeincludedir = $(includedir)/ostree-1 libostreeinclude_HEADERS = $(libostree_public_headers) -ENUM_TYPES = $(NULL) $(am__append_2) -@USE_LIBSOUP_TRUE@ENUM_GENERATED = \ -@USE_LIBSOUP_TRUE@ src/libostree/ostree-enumtypes.h \ -@USE_LIBSOUP_TRUE@ src/libostree/ostree-enumtypes.c \ -@USE_LIBSOUP_TRUE@ $(NULL) +ENUM_TYPES = $(NULL) $(srcdir)/src/libostree/ostree-fetcher.h +ENUM_GENERATED = \ + src/libostree/ostree-enumtypes.h \ + src/libostree/ostree-enumtypes.c \ + $(NULL) libbupsplit_la_SOURCES = \ src/libostree/bupsplit.h \ @@ -1872,8 +1932,8 @@ libostree_1_la_SOURCES = $(ENUM_GENERATED) \ src/libostree/ostree-gpg-verifier.h \ src/libostree/ostree-gpg-verify-result.c \ src/libostree/ostree-gpg-verify-result-private.h \ - src/libostree/ostree-autocleanups.h $(NULL) $(am__append_4) \ - $(am__append_5) $(am__append_10) + src/libostree/ostree-autocleanups.h $(NULL) $(am__append_15) \ + $(am__append_16) $(am__append_21) libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff \ -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil \ -I$(srcdir)/src/libostree -I$(builddir)/src/libostree \ @@ -1881,15 +1941,15 @@ libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff \ $(OT_DEP_LZMA_CFLAGS) $(OT_DEP_ZLIB_CFLAGS) \ -fvisibility=hidden \ '-D_OSTREE_PUBLIC=__attribute__((visibility("default"))) \ - extern' $(am__append_6) $(am__append_8) $(am__append_11) \ - $(am__append_13) $(am__append_15) + extern' $(am__append_17) $(am__append_19) $(am__append_22) \ + $(am__append_24) $(am__append_26) libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -Wl,--version-script=$(top_srcdir)/src/libostree/libostree.sym libostree_1_la_LIBADD = libotutil.la libbupsplit.la libglnx.la \ libbsdiff.la libostree-kernel-args.la \ $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_INTERNAL_GPGME_LIBS) \ - $(OT_DEP_LZMA_LIBS) $(OT_DEP_ZLIB_LIBS) $(am__append_7) \ - $(am__append_9) $(am__append_12) $(am__append_14) \ - $(am__append_16) + $(OT_DEP_LZMA_LIBS) $(OT_DEP_ZLIB_LIBS) $(am__append_18) \ + $(am__append_20) $(am__append_23) $(am__append_25) \ + $(am__append_27) EXTRA_libostree_1_la_DEPENDENCIES = $(top_srcdir)/src/libostree/libostree.sym @BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_EXPORT_PACKAGES = ostree-1 @BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_INCLUDES = Gio-2.0 @@ -1942,25 +2002,22 @@ ostree_SOURCES = src/ostree/main.c src/ostree/ot-builtin-admin.c \ src/ostree/ot-admin-functions.c $(NULL) \ src/ostree/ot-remote-builtins.h \ src/ostree/ot-remote-builtin-add.c \ - src/ostree/ot-remote-builtin-add-cookie.c \ src/ostree/ot-remote-builtin-delete.c \ - src/ostree/ot-remote-builtin-delete-cookie.c \ src/ostree/ot-remote-builtin-gpg-import.c \ src/ostree/ot-remote-builtin-list.c \ - src/ostree/ot-remote-builtin-list-cookies.c \ src/ostree/ot-remote-builtin-show-url.c \ src/ostree/ot-remote-builtin-refs.c \ src/ostree/ot-remote-builtin-summary.c $(NULL) \ - $(am__append_21) + $(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_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_22) $(am__append_24) + $(am__append_33) $(am__append_35) ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS) \ - $(LIBSYSTEMD_LIBS) $(am__append_23) $(am__append_25) + $(LIBSYSTEMD_LIBS) $(am__append_34) $(am__append_36) ostree_prepare_root_SOURCES = \ src/switchroot/ostree-mount-util.h \ src/switchroot/ostree-prepare-root.c \ @@ -1990,64 +2047,17 @@ ostree_remount_CFLAGS = $(AM_CFLAGS) -Isrc/switchroot @BUILDOPT_FUSE_TRUE@rofiles_fuse_SOURCES = src/rofiles-fuse/main.c @BUILDOPT_FUSE_TRUE@rofiles_fuse_CFLAGS = $(AM_CFLAGS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(BUILDOPT_FUSE_CFLAGS) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx $(NULL) @BUILDOPT_FUSE_TRUE@rofiles_fuse_LDADD = libglnx.la $(BUILDOPT_FUSE_LIBS) $(OT_INTERNAL_GIO_UNIX_LIBS) - -# We should probably consider flipping the default for DEBUG. Also, -# include the builddir in $PATH so we find our just-built ostree -# binary. -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 \ - GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd) \ - LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd) PATH=$$(cd \ - $(top_builddir)/tests && pwd):$${PATH} $(NULL) -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_40) -installed_test_SCRIPTS = $(am__append_38) -installed_test_DATA = $(am__append_39) -nobase_installed_test_DATA = -noinst_SCRIPTS = $(am__append_31) -noinst_DATA = $(am__append_32) -check_LTLIBRARIES = $(am__append_33) -check_SCRIPTS = $(am__append_35) -check_DATA = $(am__append_36) - -# Note: build even the installed-only targets during 'make check' to ensure that they still work. -# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to -# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were -# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'. -all_test_programs = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \ - $(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs) - -all_test_scripts = $(test_scripts) $(uninstalled_test_scripts) \ - $(installed_test_scripts) $(test_extra_scripts) \ - $(uninstalled_test_extra_scripts) \ - $(installed_test_extra_scripts) $(all_dist_test_scripts) -all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \ - $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts) - -all_test_data = $(test_data) $(uninstalled_test_data) \ - $(installed_test_data) $(all_dist_test_data) -all_dist_test_data = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data) -all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries) -@ENABLE_INSTALLED_TESTS_TRUE@installed_testcases = $(test_programs) $(installed_test_programs) \ -@ENABLE_INSTALLED_TESTS_TRUE@ $(test_scripts) $(installed_test_scripts) \ -@ENABLE_INSTALLED_TESTS_TRUE@ $(dist_test_scripts) $(dist_installed_test_scripts) - -@ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test) uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-symlink-stamp \ 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-cookies.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-corruption.sh tests/test-pull-depth.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 \ @@ -2073,13 +2083,12 @@ dist_test_scripts = tests/test-basic.sh tests/test-pull-subpath.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_44) $(am__append_45) -# This one uses corrupt-repo-ref.js -js_tests = tests/test-corruption.sh +# These call into gjs scripts +js_tests = tests/test-corruption.sh tests/test-pull-corruption.sh dist_installed_test_data = tests/archive-test.sh \ tests/pull-test.sh \ - tests/libtest.sh \ tests/admin-test.sh \ tests/basic-test.sh \ tests/test-basic-user.sh \ @@ -2124,14 +2133,14 @@ libreaddir_rand_la_LIBADD = \ $(NULL) libreaddir_rand_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version \ - $(am__append_46) + $(am__append_48) 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_47) + $(am__append_49) 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 @@ -2215,7 +2224,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_52) +@ENABLE_MAN_TRUE@ $(am__append_54) @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)) @@ -2238,7 +2247,7 @@ all: $(BUILT_SOURCES) config.h .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile-decls.am $(srcdir)/libglnx/Makefile-libglnx.am.inc $(srcdir)/bsdiff/Makefile-bsdiff.am.inc $(srcdir)/Makefile-otutil.am $(srcdir)/Makefile-libostree.am $(srcdir)/Makefile-libostree-defines.am $(srcdir)/Makefile-ostree.am $(srcdir)/Makefile-switchroot.am $(srcdir)/src/rofiles-fuse/Makefile-inc.am $(srcdir)/Makefile-tests.am $(top_srcdir)/buildutil/glib-tap.mk $(srcdir)/Makefile-boot.am $(srcdir)/Makefile-man.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile-decls.am $(top_srcdir)/buildutil/glib-tap.mk $(srcdir)/libglnx/Makefile-libglnx.am.inc $(srcdir)/bsdiff/Makefile-bsdiff.am.inc $(srcdir)/Makefile-otutil.am $(srcdir)/Makefile-libostree.am $(srcdir)/Makefile-libostree-defines.am $(srcdir)/Makefile-ostree.am $(srcdir)/Makefile-switchroot.am $(srcdir)/src/rofiles-fuse/Makefile-inc.am $(srcdir)/Makefile-tests.am $(srcdir)/Makefile-boot.am $(srcdir)/Makefile-man.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -2260,7 +2269,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/Makefile-decls.am $(srcdir)/libglnx/Makefile-libglnx.am.inc $(srcdir)/bsdiff/Makefile-bsdiff.am.inc $(srcdir)/Makefile-otutil.am $(srcdir)/Makefile-libostree.am $(srcdir)/Makefile-libostree-defines.am $(srcdir)/Makefile-ostree.am $(srcdir)/Makefile-switchroot.am $(srcdir)/src/rofiles-fuse/Makefile-inc.am $(srcdir)/Makefile-tests.am $(top_srcdir)/buildutil/glib-tap.mk $(srcdir)/Makefile-boot.am $(srcdir)/Makefile-man.am $(am__empty): +$(srcdir)/Makefile-decls.am $(top_srcdir)/buildutil/glib-tap.mk $(srcdir)/libglnx/Makefile-libglnx.am.inc $(srcdir)/bsdiff/Makefile-bsdiff.am.inc $(srcdir)/Makefile-otutil.am $(srcdir)/Makefile-libostree.am $(srcdir)/Makefile-libostree-defines.am $(srcdir)/Makefile-ostree.am $(srcdir)/Makefile-switchroot.am $(srcdir)/src/rofiles-fuse/Makefile-inc.am $(srcdir)/Makefile-tests.am $(srcdir)/Makefile-boot.am $(srcdir)/Makefile-man.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -3068,24 +3077,15 @@ src/ostree/ostree-ot-admin-functions.$(OBJEXT): \ src/ostree/ostree-ot-remote-builtin-add.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) -src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT): \ - src/ostree/$(am__dirstamp) \ - src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-delete.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) -src/ostree/ostree-ot-remote-builtin-delete-cookie.$(OBJEXT): \ - src/ostree/$(am__dirstamp) \ - src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-gpg-import.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-list.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) -src/ostree/ostree-ot-remote-builtin-list-cookies.$(OBJEXT): \ - src/ostree/$(am__dirstamp) \ - src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-show-url.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) @@ -3095,6 +3095,15 @@ src/ostree/ostree-ot-remote-builtin-refs.$(OBJEXT): \ src/ostree/ostree-ot-remote-builtin-summary.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) +src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT): \ + src/ostree/$(am__dirstamp) \ + src/ostree/$(DEPDIR)/$(am__dirstamp) +src/ostree/ostree-ot-remote-builtin-delete-cookie.$(OBJEXT): \ + src/ostree/$(am__dirstamp) \ + src/ostree/$(DEPDIR)/$(am__dirstamp) +src/ostree/ostree-ot-remote-builtin-list-cookies.$(OBJEXT): \ + src/ostree/$(am__dirstamp) \ + src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-builtin-pull.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) @@ -4784,20 +4793,6 @@ src/ostree/ostree-ot-remote-builtin-add.obj: src/ostree/ot-remote-builtin-add.c @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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add.obj `if test -f 'src/ostree/ot-remote-builtin-add.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add.c'; fi` -src/ostree/ostree-ot-remote-builtin-add-cookie.o: src/ostree/ot-remote-builtin-add-cookie.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-add-cookie.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.o `test -f 'src/ostree/ot-remote-builtin-add-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-add-cookie.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-add-cookie.c' object='src/ostree/ostree-ot-remote-builtin-add-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.o `test -f 'src/ostree/ot-remote-builtin-add-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-add-cookie.c - -src/ostree/ostree-ot-remote-builtin-add-cookie.obj: src/ostree/ot-remote-builtin-add-cookie.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-add-cookie.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-add-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add-cookie.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-add-cookie.c' object='src/ostree/ostree-ot-remote-builtin-add-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-add-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add-cookie.c'; fi` - src/ostree/ostree-ot-remote-builtin-delete.o: src/ostree/ot-remote-builtin-delete.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete.o `test -f 'src/ostree/ot-remote-builtin-delete.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete.Po @@ -4812,20 +4807,6 @@ src/ostree/ostree-ot-remote-builtin-delete.obj: src/ostree/ot-remote-builtin-del @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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete.obj `if test -f 'src/ostree/ot-remote-builtin-delete.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete.c'; fi` -src/ostree/ostree-ot-remote-builtin-delete-cookie.o: src/ostree/ot-remote-builtin-delete-cookie.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete-cookie.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.o `test -f 'src/ostree/ot-remote-builtin-delete-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete-cookie.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-delete-cookie.c' object='src/ostree/ostree-ot-remote-builtin-delete-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.o `test -f 'src/ostree/ot-remote-builtin-delete-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete-cookie.c - -src/ostree/ostree-ot-remote-builtin-delete-cookie.obj: src/ostree/ot-remote-builtin-delete-cookie.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete-cookie.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-delete-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete-cookie.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-delete-cookie.c' object='src/ostree/ostree-ot-remote-builtin-delete-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-delete-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete-cookie.c'; fi` - src/ostree/ostree-ot-remote-builtin-gpg-import.o: src/ostree/ot-remote-builtin-gpg-import.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-gpg-import.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-gpg-import.Tpo -c -o src/ostree/ostree-ot-remote-builtin-gpg-import.o `test -f 'src/ostree/ot-remote-builtin-gpg-import.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-gpg-import.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-gpg-import.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-gpg-import.Po @@ -4854,20 +4835,6 @@ src/ostree/ostree-ot-remote-builtin-list.obj: src/ostree/ot-remote-builtin-list. @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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list.obj `if test -f 'src/ostree/ot-remote-builtin-list.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list.c'; fi` -src/ostree/ostree-ot-remote-builtin-list-cookies.o: src/ostree/ot-remote-builtin-list-cookies.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-list-cookies.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.o `test -f 'src/ostree/ot-remote-builtin-list-cookies.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-list-cookies.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-list-cookies.c' object='src/ostree/ostree-ot-remote-builtin-list-cookies.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.o `test -f 'src/ostree/ot-remote-builtin-list-cookies.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-list-cookies.c - -src/ostree/ostree-ot-remote-builtin-list-cookies.obj: src/ostree/ot-remote-builtin-list-cookies.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-list-cookies.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.obj `if test -f 'src/ostree/ot-remote-builtin-list-cookies.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list-cookies.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list-cookies.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-list-cookies.c' object='src/ostree/ostree-ot-remote-builtin-list-cookies.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.obj `if test -f 'src/ostree/ot-remote-builtin-list-cookies.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list-cookies.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list-cookies.c'; fi` - src/ostree/ostree-ot-remote-builtin-show-url.o: src/ostree/ot-remote-builtin-show-url.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-show-url.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Tpo -c -o src/ostree/ostree-ot-remote-builtin-show-url.o `test -f 'src/ostree/ot-remote-builtin-show-url.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-show-url.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Po @@ -4910,6 +4877,48 @@ src/ostree/ostree-ot-remote-builtin-summary.obj: src/ostree/ot-remote-builtin-su @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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-summary.obj `if test -f 'src/ostree/ot-remote-builtin-summary.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-summary.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-summary.c'; fi` +src/ostree/ostree-ot-remote-builtin-add-cookie.o: src/ostree/ot-remote-builtin-add-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-add-cookie.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.o `test -f 'src/ostree/ot-remote-builtin-add-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-add-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-add-cookie.c' object='src/ostree/ostree-ot-remote-builtin-add-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.o `test -f 'src/ostree/ot-remote-builtin-add-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-add-cookie.c + +src/ostree/ostree-ot-remote-builtin-add-cookie.obj: src/ostree/ot-remote-builtin-add-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-add-cookie.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-add-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add-cookie.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-add-cookie.c' object='src/ostree/ostree-ot-remote-builtin-add-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-add-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add-cookie.c'; fi` + +src/ostree/ostree-ot-remote-builtin-delete-cookie.o: src/ostree/ot-remote-builtin-delete-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete-cookie.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.o `test -f 'src/ostree/ot-remote-builtin-delete-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-delete-cookie.c' object='src/ostree/ostree-ot-remote-builtin-delete-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.o `test -f 'src/ostree/ot-remote-builtin-delete-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete-cookie.c + +src/ostree/ostree-ot-remote-builtin-delete-cookie.obj: src/ostree/ot-remote-builtin-delete-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete-cookie.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-delete-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete-cookie.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-delete-cookie.c' object='src/ostree/ostree-ot-remote-builtin-delete-cookie.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-delete-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete-cookie.c'; fi` + +src/ostree/ostree-ot-remote-builtin-list-cookies.o: src/ostree/ot-remote-builtin-list-cookies.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-list-cookies.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.o `test -f 'src/ostree/ot-remote-builtin-list-cookies.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-list-cookies.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-list-cookies.c' object='src/ostree/ostree-ot-remote-builtin-list-cookies.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.o `test -f 'src/ostree/ot-remote-builtin-list-cookies.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-list-cookies.c + +src/ostree/ostree-ot-remote-builtin-list-cookies.obj: src/ostree/ot-remote-builtin-list-cookies.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-list-cookies.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.obj `if test -f 'src/ostree/ot-remote-builtin-list-cookies.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list-cookies.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list-cookies.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-list-cookies.c' object='src/ostree/ostree-ot-remote-builtin-list-cookies.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_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.obj `if test -f 'src/ostree/ot-remote-builtin-list-cookies.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list-cookies.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list-cookies.c'; fi` + src/ostree/ostree-ot-builtin-pull.o: src/ostree/ot-builtin-pull.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-builtin-pull.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-builtin-pull.Tpo -c -o src/ostree/ostree-ot-builtin-pull.o `test -f 'src/ostree/ot-builtin-pull.c' || echo '$(srcdir)/'`src/ostree/ot-builtin-pull.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-builtin-pull.Tpo src/ostree/$(DEPDIR)/ostree-ot-builtin-pull.Po @@ -6075,13 +6084,6 @@ tests/test-remote-add.sh.log: tests/test-remote-add.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-remote-cookies.sh.log: tests/test-remote-cookies.sh - @p='tests/test-remote-cookies.sh'; \ - b='tests/test-remote-cookies.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-remote-headers.sh.log: tests/test-remote-headers.sh @p='tests/test-remote-headers.sh'; \ b='tests/test-remote-headers.sh'; \ @@ -6145,13 +6147,6 @@ tests/test-pull-commit-only.sh.log: tests/test-pull-commit-only.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-corruption.sh.log: tests/test-pull-corruption.sh - @p='tests/test-pull-corruption.sh'; \ - b='tests/test-pull-corruption.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-depth.sh.log: tests/test-pull-depth.sh @p='tests/test-pull-depth.sh'; \ b='tests/test-pull-depth.sh'; \ @@ -6425,6 +6420,13 @@ tests/test-rofiles-fuse.sh.log: tests/test-rofiles-fuse.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-remote-cookies.sh.log: tests/test-remote-cookies.sh + @p='tests/test-remote-cookies.sh'; \ + b='tests/test-remote-cookies.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-corruption.sh.log: tests/test-corruption.sh @p='tests/test-corruption.sh'; \ b='tests/test-corruption.sh'; \ @@ -6432,6 +6434,13 @@ tests/test-corruption.sh.log: tests/test-corruption.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-corruption.sh.log: tests/test-pull-corruption.sh + @p='tests/test-pull-corruption.sh'; \ + b='tests/test-pull-corruption.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-symbols.sh.log: tests/test-symbols.sh @p='tests/test-symbols.sh'; \ b='tests/test-symbols.sh'; \ @@ -6883,6 +6892,12 @@ uninstall-man: uninstall-man1 uninstall-man5 .PRECIOUS: Makefile + +@ENABLE_INSTALLED_TESTS_TRUE@%.test: %$(EXEEXT) Makefile +@ENABLE_INSTALLED_TESTS_TRUE@ $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ echo 'Type=session' >> $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ echo 'Exec=env G_TEST_SRCDIR=$(installed_testdir) G_TEST_BUILDDIR=$(installed_testdir) $(installed_testdir)/$(notdir $<)' >> $@.tmp; \ +@ENABLE_INSTALLED_TESTS_TRUE@ mv $@.tmp $@) install-data-hook: $(INSTALL_DATA_HOOKS) all-local: $(ALL_LOCAL_RULES) @@ -6910,12 +6925,6 @@ src/ostree/parse-datetime.c: src/ostree/parse-datetime.y Makefile @BUILDOPT_USE_STATIC_COMPILER_TRUE@ostree-prepare-root : $(ostree_prepare_root_SOURCES) @BUILDOPT_USE_STATIC_COMPILER_TRUE@ $(STATIC_COMPILER) -o $@ -static $(ostree_prepare_root_SOURCES) $(AM_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES) -@ENABLE_INSTALLED_TESTS_TRUE@%.test: %$(EXEEXT) Makefile -@ENABLE_INSTALLED_TESTS_TRUE@ $(AM_V_GEN) (echo '[Test]' > $@.tmp; \ -@ENABLE_INSTALLED_TESTS_TRUE@ echo 'Type=session' >> $@.tmp; \ -@ENABLE_INSTALLED_TESTS_TRUE@ echo 'Exec=env G_TEST_SRCDIR=$(installed_testdir) G_TEST_BUILDDIR=$(installed_testdir) $(installed_testdir)/$(notdir $<)' >> $@.tmp; \ -@ENABLE_INSTALLED_TESTS_TRUE@ mv $@.tmp $@) - tests/libreaddir-rand.so: Makefile $(AM_V_GEN) ln -fns ../.libs/libreaddir-rand.so tests @@ -6933,11 +6942,13 @@ tests/%-symlink-stamp: % Makefile # Unfortunately the glib test data APIs don't actually handle # non-recursive Automake, so we change our code to canonically look # for tests/ which is just a symlink when installed. -@ENABLE_INSTALLED_TESTS_TRUE@install-test-data-file-path-hack: +@ENABLE_INSTALLED_TESTS_TRUE@install-installed-tests-extra: @ENABLE_INSTALLED_TESTS_TRUE@ if test -L $(DESTDIR)$(installed_testdir)/tests; then \ @ENABLE_INSTALLED_TESTS_TRUE@ rm $(DESTDIR)$(installed_testdir)/tests; \ @ENABLE_INSTALLED_TESTS_TRUE@ fi @ENABLE_INSTALLED_TESTS_TRUE@ ln -s . $(DESTDIR)$(installed_testdir)/tests +@BUILDOPT_ASAN_TRUE@@ENABLE_INSTALLED_TESTS_TRUE@ sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh +@BUILDOPT_ASAN_FALSE@@ENABLE_INSTALLED_TESTS_TRUE@ install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh @BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@install-grub2-config-hook: @BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@ mkdir -p $(DESTDIR)$(grub2configdir) @BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@ ln -sf $(pkglibexecdir)/grub2-15_ostree $(DESTDIR)$(grub2configdir)/15_ostree diff --git a/apidoc/html/index.html b/apidoc/html/index.html index 7dd1ebb2..2cf1bcc6 100644 --- a/apidoc/html/index.html +++ b/apidoc/html/index.html @@ -14,7 +14,7 @@
-

for OSTree 2016.13

+

for OSTree 2016.14


diff --git a/apidoc/html/ostree-Content-addressed-object-store.html b/apidoc/html/ostree-Content-addressed-object-store.html index 21021af0..8363a580 100644 --- a/apidoc/html/ostree-Content-addressed-object-store.html +++ b/apidoc/html/ostree-Content-addressed-object-store.html @@ -1913,14 +1913,15 @@ with

out_summary

-

return location for raw summary data, or NULL.

-[nullable] +

return location for raw summary data, or +NULL.

+[out][optional]

out_signatures

-

return location for raw summary signature -data, or NULL.

-[nullable] +

return location for raw summary +signature data, or NULL.

+[out][optional]

cancellable

@@ -1981,14 +1982,15 @@ The following are currently defined:

out_summary

-

return location for raw summary data, or NULL.

-[nullable] +

return location for raw summary data, or +NULL.

+[out][optional]

out_signatures

-

return location for raw summary signature -data, or NULL.

-[nullable] +

return location for raw summary +signature data, or NULL.

+[out][optional]

cancellable

diff --git a/apidoc/version.xml b/apidoc/version.xml index 59b8f451..48bb1233 100644 --- a/apidoc/version.xml +++ b/apidoc/version.xml @@ -1 +1 @@ -2016.13 \ No newline at end of file +2016.14 \ No newline at end of file diff --git a/buildutil/tap-test b/buildutil/tap-test index c8da31e7..ac729d8d 100755 --- a/buildutil/tap-test +++ b/buildutil/tap-test @@ -19,7 +19,11 @@ function skip_cleanup() { echo "Skipping cleanup of ${tempdir}" } cd ${tempdir} -${srcd}/${bn} -k --tap +timeout \ + --kill-after=60 \ + --signal=ABRT \ + $(( 600 * ${TEST_TIMEOUT_FACTOR:-1} )) \ + ${srcd}/${bn} -k --tap rc=$? case "${TEST_SKIP_CLEANUP:-}" in no|"") cleanup ;; diff --git a/configure b/configure index 7ea80c0f..70e531f3 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ostree 2016.14. +# Generated by GNU Autoconf 2.69 for ostree 2016.15. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ostree' PACKAGE_TARNAME='ostree' -PACKAGE_VERSION='2016.14' -PACKAGE_STRING='ostree 2016.14' +PACKAGE_VERSION='2016.15' +PACKAGE_STRING='ostree 2016.15' PACKAGE_BUGREPORT='walters@verbum.org' PACKAGE_URL='' @@ -770,6 +770,8 @@ build_vendor build_cpu build LIBTOOL +BUILDOPT_ASAN_FALSE +BUILDOPT_ASAN_TRUE WARN_CFLAGS YFLAGS YACC @@ -1480,7 +1482,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ostree 2016.14 to adapt to many kinds of systems. +\`configure' configures ostree 2016.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1552,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ostree 2016.14:";; + short | recursive ) echo "Configuration of ostree 2016.15:";; esac cat <<\_ACEOF @@ -1759,7 +1761,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ostree configure 2016.14 +ostree configure 2016.15 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2174,7 +2176,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ostree $as_me 2016.14, which was +It was created by ostree $as_me 2016.15, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3041,7 +3043,7 @@ fi # Define the identity of the package. PACKAGE='ostree' - VERSION='2016.14' + VERSION='2016.15' # Some tools Automake needs. @@ -5787,6 +5789,9 @@ test -n "$YACC" || YACC="yacc" -Werror=return-type \ -Werror=overflow \ -Werror=int-conversion \ + -Werror=parenthesis \ + -Werror=incompatible-pointer-types \ + -Werror=misleading-indentation \ -Werror=missing-include-dirs -Werror=aggregate-return \ -Werror=declaration-after-statement \ ; do @@ -5823,6 +5828,25 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=address in CFLAGS" >&5 +$as_echo_n "checking for -fsanitize=address in CFLAGS... " >&6; } +if echo $CFLAGS | grep -q -e -fsanitize=address; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + using_asan=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test x$using_asan = xyes; then + BUILDOPT_ASAN_TRUE= + BUILDOPT_ASAN_FALSE='#' +else + BUILDOPT_ASAN_TRUE='#' + BUILDOPT_ASAN_FALSE= +fi + + # Initialize libtool case `pwd` in @@ -14096,7 +14120,7 @@ rm -f core conftest.err conftest.$ac_objext \ GOBJECT_QUERY="" GLIB_MKENUMS="" GLIB_COMPILE_RESOURCES="" - : + as_fn_error $? "GLib not found" "$LINENO" 5 fi @@ -16392,7 +16416,7 @@ fi STATIC_COMPILER=$with_static_compiler -if test "x$found_introspection" = xyes; then : +if test "x$found_introspection" = xyes && test x$using_asan != xyes; then : # Extract the first word of "gjs", so it can be a program name with args. set dummy gjs; ac_word=$2 @@ -16595,6 +16619,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${BUILDOPT_ASAN_TRUE}" && test -z "${BUILDOPT_ASAN_FALSE}"; then + as_fn_error $? "conditional \"BUILDOPT_ASAN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_INSTALLED_TESTS_TRUE}" && test -z "${ENABLE_INSTALLED_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_INSTALLED_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -17092,7 +17120,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ostree $as_me 2016.14, which was +This file was extended by ostree $as_me 2016.15, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17158,7 +17186,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ostree config.status 2016.14 +ostree config.status 2016.15 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index cb1cc980..c59b3f7b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.63]) dnl If incrementing the version here, remember to update libostree.sym too -AC_INIT([ostree], [2016.14], [walters@verbum.org]) +AC_INIT([ostree], [2016.15], [walters@verbum.org]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([buildutil]) AC_CONFIG_AUX_DIR([build-aux]) @@ -29,11 +29,23 @@ CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\ -Werror=return-type \ -Werror=overflow \ -Werror=int-conversion \ + -Werror=parenthesis \ + -Werror=incompatible-pointer-types \ + -Werror=misleading-indentation \ -Werror=missing-include-dirs -Werror=aggregate-return \ -Werror=declaration-after-statement \ ]) AC_SUBST(WARN_CFLAGS) +AC_MSG_CHECKING([for -fsanitize=address in CFLAGS]) +if echo $CFLAGS | grep -q -e -fsanitize=address; then + AC_MSG_RESULT([yes]) + using_asan=yes +else + AC_MSG_RESULT([no]) +fi +AM_CONDITIONAL(BUILDOPT_ASAN, [test x$using_asan = xyes]) + # Initialize libtool LT_PREREQ([2.2.4]) LT_INIT([disable-static]) @@ -50,7 +62,7 @@ AS_IF([test "$YACC" != "bison -y"], [AC_MSG_ERROR([bison not found but required] PKG_PROG_PKG_CONFIG -AM_PATH_GLIB_2_0 +AM_PATH_GLIB_2_0(,,AC_MSG_ERROR([GLib not found])) dnl When bumping the gio-unix-2.0 dependency (or glib-2.0 in general), dnl remember to bump GLIB_VERSION_MIN_REQUIRED and @@ -302,8 +314,9 @@ AC_ARG_WITH(static-compiler, AM_CONDITIONAL(BUILDOPT_USE_STATIC_COMPILER, test x$with_static_compiler != xno) AC_SUBST(STATIC_COMPILER, $with_static_compiler) -dnl for tests -AS_IF([test "x$found_introspection" = xyes], [ +dnl for tests (but we can't use asan with gjs or any introspection, +dnl see https://github.com/google/sanitizers/wiki/AddressSanitizerAsDso for more info) +AS_IF([test "x$found_introspection" = xyes && test x$using_asan != xyes], [ AC_PATH_PROG(GJS, [gjs]) if test -n "$GJS"; then have_gjs=yes diff --git a/man/ostree-admin-cleanup.1 b/man/ostree-admin-cleanup.1 index 2574ebf9..96eb3ba2 100644 --- a/man/ostree-admin-cleanup.1 +++ b/man/ostree-admin-cleanup.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin cleanup .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin cleanup .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-config-diff.1 b/man/ostree-admin-config-diff.1 index 534df818..a0206616 100644 --- a/man/ostree-admin-config-diff.1 +++ b/man/ostree-admin-config-diff.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin config-diff .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin config-diff .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-deploy.1 b/man/ostree-admin-deploy.1 index 2abfefbf..f23147fc 100644 --- a/man/ostree-admin-deploy.1 +++ b/man/ostree-admin-deploy.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin deploy .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin deploy .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-init-fs.1 b/man/ostree-admin-init-fs.1 index 431afcd8..98234a0a 100644 --- a/man/ostree-admin-init-fs.1 +++ b/man/ostree-admin-init-fs.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin init-fs .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin init-fs .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-instutil.1 b/man/ostree-admin-instutil.1 index 130c1511..fbfe3a49 100644 --- a/man/ostree-admin-instutil.1 +++ b/man/ostree-admin-instutil.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin instutil .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin instutil .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-os-init.1 b/man/ostree-admin-os-init.1 index 88e7463b..0b90e24d 100644 --- a/man/ostree-admin-os-init.1 +++ b/man/ostree-admin-os-init.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin os-init .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin os-init .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-set-origin.1 b/man/ostree-admin-set-origin.1 index d44cf6cd..f45cbe4f 100644 --- a/man/ostree-admin-set-origin.1 +++ b/man/ostree-admin-set-origin.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin set-origin .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin set-origin .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-status.1 b/man/ostree-admin-status.1 index 9b92d3d9..9f65e332 100644 --- a/man/ostree-admin-status.1 +++ b/man/ostree-admin-status.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin status .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin status .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-switch.1 b/man/ostree-admin-switch.1 index 9434d242..46cc6029 100644 --- a/man/ostree-admin-switch.1 +++ b/man/ostree-admin-switch.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin switch .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin switch .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-undeploy.1 b/man/ostree-admin-undeploy.1 index de53813b..6f3bbe52 100644 --- a/man/ostree-admin-undeploy.1 +++ b/man/ostree-admin-undeploy.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin undeploy .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin undeploy .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-unlock.1 b/man/ostree-admin-unlock.1 index 266228db..ec5b79f1 100644 --- a/man/ostree-admin-unlock.1 +++ b/man/ostree-admin-unlock.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin unlock .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin unlock .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-upgrade.1 b/man/ostree-admin-upgrade.1 index 9182a17d..4a9962ee 100644 --- a/man/ostree-admin-upgrade.1 +++ b/man/ostree-admin-upgrade.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin upgrade .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin upgrade .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin.1 b/man/ostree-admin.1 index 9d378799..7140a617 100644 --- a/man/ostree-admin.1 +++ b/man/ostree-admin.1 @@ -2,7 +2,7 @@ .\" Title: ostree admin .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree admin .\" Source: OSTree .\" Language: English diff --git a/man/ostree-cat.1 b/man/ostree-cat.1 index f715b1f4..fafe526f 100644 --- a/man/ostree-cat.1 +++ b/man/ostree-cat.1 @@ -2,7 +2,7 @@ .\" Title: ostree cat .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree cat .\" Source: OSTree .\" Language: English diff --git a/man/ostree-checkout.1 b/man/ostree-checkout.1 index cad60467..48cfbf7e 100644 --- a/man/ostree-checkout.1 +++ b/man/ostree-checkout.1 @@ -2,7 +2,7 @@ .\" Title: ostree checkout .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree checkout .\" Source: OSTree .\" Language: English diff --git a/man/ostree-checksum.1 b/man/ostree-checksum.1 index ea294a0c..f63e3ad0 100644 --- a/man/ostree-checksum.1 +++ b/man/ostree-checksum.1 @@ -2,7 +2,7 @@ .\" Title: ostree checksum .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree checksum .\" Source: OSTree .\" Language: English diff --git a/man/ostree-commit.1 b/man/ostree-commit.1 index 60d49645..cf8be860 100644 --- a/man/ostree-commit.1 +++ b/man/ostree-commit.1 @@ -2,7 +2,7 @@ .\" Title: ostree commit .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree commit .\" Source: OSTree .\" Language: English diff --git a/man/ostree-config.1 b/man/ostree-config.1 index 52516b0c..fd63ccf4 100644 --- a/man/ostree-config.1 +++ b/man/ostree-config.1 @@ -2,7 +2,7 @@ .\" Title: ostree config .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree config .\" Source: OSTree .\" Language: English diff --git a/man/ostree-diff.1 b/man/ostree-diff.1 index dd0ad736..d9223f0b 100644 --- a/man/ostree-diff.1 +++ b/man/ostree-diff.1 @@ -2,7 +2,7 @@ .\" Title: ostree diff .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree diff .\" Source: OSTree .\" Language: English diff --git a/man/ostree-export.1 b/man/ostree-export.1 index 49d614f5..024c0962 100644 --- a/man/ostree-export.1 +++ b/man/ostree-export.1 @@ -2,7 +2,7 @@ .\" Title: ostree export .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree export .\" Source: OSTree .\" Language: English diff --git a/man/ostree-fsck.1 b/man/ostree-fsck.1 index 2892efd6..d32e2bba 100644 --- a/man/ostree-fsck.1 +++ b/man/ostree-fsck.1 @@ -2,7 +2,7 @@ .\" Title: ostree fsck .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree fsck .\" Source: OSTree .\" Language: English diff --git a/man/ostree-gpg-sign.1 b/man/ostree-gpg-sign.1 index bea9b740..5de200c9 100644 --- a/man/ostree-gpg-sign.1 +++ b/man/ostree-gpg-sign.1 @@ -2,7 +2,7 @@ .\" Title: ostree gpg-sign .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree gpg-sign .\" Source: OSTree .\" Language: English diff --git a/man/ostree-init.1 b/man/ostree-init.1 index e8711761..ceb55490 100644 --- a/man/ostree-init.1 +++ b/man/ostree-init.1 @@ -2,7 +2,7 @@ .\" Title: ostree init .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree init .\" Source: OSTree .\" Language: English @@ -39,5 +39,5 @@ Creates a new empty repository\&. .PP \fB\-\-mode\fR="MODE" .RS 4 -Initialize repository in given mode (bare, archive\-z2)\&. Default is "bare"\&. +Initialize repository in given mode (bare, bare\-user, archive\-z2)\&. Default is "bare"\&. .RE diff --git a/man/ostree-init.xml b/man/ostree-init.xml index 4518e244..95f0b162 100644 --- a/man/ostree-init.xml +++ b/man/ostree-init.xml @@ -68,7 +68,7 @@ Boston, MA 02111-1307, USA. ="MODE" - Initialize repository in given mode (bare, archive-z2). Default is "bare". + Initialize repository in given mode (bare, bare-user, archive-z2). Default is "bare". diff --git a/man/ostree-log.1 b/man/ostree-log.1 index 3da63f50..8ab5c3c2 100644 --- a/man/ostree-log.1 +++ b/man/ostree-log.1 @@ -2,7 +2,7 @@ .\" Title: ostree log .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree log .\" Source: OSTree .\" Language: English diff --git a/man/ostree-ls.1 b/man/ostree-ls.1 index 7a9e4eef..379def88 100644 --- a/man/ostree-ls.1 +++ b/man/ostree-ls.1 @@ -2,7 +2,7 @@ .\" Title: ostree ls .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree ls .\" Source: OSTree .\" Language: English diff --git a/man/ostree-prune.1 b/man/ostree-prune.1 index 9012e0ad..d45e6acf 100644 --- a/man/ostree-prune.1 +++ b/man/ostree-prune.1 @@ -2,7 +2,7 @@ .\" Title: ostree prune .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree prune .\" Source: OSTree .\" Language: English diff --git a/man/ostree-pull-local.1 b/man/ostree-pull-local.1 index 80551754..9645a046 100644 --- a/man/ostree-pull-local.1 +++ b/man/ostree-pull-local.1 @@ -2,7 +2,7 @@ .\" Title: ostree pull-local .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree pull-local .\" Source: OSTree .\" Language: English diff --git a/man/ostree-pull.1 b/man/ostree-pull.1 index 1a326248..2078bc26 100644 --- a/man/ostree-pull.1 +++ b/man/ostree-pull.1 @@ -2,7 +2,7 @@ .\" Title: ostree pull .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree pull .\" Source: OSTree .\" Language: English diff --git a/man/ostree-refs.1 b/man/ostree-refs.1 index 669ac8e8..b29a3dae 100644 --- a/man/ostree-refs.1 +++ b/man/ostree-refs.1 @@ -2,7 +2,7 @@ .\" Title: ostree refs .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree refs .\" Source: OSTree .\" Language: English diff --git a/man/ostree-remote.1 b/man/ostree-remote.1 index 57359f7a..69072bf4 100644 --- a/man/ostree-remote.1 +++ b/man/ostree-remote.1 @@ -2,7 +2,7 @@ .\" Title: ostree remote .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree remote .\" Source: OSTree .\" Language: English diff --git a/man/ostree-reset.1 b/man/ostree-reset.1 index fe4d901c..5ed1bada 100644 --- a/man/ostree-reset.1 +++ b/man/ostree-reset.1 @@ -2,7 +2,7 @@ .\" Title: ostree reset .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree reset .\" Source: OSTree .\" Language: English diff --git a/man/ostree-rev-parse.1 b/man/ostree-rev-parse.1 index 372f2ea9..f571fd03 100644 --- a/man/ostree-rev-parse.1 +++ b/man/ostree-rev-parse.1 @@ -2,7 +2,7 @@ .\" Title: ostree rev-parse .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree rev-parse .\" Source: OSTree .\" Language: English diff --git a/man/ostree-show.1 b/man/ostree-show.1 index eee57251..dc5611cb 100644 --- a/man/ostree-show.1 +++ b/man/ostree-show.1 @@ -2,7 +2,7 @@ .\" Title: ostree show .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree show .\" Source: OSTree .\" Language: English diff --git a/man/ostree-static-delta.1 b/man/ostree-static-delta.1 index 67eef6de..b80e73c2 100644 --- a/man/ostree-static-delta.1 +++ b/man/ostree-static-delta.1 @@ -2,7 +2,7 @@ .\" Title: ostree static-delta .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree static-delta .\" Source: OSTree .\" Language: English diff --git a/man/ostree-summary.1 b/man/ostree-summary.1 index b42b9eab..a6091579 100644 --- a/man/ostree-summary.1 +++ b/man/ostree-summary.1 @@ -2,7 +2,7 @@ .\" Title: ostree summary .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree summary .\" Source: OSTree .\" Language: English diff --git a/man/ostree-trivial-httpd.1 b/man/ostree-trivial-httpd.1 index 26460d5e..46c0b848 100644 --- a/man/ostree-trivial-httpd.1 +++ b/man/ostree-trivial-httpd.1 @@ -2,7 +2,7 @@ .\" Title: ostree trivial-httpd .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree trivial-httpd .\" Source: OSTree .\" Language: English diff --git a/man/ostree.1 b/man/ostree.1 index 60cb46bc..2570e397 100644 --- a/man/ostree.1 +++ b/man/ostree.1 @@ -2,7 +2,7 @@ .\" Title: ostree .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree .\" Source: OSTree .\" Language: English diff --git a/man/ostree.repo-config.5 b/man/ostree.repo-config.5 index d397af15..5251faa5 100644 --- a/man/ostree.repo-config.5 +++ b/man/ostree.repo-config.5 @@ -2,7 +2,7 @@ .\" Title: ostree.repo-config .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree.repo-config .\" Source: OSTree .\" Language: English @@ -47,7 +47,8 @@ Repository\-global options\&. The following entries are defined: \fImode\fR .RS 4 One of -bare +bare, +bare\-user or archive\-z2\&. .RE @@ -125,6 +126,11 @@ Path to file containing client\-side certificate key, to present when making req .RS 4 Path to file containing trusted anchors instead of the system CA database\&. .RE +.PP +\fIunconfigured\-state\fR +.RS 4 +If set, pulls from this remote will fail with the configured text\&. This is intended for OS vendors which have a subscription process to access content\&. +.RE .SH "/ETC/OSTREE/REMOTES\&.D" .PP In addition to the diff --git a/man/ostree.repo-config.xml b/man/ostree.repo-config.xml index 876c9dfc..b4c276df 100644 --- a/man/ostree.repo-config.xml +++ b/man/ostree.repo-config.xml @@ -76,7 +76,7 @@ Boston, MA 02111-1307, USA. mode - One of bare or archive-z2. + One of bare, bare-user or archive-z2. @@ -179,6 +179,11 @@ Boston, MA 02111-1307, USA. tls-ca-path Path to file containing trusted anchors instead of the system CA database. + + + unconfigured-state + If set, pulls from this remote will fail with the configured text. This is intended for OS vendors which have a subscription process to access content. + diff --git a/man/ostree.repo.5 b/man/ostree.repo.5 index 886a537c..7f2d121d 100644 --- a/man/ostree.repo.5 +++ b/man/ostree.repo.5 @@ -2,7 +2,7 @@ .\" Title: ostree.repo .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: ostree.repo .\" Source: OSTree .\" Language: English @@ -33,8 +33,11 @@ ostree.repo \- OSTree repository configuration and layout .PP An OSTree repository is structurally similar to a git repository; it is a content\-addressed object store containing filesystem trees\&. However, unlike git, ostree is designed to store operating system binaries\&. It records the Unix uid and gid, permissions, as well as extended attributes\&. .PP -A repository can be in one of two modes; -bare, which is designed as a hard link source for operating system checkouts, and +A repository can be in one of three modes; +bare, which is designed as a hard link source for operating system checkouts, +bare\-user, which is like +bare +but works on systems that run as non\-root as well as non\-root containers, and archive\-z2, which is designed for static HTTP servers\&. .PP There is a system repository located at diff --git a/man/ostree.repo.xml b/man/ostree.repo.xml index b8ad4052..1187b66a 100644 --- a/man/ostree.repo.xml +++ b/man/ostree.repo.xml @@ -58,11 +58,14 @@ binaries. It records the Unix uid and gid, permissions, as well as extended attributes. - + - A repository can be in one of two modes; + A repository can be in one of three modes; bare, which is designed as a hard - link source for operating system checkouts, and + link source for operating system checkouts, + bare-user, which is like + bare but works on systems that + run as non-root as well as non-root containers, and archive-z2, which is designed for static HTTP servers. diff --git a/man/rofiles-fuse.1 b/man/rofiles-fuse.1 index 523b5380..4e95d411 100644 --- a/man/rofiles-fuse.1 +++ b/man/rofiles-fuse.1 @@ -2,7 +2,7 @@ .\" Title: rofiles-fuse .\" Author: Colin Walters .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/23/2016 +.\" Date: 12/12/2016 .\" Manual: rofiles-fuse .\" Source: rofiles-fuse .\" Language: English diff --git a/src/libostree/libostree.sym b/src/libostree/libostree.sym index 0540cba6..0b8410fb 100644 --- a/src/libostree/libostree.sym +++ b/src/libostree/libostree.sym @@ -364,6 +364,8 @@ global: ostree_repo_verify_commit_for_remote; } LIBOSTREE_2016.8; +/* No new symbols in 2016.15 */ + /* NOTE NOTE NOTE * Versions above here are released. Only add symbols below this line. * NOTE NOTE NOTE diff --git a/src/libostree/ostree-bootconfig-parser.c b/src/libostree/ostree-bootconfig-parser.c index f7728e42..8031334e 100644 --- a/src/libostree/ostree-bootconfig-parser.c +++ b/src/libostree/ostree-bootconfig-parser.c @@ -28,7 +28,7 @@ struct _OstreeBootconfigParser GObject parent_instance; gboolean parsed; - char *separators; + const char *separators; GHashTable *options; GPtrArray *lines; @@ -193,7 +193,7 @@ ostree_bootconfig_parser_write_at (OstreeBootconfigParser *self, else { write_key (self, buf, key, value); - g_hash_table_insert (written_overrides, (gpointer)key, (gpointer)key); + g_hash_table_add (written_overrides, (gpointer)key); } } @@ -235,7 +235,6 @@ ostree_bootconfig_parser_finalize (GObject *object) g_hash_table_unref (self->options); g_ptr_array_unref (self->lines); - g_free (self->separators); G_OBJECT_CLASS (ostree_bootconfig_parser_parent_class)->finalize (object); } @@ -261,6 +260,6 @@ ostree_bootconfig_parser_new (void) OstreeBootconfigParser *self = NULL; self = g_object_new (OSTREE_TYPE_BOOTCONFIG_PARSER, NULL); - self->separators = g_strdup (" \t"); + self->separators = " \t"; return self; } diff --git a/src/libostree/ostree-deployment.c b/src/libostree/ostree-deployment.c index 7b93e6cc..67e896bf 100644 --- a/src/libostree/ostree-deployment.c +++ b/src/libostree/ostree-deployment.c @@ -133,7 +133,6 @@ OstreeDeployment * ostree_deployment_clone (OstreeDeployment *self) { glnx_unref_object OstreeBootconfigParser *new_bootconfig = NULL; - GKeyFile *new_origin = NULL; OstreeDeployment *ret = ostree_deployment_new (self->index, self->osname, self->csum, self->deployserial, self->bootcsum, self->bootserial); @@ -143,6 +142,7 @@ ostree_deployment_clone (OstreeDeployment *self) if (self->origin) { + g_autoptr(GKeyFile) new_origin = NULL; g_autofree char *data = NULL; gsize len; gboolean success; diff --git a/src/libostree/ostree-enumtypes.c b/src/libostree/ostree-enumtypes.c index fcb96841..12c3a477 100644 --- a/src/libostree/ostree-enumtypes.c +++ b/src/libostree/ostree-enumtypes.c @@ -20,7 +20,13 @@ * Boston, MA 02111-1307, USA. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include + #include "ostree-enumtypes.h" + /* enumerations from "./src/libostree/ostree-fetcher.h" */ #include "./src/libostree/ostree-fetcher.h" diff --git a/src/libostree/ostree-enumtypes.c.template b/src/libostree/ostree-enumtypes.c.template index ab1b2aec..52da7de1 100644 --- a/src/libostree/ostree-enumtypes.c.template +++ b/src/libostree/ostree-enumtypes.c.template @@ -18,9 +18,15 @@ * Boston, MA 02111-1307, USA. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include + /*** END file-header ***/ /*** BEGIN file-production ***/ + /* enumerations from "@filename@" */ #include "@filename@" diff --git a/src/libostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c index c9161d40..63942166 100644 --- a/src/libostree/ostree-fetcher.c +++ b/src/libostree/ostree-fetcher.c @@ -24,6 +24,10 @@ #include #include +#define LIBSOUP_USE_UNSTABLE_REQUEST_API +#include +#include +#include #include "libglnx.h" #include "ostree-fetcher.h" @@ -418,25 +422,20 @@ static void create_pending_soup_request (OstreeFetcherPendingURI *pending, GError **error) { - g_autofree char *uristr = NULL; - SoupURI *next_mirror = NULL; - SoupURI *uri = NULL; + OstreeFetcherURI *next_mirror = NULL; + g_autoptr(OstreeFetcherURI) uri = NULL; g_assert (pending->mirrorlist); g_assert (pending->mirrorlist_idx < pending->mirrorlist->len); - next_mirror = g_ptr_array_index (pending->mirrorlist, - pending->mirrorlist_idx); - uristr = g_build_filename (soup_uri_get_path (next_mirror), - pending->filename /* may be NULL */, NULL); - uri = soup_uri_copy (next_mirror); - soup_uri_set_path (uri, uristr); + next_mirror = g_ptr_array_index (pending->mirrorlist, pending->mirrorlist_idx); + if (pending->filename) + uri = _ostree_fetcher_uri_new_subpath (next_mirror, pending->filename); g_clear_object (&pending->request); pending->request = soup_session_request_uri (pending->thread_closure->session, - uri, error); - soup_uri_free (uri); + (SoupURI*)(uri ? uri : next_mirror), error); } static void @@ -1404,7 +1403,7 @@ _ostree_fetcher_mirrored_request_to_membuf (OstreeFetcher *fetcher, /* Helper for callers who just want to fetch single one-off URIs */ gboolean _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher, - SoupURI *uri, + OstreeFetcherURI *uri, gboolean add_nul, gboolean allow_noent, GBytes **out_contents, @@ -1419,3 +1418,84 @@ _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher, out_contents, max_size, cancellable, error); } + +void +_ostree_fetcher_uri_free (OstreeFetcherURI *uri) +{ + if (uri) + soup_uri_free ((SoupURI*)uri); +} + +OstreeFetcherURI * +_ostree_fetcher_uri_parse (const char *str, + GError **error) +{ + SoupURI *soupuri = soup_uri_new (str); + if (soupuri == NULL) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "Failed to parse uri: %s", str); + return NULL; + } + return (OstreeFetcherURI*)soupuri; +} + +static OstreeFetcherURI * +_ostree_fetcher_uri_new_path_internal (OstreeFetcherURI *uri, + gboolean extend, + const char *path) +{ + SoupURI *newuri = soup_uri_copy ((SoupURI*)uri); + if (path) + { + if (extend) + { + const char *origpath = soup_uri_get_path ((SoupURI*)uri); + g_autofree char *newpath = g_build_filename (origpath, path, NULL); + soup_uri_set_path (newuri, newpath); + } + else + { + soup_uri_set_path (newuri, path); + } + } + return (OstreeFetcherURI*)newuri; +} + +OstreeFetcherURI * +_ostree_fetcher_uri_new_path (OstreeFetcherURI *uri, + const char *path) +{ + return _ostree_fetcher_uri_new_path_internal (uri, FALSE, path); +} + +OstreeFetcherURI * +_ostree_fetcher_uri_new_subpath (OstreeFetcherURI *uri, + const char *subpath) +{ + return _ostree_fetcher_uri_new_path_internal (uri, TRUE, subpath); +} + +OstreeFetcherURI * +_ostree_fetcher_uri_clone (OstreeFetcherURI *uri) +{ + return _ostree_fetcher_uri_new_subpath (uri, NULL); +} + +char * +_ostree_fetcher_uri_get_scheme (OstreeFetcherURI *uri) +{ + return g_strdup (soup_uri_get_scheme ((SoupURI*)uri)); +} + +char * +_ostree_fetcher_uri_get_path (OstreeFetcherURI *uri) +{ + return g_strdup (soup_uri_get_path ((SoupURI*)uri)); +} + +char * +_ostree_fetcher_uri_to_string (OstreeFetcherURI *uri) +{ + return soup_uri_to_string ((SoupURI*)uri, FALSE); +} diff --git a/src/libostree/ostree-fetcher.h b/src/libostree/ostree-fetcher.h index 0bfba5b2..8e282e24 100644 --- a/src/libostree/ostree-fetcher.h +++ b/src/libostree/ostree-fetcher.h @@ -22,10 +22,7 @@ #ifndef __GI_SCANNER__ -#define LIBSOUP_USE_UNSTABLE_REQUEST_API -#include -#include -#include +#include "libglnx.h" G_BEGIN_DECLS @@ -39,6 +36,8 @@ G_BEGIN_DECLS /* Lower values have higher priority */ #define OSTREE_FETCHER_DEFAULT_PRIORITY 0 +typedef struct OstreeFetcherURI OstreeFetcherURI; + typedef struct OstreeFetcherClass OstreeFetcherClass; typedef struct OstreeFetcher OstreeFetcher; @@ -52,6 +51,34 @@ typedef enum { OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE = (1 << 0) } OstreeFetcherConfigFlags; +void +_ostree_fetcher_uri_free (OstreeFetcherURI *uri); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(OstreeFetcherURI, _ostree_fetcher_uri_free) + +OstreeFetcherURI * +_ostree_fetcher_uri_parse (const char *str, + GError **error); + +OstreeFetcherURI * +_ostree_fetcher_uri_clone (OstreeFetcherURI *uri); + +OstreeFetcherURI * +_ostree_fetcher_uri_new_path (OstreeFetcherURI *uri, + const char *subpath); + +OstreeFetcherURI * +_ostree_fetcher_uri_new_subpath (OstreeFetcherURI *uri, + const char *subpath); + +char * +_ostree_fetcher_uri_get_scheme (OstreeFetcherURI *uri); + +char * +_ostree_fetcher_uri_get_path (OstreeFetcherURI *uri); + +char * +_ostree_fetcher_uri_to_string (OstreeFetcherURI *uri); + GType _ostree_fetcher_get_type (void) G_GNUC_CONST; OstreeFetcher *_ostree_fetcher_new (int tmpdir_dfd, @@ -100,7 +127,7 @@ gboolean _ostree_fetcher_mirrored_request_to_membuf (OstreeFetcher *fetcher, GError **error); gboolean _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher, - SoupURI *uri, + OstreeFetcherURI *uri, gboolean add_nul, gboolean allow_noent, GBytes **out_contents, diff --git a/src/libostree/ostree-libarchive-input-stream.h b/src/libostree/ostree-libarchive-input-stream.h index bcfc7bd2..7f88693e 100644 --- a/src/libostree/ostree-libarchive-input-stream.h +++ b/src/libostree/ostree-libarchive-input-stream.h @@ -23,6 +23,7 @@ #pragma once #include +#include "ostree-libarchive-private.h" G_BEGIN_DECLS diff --git a/src/libostree/ostree-libarchive-private.h b/src/libostree/ostree-libarchive-private.h new file mode 100644 index 00000000..177c6568 --- /dev/null +++ b/src/libostree/ostree-libarchive-private.h @@ -0,0 +1,42 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2016 Colin Walters + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Alexander Larsson + */ + +#pragma once + +#include +#include "libglnx.h" +#ifdef HAVE_LIBARCHIVE +#include +#include +#endif + +G_BEGIN_DECLS + +#ifdef HAVE_LIBARCHIVE +GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_write_archive, archive_write_free) +#define ot_cleanup_write_archive __attribute__((cleanup (flatpak_local_free_write_archive))) + +GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_read_archive, archive_read_free) +#define ot_cleanup_read_archive __attribute__((cleanup (flatpak_local_free_read_archive))) +#endif + +G_END_DECLS diff --git a/src/libostree/ostree-metalink.c b/src/libostree/ostree-metalink.c index ad3d5bf9..ee52e51b 100644 --- a/src/libostree/ostree-metalink.c +++ b/src/libostree/ostree-metalink.c @@ -43,7 +43,7 @@ struct OstreeMetalink { GObject parent_instance; - SoupURI *uri; + OstreeFetcherURI *uri; OstreeFetcher *fetcher; char *requested_file; @@ -357,7 +357,7 @@ metalink_parser_text (GMarkupParseContext *context, case OSTREE_METALINK_STATE_URL: { g_autofree char *uri_text = g_strndup (text, text_len); - SoupURI *uri = soup_uri_new (uri_text); + OstreeFetcherURI *uri = _ostree_fetcher_uri_parse (uri_text, NULL); if (uri != NULL) g_ptr_array_add (self->urls, uri); } @@ -377,7 +377,7 @@ _ostree_metalink_finalize (GObject *object) g_object_unref (self->fetcher); g_free (self->requested_file); - soup_uri_free (self->uri); + _ostree_fetcher_uri_free (self->uri); G_OBJECT_CLASS (_ostree_metalink_parent_class)->finalize (object); } @@ -399,15 +399,15 @@ OstreeMetalink * _ostree_metalink_new (OstreeFetcher *fetcher, const char *requested_file, guint64 max_size, - SoupURI *uri) + OstreeFetcherURI *uri) { OstreeMetalink *self = (OstreeMetalink*)g_object_new (OSTREE_TYPE_METALINK, NULL); self->fetcher = g_object_ref (fetcher); self->requested_file = g_strdup (requested_file); self->max_size = max_size; - self->uri = soup_uri_copy (uri); - + self->uri = _ostree_fetcher_uri_clone (uri); + return self; } @@ -421,7 +421,7 @@ valid_hex_checksum (const char *s, gsize expected_len) static gboolean try_one_url (OstreeMetalinkRequest *self, - SoupURI *uri, + OstreeFetcherURI *uri, GBytes **out_data, GError **error) { @@ -479,19 +479,20 @@ try_one_url (OstreeMetalinkRequest *self, ret = TRUE; if (out_data) - *out_data = g_bytes_ref (bytes); + *out_data = g_steal_pointer (&bytes); out: return ret; } static gboolean try_metalink_targets (OstreeMetalinkRequest *self, - SoupURI **out_target_uri, + OstreeFetcherURI **out_target_uri, GBytes **out_data, GError **error) { gboolean ret = FALSE; - SoupURI *target_uri = NULL; + OstreeFetcherURI *target_uri = NULL; + g_autoptr(GBytes) ret_data = NULL; if (!self->found_a_file_element) { @@ -546,7 +547,7 @@ try_metalink_targets (OstreeMetalinkRequest *self, target_uri = self->urls->pdata[self->current_url_index]; - if (try_one_url (self, target_uri, out_data, &temp_error)) + if (try_one_url (self, target_uri, &ret_data, &temp_error)) break; else { @@ -567,7 +568,9 @@ try_metalink_targets (OstreeMetalinkRequest *self, ret = TRUE; if (out_target_uri) - *out_target_uri = soup_uri_copy (target_uri); + *out_target_uri = _ostree_fetcher_uri_clone (target_uri); + if (out_data) + *out_data = g_steal_pointer (&ret_data); out: return ret; } @@ -582,7 +585,7 @@ static const GMarkupParser metalink_parser = { typedef struct { - SoupURI **out_target_uri; + OstreeFetcherURI **out_target_uri; GBytes **out_data; gboolean success; GError **error; @@ -591,7 +594,7 @@ typedef struct gboolean _ostree_metalink_request_sync (OstreeMetalink *self, - SoupURI **out_target_uri, + OstreeFetcherURI **out_target_uri, GBytes **out_data, GCancellable *cancellable, GError **error) @@ -599,7 +602,7 @@ _ostree_metalink_request_sync (OstreeMetalink *self, gboolean ret = FALSE; OstreeMetalinkRequest request = { 0, }; g_autoptr(GMainContext) mainctx = NULL; - GBytes *out_contents = NULL; + g_autoptr(GBytes) contents = NULL; gsize len; const guint8 *data; @@ -607,20 +610,20 @@ _ostree_metalink_request_sync (OstreeMetalink *self, g_main_context_push_thread_default (mainctx); request.metalink = g_object_ref (self); - request.urls = g_ptr_array_new_with_free_func ((GDestroyNotify) soup_uri_free); + request.urls = g_ptr_array_new_with_free_func ((GDestroyNotify) _ostree_fetcher_uri_free); request.parser = g_markup_parse_context_new (&metalink_parser, G_MARKUP_PREFIX_ERROR_POSITION, &request, NULL); if (!_ostree_fetcher_request_uri_to_membuf (self->fetcher, self->uri, FALSE, FALSE, - &out_contents, + &contents, self->max_size, cancellable, error)) goto out; - data = g_bytes_get_data (out_contents, &len); + data = g_bytes_get_data (contents, &len); if (!g_markup_parse_context_parse (request.parser, (const char*)data, len, error)) goto out; @@ -639,9 +642,3 @@ _ostree_metalink_request_sync (OstreeMetalink *self, g_clear_pointer (&request.parser, g_markup_parse_context_free); return ret; } - -SoupURI * -_ostree_metalink_get_uri (OstreeMetalink *self) -{ - return self->uri; -} diff --git a/src/libostree/ostree-metalink.h b/src/libostree/ostree-metalink.h index 8f63d372..55ed92e8 100644 --- a/src/libostree/ostree-metalink.h +++ b/src/libostree/ostree-metalink.h @@ -46,12 +46,10 @@ GType _ostree_metalink_get_type (void) G_GNUC_CONST; OstreeMetalink *_ostree_metalink_new (OstreeFetcher *fetcher, const char *requested_file, guint64 max_size, - SoupURI *uri); - -SoupURI *_ostree_metalink_get_uri (OstreeMetalink *self); + OstreeFetcherURI *uri); gboolean _ostree_metalink_request_sync (OstreeMetalink *self, - SoupURI **out_target_uri, + OstreeFetcherURI **out_target_uri, GBytes **out_data, GCancellable *cancellable, GError **error); diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c index 9b640648..9a151646 100644 --- a/src/libostree/ostree-repo-checkout.c +++ b/src/libostree/ostree-repo-checkout.c @@ -554,7 +554,7 @@ checkout_one_file_at (OstreeRepo *repo, g_ascii_xdigit_value (checksum[1])); if (repo->updated_uncompressed_dirs == NULL) repo->updated_uncompressed_dirs = g_hash_table_new (NULL, NULL); - g_hash_table_insert (repo->updated_uncompressed_dirs, key, key); + g_hash_table_add (repo->updated_uncompressed_dirs, key); } g_mutex_unlock (&repo->cache_lock); diff --git a/src/libostree/ostree-repo-libarchive.c b/src/libostree/ostree-repo-libarchive.c index 02a1180a..01982894 100644 --- a/src/libostree/ostree-repo-libarchive.c +++ b/src/libostree/ostree-repo-libarchive.c @@ -913,10 +913,9 @@ ostree_repo_write_archive_to_mtree (OstreeRepo *self, { #ifdef HAVE_LIBARCHIVE gboolean ret = FALSE; - struct archive *a = NULL; + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0, }; - a = archive_read_new (); #ifdef HAVE_ARCHIVE_READ_SUPPORT_FILTER_ALL archive_read_support_filter_all (a); #else @@ -945,7 +944,6 @@ ostree_repo_write_archive_to_mtree (OstreeRepo *self, if (a) { (void)archive_read_close (a); - (void)archive_read_free (a); } return ret; #else diff --git a/src/libostree/ostree-repo-private.h b/src/libostree/ostree-repo-private.h index 6b25a6fc..a4e59e44 100644 --- a/src/libostree/ostree-repo-private.h +++ b/src/libostree/ostree-repo-private.h @@ -72,7 +72,6 @@ struct OstreeRepo { int cache_dir_fd; char *cache_dir; int objects_dir_fd; - GFile *deltas_dir; int uncompressed_objects_dir_fd; GFile *sysroot_dir; char *remotes_config_dir; diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 9e960792..9c99dc4f 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -353,7 +353,7 @@ fetch_mirrored_uri_contents_utf8_sync (OstreeFetcher *fetcher, static gboolean fetch_uri_contents_utf8_sync (OstreeFetcher *fetcher, - SoupURI *uri, + OstreeFetcherURI *uri, char **out_contents, GCancellable *cancellable, GError **error) @@ -522,7 +522,7 @@ scan_dirtree_object (OtPullData *pull_data, } else if (!file_is_stored && !g_hash_table_lookup (pull_data->requested_content, file_checksum)) { - g_hash_table_insert (pull_data->requested_content, file_checksum, file_checksum); + g_hash_table_add (pull_data->requested_content, file_checksum); enqueue_one_object_request (pull_data, file_checksum, OSTREE_OBJECT_TYPE_FILE, path, FALSE, FALSE); file_checksum = NULL; /* Transfer ownership */ } @@ -1010,8 +1010,6 @@ static_deltapart_fetch_on_complete (GObject *object, _ostree_static_delta_part_execute_async (pull_data->repo, fetch_data->objects, part, - /* Trust checksums if summary was gpg signed */ - pull_data->gpg_verify_summary && pull_data->summary_data_sig, pull_data->cancellable, on_static_delta_written, fetch_data); @@ -1137,10 +1135,6 @@ scan_commit_object (OtPullData *pull_data, is_partial = pull_data->legacy_transaction_resuming || (commitstate & OSTREE_REPO_COMMIT_STATE_PARTIAL) > 0; - if (!ostree_repo_load_variant (pull_data->repo, OSTREE_OBJECT_TYPE_COMMIT, checksum, - &commit, error)) - goto out; - /* PARSE OSTREE_SERIALIZED_COMMIT_VARIANT */ g_variant_get_child (commit, 1, "@ay", &parent_csum); if (g_variant_n_children (parent_csum) > 0) @@ -1279,15 +1273,15 @@ scan_one_metadata_object_c (OtPullData *pull_data, { if (!is_stored) { - if (!ostree_repo_import_object_from_with_trust (pull_data->repo, pull_data->remote_repo_local, - objtype, tmp_checksum, !pull_data->is_untrusted, - cancellable, error)) - goto out; if (objtype == OSTREE_OBJECT_TYPE_COMMIT) { if (!write_commitpartial_for (pull_data, tmp_checksum, error)) goto out; } + if (!ostree_repo_import_object_from_with_trust (pull_data->repo, pull_data->remote_repo_local, + objtype, tmp_checksum, !pull_data->is_untrusted, + cancellable, error)) + goto out; } is_stored = TRUE; is_requested = TRUE; @@ -1298,7 +1292,7 @@ scan_one_metadata_object_c (OtPullData *pull_data, char *duped_checksum = g_strdup (tmp_checksum); gboolean do_fetch_detached; - g_hash_table_insert (pull_data->requested_metadata, duped_checksum, duped_checksum); + g_hash_table_add (pull_data->requested_metadata, duped_checksum); do_fetch_detached = (objtype == OSTREE_OBJECT_TYPE_COMMIT); enqueue_one_object_request (pull_data, tmp_checksum, objtype, path, do_fetch_detached, FALSE); @@ -1312,7 +1306,7 @@ scan_one_metadata_object_c (OtPullData *pull_data, pull_data->cancellable, error)) goto out; - g_hash_table_insert (pull_data->scanned_metadata, g_variant_ref (object), object); + g_hash_table_add (pull_data->scanned_metadata, g_variant_ref (object)); pull_data->n_scanned_metadata++; } else if (is_stored && objtype == OSTREE_OBJECT_TYPE_DIR_TREE) @@ -1321,7 +1315,7 @@ scan_one_metadata_object_c (OtPullData *pull_data, pull_data->cancellable, error)) goto out; - g_hash_table_insert (pull_data->scanned_metadata, g_variant_ref (object), object); + g_hash_table_add (pull_data->scanned_metadata, g_variant_ref (object)); pull_data->n_scanned_metadata++; } @@ -1482,8 +1476,8 @@ request_static_delta_superblock_sync (OtPullData *pull_data, } } - ret_delta_superblock = g_variant_new_from_bytes ((GVariantType*)OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT, - delta_superblock_data, FALSE); + ret_delta_superblock = g_variant_ref_sink (g_variant_new_from_bytes ((GVariantType*)OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT, + delta_superblock_data, FALSE)); } ret = TRUE; @@ -1542,7 +1536,7 @@ process_one_static_delta_fallback (OtPullData *pull_data, if (!g_hash_table_lookup (pull_data->requested_metadata, checksum)) { gboolean do_fetch_detached; - g_hash_table_insert (pull_data->requested_metadata, checksum, checksum); + g_hash_table_add (pull_data->requested_metadata, checksum); do_fetch_detached = (objtype == OSTREE_OBJECT_TYPE_COMMIT); enqueue_one_object_request (pull_data, checksum, objtype, NULL, do_fetch_detached, FALSE); @@ -1553,7 +1547,7 @@ process_one_static_delta_fallback (OtPullData *pull_data, { if (!g_hash_table_lookup (pull_data->requested_content, checksum)) { - g_hash_table_insert (pull_data->requested_content, checksum, checksum); + g_hash_table_add (pull_data->requested_content, checksum); enqueue_one_object_request (pull_data, checksum, OSTREE_OBJECT_TYPE_FILE, NULL, FALSE, FALSE); checksum = NULL; /* Transfer ownership */ } @@ -1665,7 +1659,6 @@ process_one_static_delta (OtPullData *pull_data, g_autoptr(GBytes) inline_part_bytes = NULL; guint64 size, usize; guint32 version; - const gboolean trusted = pull_data->gpg_verify_summary && pull_data->summary_data_sig; header = g_variant_get_child_value (headers, i); g_variant_get (header, "(u@aytt@ay)", &version, &csum_v, &size, &usize, &objects); @@ -1735,7 +1728,6 @@ process_one_static_delta (OtPullData *pull_data, _ostree_static_delta_part_execute_async (pull_data->repo, fetch_data->objects, inline_delta_part, - trusted, pull_data->cancellable, on_static_delta_written, fetch_data); @@ -2063,17 +2055,13 @@ fetch_mirrorlist (OstreeFetcher *fetcher, gboolean ret = FALSE; g_auto(GStrv) lines = NULL; g_autofree char *contents = NULL; - SoupURI *mirrorlist = NULL; + g_autoptr(OstreeFetcherURI) mirrorlist = NULL; g_autoptr(GPtrArray) ret_mirrorlist = - g_ptr_array_new_with_free_func ((GDestroyNotify) soup_uri_free); + g_ptr_array_new_with_free_func ((GDestroyNotify) _ostree_fetcher_uri_free); - mirrorlist = soup_uri_new (mirrorlist_url); - if (mirrorlist == NULL) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Failed to parse mirrorlist URL '%s'", mirrorlist_url); - goto out; - } + mirrorlist = _ostree_fetcher_uri_parse (mirrorlist_url, error); + if (!mirrorlist) + goto out; if (!fetch_uri_contents_utf8_sync (fetcher, mirrorlist, &contents, cancellable, error)) @@ -2091,27 +2079,28 @@ fetch_mirrorlist (OstreeFetcher *fetcher, for (char **iter = lines; iter && *iter; iter++) { const char *mirror_uri_str = *iter; - SoupURI *mirror_uri = NULL; + g_autoptr(OstreeFetcherURI) mirror_uri = NULL; + g_autofree char *scheme = NULL; /* let's be nice and support empty lines and comments */ if (*mirror_uri_str == '\0' || *mirror_uri_str == '#') continue; - mirror_uri = soup_uri_new (mirror_uri_str); - if (mirror_uri == NULL) + mirror_uri = _ostree_fetcher_uri_parse (mirror_uri_str, NULL); + if (!mirror_uri) { g_debug ("Can't parse mirrorlist line '%s'", mirror_uri_str); continue; } - else if ((strcmp (soup_uri_get_scheme (mirror_uri), "http") != 0) && - (strcmp (soup_uri_get_scheme (mirror_uri), "https") != 0)) + + scheme = _ostree_fetcher_uri_get_scheme (mirror_uri); + if (!(g_str_equal (scheme, "http") || (g_str_equal (scheme, "https")))) { /* let's not support mirrorlists that contain non-http based URIs for * now (e.g. local URIs) -- we need to think about if and how we want * to support this since we set up things differently depending on * whether we're pulling locally or not */ g_debug ("Ignoring non-http/s mirrorlist entry '%s'", mirror_uri_str); - soup_uri_free (mirror_uri); continue; } @@ -2122,9 +2111,7 @@ fetch_mirrorlist (OstreeFetcher *fetcher, if (ret_mirrorlist->len == 0) { GError *local_error = NULL; - g_autofree char *config_uri_str = g_build_filename (mirror_uri_str, - "config", NULL); - SoupURI *config_uri = soup_uri_new (config_uri_str); + g_autoptr(OstreeFetcherURI) config_uri = _ostree_fetcher_uri_new_subpath (mirror_uri, "config"); if (fetch_uri_contents_utf8_sync (fetcher, config_uri, NULL, cancellable, &local_error)) @@ -2135,16 +2122,11 @@ fetch_mirrorlist (OstreeFetcher *fetcher, mirror_uri_str, local_error->message); g_clear_error (&local_error); } - - soup_uri_free (config_uri); } else { g_ptr_array_add (ret_mirrorlist, g_steal_pointer (&mirror_uri)); } - - if (mirror_uri != NULL) - soup_uri_free (mirror_uri); } if (ret_mirrorlist->len == 0) @@ -2159,8 +2141,6 @@ fetch_mirrorlist (OstreeFetcher *fetcher, ret = TRUE; out: - if (mirrorlist != NULL) - soup_uri_free (mirrorlist); return ret; } @@ -2209,18 +2189,14 @@ repo_remote_fetch_summary (OstreeRepo *self, } else { - SoupURI *uri = soup_uri_new (url_string); + g_autoptr(OstreeFetcherURI) uri = _ostree_fetcher_uri_parse (url_string, error); - if (uri == NULL) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Failed to parse url '%s'", url_string); - goto out; - } + if (!uri) + goto out; mirrorlist = - g_ptr_array_new_with_free_func ((GDestroyNotify) soup_uri_free); - g_ptr_array_add (mirrorlist, uri /* transfer ownership */ ); + g_ptr_array_new_with_free_func ((GDestroyNotify) _ostree_fetcher_uri_free); + g_ptr_array_add (mirrorlist, g_steal_pointer (&uri)); } } @@ -2482,6 +2458,8 @@ ostree_repo_pull_with_options (OstreeRepo *self, } else { + g_autofree char *unconfigured_state = NULL; + pull_data->remote_name = g_strdup (remote_name_or_baseurl); /* Fetch GPG verification settings from remote if it wasn't already @@ -2495,6 +2473,22 @@ ostree_repo_pull_with_options (OstreeRepo *self, if (!ostree_repo_remote_get_gpg_verify_summary (self, pull_data->remote_name, &pull_data->gpg_verify_summary, error)) goto out; + + /* NOTE: If changing this, see the matching implementation in + * ostree-sysroot-upgrader.c + */ + if (!ostree_repo_get_remote_option (self, pull_data->remote_name, + "unconfigured-state", NULL, + &unconfigured_state, + error)) + goto out; + + if (unconfigured_state) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "remote unconfigured-state: %s", unconfigured_state); + goto out; + } } pull_data->phase = OSTREE_PULL_PHASE_FETCHING_REFS; @@ -2530,36 +2524,27 @@ ostree_repo_pull_with_options (OstreeRepo *self, } else { - SoupURI *baseuri = soup_uri_new (baseurl); + g_autoptr(OstreeFetcherURI) baseuri = _ostree_fetcher_uri_parse (baseurl, error); - if (baseuri == NULL) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Failed to parse url '%s'", baseurl); - goto out; - } + if (!baseuri) + goto out; pull_data->meta_mirrorlist = - g_ptr_array_new_with_free_func ((GDestroyNotify) soup_uri_free); - g_ptr_array_add (pull_data->meta_mirrorlist, baseuri /* transfer */); + g_ptr_array_new_with_free_func ((GDestroyNotify) _ostree_fetcher_uri_free); + g_ptr_array_add (pull_data->meta_mirrorlist, g_steal_pointer (&baseuri)); } } else { g_autoptr(GBytes) summary_bytes = NULL; - SoupURI *metalink_uri = soup_uri_new (metalink_url_str); - SoupURI *target_uri = NULL; - + g_autoptr(OstreeFetcherURI) metalink_uri = _ostree_fetcher_uri_parse (metalink_url_str, error); + g_autoptr(OstreeFetcherURI) target_uri = NULL; + if (!metalink_uri) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Invalid metalink URL: %s", metalink_url_str); - goto out; - } - + goto out; + metalink = _ostree_metalink_new (pull_data->fetcher, "summary", OSTREE_MAX_METADATA_SIZE, metalink_uri); - soup_uri_free (metalink_uri); if (! _ostree_metalink_request_sync (metalink, &target_uri, @@ -2572,12 +2557,12 @@ ostree_repo_pull_with_options (OstreeRepo *self, * mirrors here since we use it as such anyway (rather than the "usual" * use case of metalink, which is only for a single target filename) */ { - /* reuse target_uri and take ownership */ - g_autofree char *repo_base = g_path_get_dirname (soup_uri_get_path (target_uri)); - soup_uri_set_path (target_uri, repo_base); + g_autofree char *path = _ostree_fetcher_uri_get_path (target_uri); + g_autofree char *basepath = g_path_get_dirname (path); + g_autoptr(OstreeFetcherURI) new_target_uri = _ostree_fetcher_uri_new_path (target_uri, basepath); pull_data->meta_mirrorlist = - g_ptr_array_new_with_free_func ((GDestroyNotify) soup_uri_free); - g_ptr_array_add (pull_data->meta_mirrorlist, target_uri); + g_ptr_array_new_with_free_func ((GDestroyNotify) _ostree_fetcher_uri_free); + g_ptr_array_add (pull_data->meta_mirrorlist, g_steal_pointer (&new_target_uri)); } pull_data->summary = g_variant_new_from_bytes (OSTREE_SUMMARY_GVARIANT_FORMAT, @@ -2611,19 +2596,15 @@ ostree_repo_pull_with_options (OstreeRepo *self, } else { - SoupURI *contenturi = soup_uri_new (contenturl); + g_autoptr(OstreeFetcherURI) contenturi = _ostree_fetcher_uri_parse (contenturl, error); - if (contenturi == NULL) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Failed to parse contenturl '%s'", contenturl); - goto out; - } + if (!contenturi) + goto out; pull_data->content_mirrorlist = - g_ptr_array_new_with_free_func ((GDestroyNotify) soup_uri_free); + g_ptr_array_new_with_free_func ((GDestroyNotify) _ostree_fetcher_uri_free); g_ptr_array_add (pull_data->content_mirrorlist, - contenturi /* transfer */); + g_steal_pointer (&contenturi)); } } } @@ -2633,12 +2614,16 @@ ostree_repo_pull_with_options (OstreeRepo *self, &configured_branches, error)) goto out; + /* TODO reindent later */ + { OstreeFetcherURI *first_uri = pull_data->meta_mirrorlist->pdata[0]; + g_autofree char *first_scheme = _ostree_fetcher_uri_get_scheme (first_uri); + /* NB: we don't support local mirrors in mirrorlists, so if this passes, it * means that we're not using mirrorlists (see also fetch_mirrorlist()) */ - if (strcmp (soup_uri_get_scheme (pull_data->meta_mirrorlist->pdata[0]), "file") == 0) + if (g_str_equal (first_scheme, "file")) { - g_autoptr(GFile) remote_repo_path = - g_file_new_for_path (soup_uri_get_path (pull_data->meta_mirrorlist->pdata[0])); + g_autofree char *path = _ostree_fetcher_uri_get_path (first_uri); + g_autoptr(GFile) remote_repo_path = g_file_new_for_path (path); pull_data->remote_repo_local = ostree_repo_new (remote_repo_path); if (!ostree_repo_open (pull_data->remote_repo_local, cancellable, error)) goto out; @@ -2667,6 +2652,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, goto out; } } + } /* For local pulls, default to disabling static deltas so that the * exact object files are copied. @@ -2804,7 +2790,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, for (i = 0; i < n; i++) { const char *delta; - GVariant *csum_v = NULL; + g_autoptr(GVariant) csum_v = NULL; guchar *csum_data = g_malloc (OSTREE_SHA256_DIGEST_LEN); g_autoptr(GVariant) ref = g_variant_get_child_value (deltas, i); @@ -2844,7 +2830,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, if (ostree_validate_checksum_string (branch, NULL)) { char *key = g_strdup (branch); - g_hash_table_insert (commits_to_fetch, key, key); + g_hash_table_add (commits_to_fetch, key); } else { @@ -2955,7 +2941,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, g_autofree char *from_revision = NULL; const char *ref = key; const char *to_revision = value; - GVariant *delta_superblock = NULL; + g_autoptr(GVariant) delta_superblock = NULL; if (!ostree_repo_resolve_rev (pull_data->repo, ref, TRUE, &from_revision, error)) @@ -3169,9 +3155,10 @@ ostree_repo_pull_with_options (OstreeRepo *self, * @self: Self * @name: name of a remote * @options: (nullable): A GVariant a{sv} with an extensible set of flags - * @out_summary: (nullable): return location for raw summary data, or %NULL - * @out_signatures: (nullable): return location for raw summary signature - * data, or %NULL + * @out_summary: (out) (optional): return location for raw summary data, or + * %NULL + * @out_signatures: (out) (optional): return location for raw summary + * signature data, or %NULL * @cancellable: a #GCancellable * @error: a #GError * diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c index 4b0bc507..1611d19e 100644 --- a/src/libostree/ostree-repo-static-delta-compilation.c +++ b/src/libostree/ostree-repo-static-delta-compilation.c @@ -132,7 +132,7 @@ xattr_chunk_hash (const void *vp) { const guint8* name; const guint8* value_data; - GVariant *value = NULL; + g_autoptr(GVariant) value = NULL; gsize value_len; g_variant_get_child (v, i, "(^&ay@ay)", @@ -911,9 +911,8 @@ generate_delta_lowlatency (OstreeRepo *repo, ostree_object_name_deserialize (serialized_key, &checksum, &objtype); - g_variant_ref (serialized_key); if (OSTREE_OBJECT_TYPE_IS_META (objtype)) - g_hash_table_add (new_reachable_metadata, serialized_key); + g_hash_table_add (new_reachable_metadata, g_variant_ref (serialized_key)); else { g_autoptr(GFileInfo) finfo = NULL; @@ -955,8 +954,9 @@ generate_delta_lowlatency (OstreeRepo *repo, } /* We already ship the to commit in the superblock, don't ship it twice */ - g_hash_table_remove (new_reachable_metadata, - ostree_object_name_serialize (to, OSTREE_OBJECT_TYPE_COMMIT)); + { g_autoptr(GVariant) commit = ostree_object_name_serialize (to, OSTREE_OBJECT_TYPE_COMMIT); + g_hash_table_remove (new_reachable_metadata, commit); + } rollsum_optimized_content_objects = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, @@ -1359,8 +1359,8 @@ ostree_repo_static_delta_generate (OstreeRepo *self, for (i = 0; i < builder.parts->len; i++) { OstreeStaticDeltaPartBuilder *part_builder = builder.parts->pdata[i]; - GBytes *payload_b; - GBytes *operations_b; + g_autoptr(GBytes) payload_b; + g_autoptr(GBytes) operations_b; g_autofree guchar *part_checksum = NULL; g_autoptr(GBytes) objtype_checksum_array = NULL; g_autoptr(GBytes) checksum_bytes = NULL; @@ -1415,10 +1415,11 @@ ostree_repo_static_delta_generate (OstreeRepo *self, } /* FIXME - avoid duplicating memory here */ - delta_part = g_variant_new ("(y@ay)", - compression_type_char, - ot_gvariant_new_ay_bytes (g_memory_output_stream_steal_as_bytes (part_payload_out))); - g_variant_ref_sink (delta_part); + { g_autoptr(GBytes) payload = g_memory_output_stream_steal_as_bytes (part_payload_out); + delta_part = g_variant_ref_sink (g_variant_new ("(y@ay)", + compression_type_char, + ot_gvariant_new_ay_bytes (payload))); + } if (inline_parts) { @@ -1532,17 +1533,17 @@ ostree_repo_static_delta_generate (OstreeRepo *self, /* floating */ GVariant *to_csum_v = ostree_checksum_to_bytes_v (to); - delta_descriptor = g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "ay" - "a" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT - "@a" OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")", - g_variant_builder_end (&metadata_builder), - GUINT64_TO_BE (g_date_time_to_unix (now)), - from_csum_v, - to_csum_v, - to_commit, - g_variant_builder_new (G_VARIANT_TYPE ("ay")), - part_headers, - fallback_headers); + delta_descriptor = g_variant_ref_sink (g_variant_new ("(@a{sv}t@ay@ay@" OSTREE_COMMIT_GVARIANT_STRING "@ay" + "a" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT + "@a" OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")", + g_variant_builder_end (&metadata_builder), + GUINT64_TO_BE (g_date_time_to_unix (now)), + from_csum_v, + to_csum_v, + to_commit, + ot_gvariant_new_bytearray ((guchar*)"", 0), + part_headers, + fallback_headers)); g_date_time_unref (now); } diff --git a/src/libostree/ostree-repo-static-delta-core.c b/src/libostree/ostree-repo-static-delta-core.c index 133ab016..edbf965b 100644 --- a/src/libostree/ostree-repo-static-delta-core.c +++ b/src/libostree/ostree-repo-static-delta-core.c @@ -73,95 +73,100 @@ ostree_repo_list_static_delta_names (OstreeRepo *self, GCancellable *cancellable, GError **error) { - gboolean ret = FALSE; g_autoptr(GPtrArray) ret_deltas = NULL; - g_autoptr(GFileEnumerator) dir_enum = NULL; + glnx_fd_close int dfd = -1; ret_deltas = g_ptr_array_new_with_free_func (g_free); - if (g_file_query_exists (self->deltas_dir, NULL)) + dfd = glnx_opendirat_with_errno (self->repo_dir_fd, "deltas", TRUE); + if (dfd < 0) { - dir_enum = g_file_enumerate_children (self->deltas_dir, OSTREE_GIO_FAST_QUERYINFO, - G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, - NULL, error); - if (!dir_enum) - goto out; + if (errno != ENOENT) + { + glnx_set_error_from_errno (error); + return FALSE; + } + } + else + { + g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; + + if (!glnx_dirfd_iterator_init_take_fd (dfd, &dfd_iter, error)) + return FALSE; + dfd = -1; while (TRUE) { - g_autoptr(GFileEnumerator) dir_enum2 = NULL; - GFileInfo *file_info; - GFile *child; + g_auto(GLnxDirFdIterator) sub_dfd_iter = { 0, }; + struct dirent *dent; - if (!g_file_enumerator_iterate (dir_enum, &file_info, &child, - NULL, error)) - goto out; - if (file_info == NULL) + if (!glnx_dirfd_iterator_next_dent_ensure_dtype (&dfd_iter, &dent, cancellable, error)) + return FALSE; + if (dent == NULL) break; - - if (g_file_info_get_file_type (file_info) != G_FILE_TYPE_DIRECTORY) + if (dent->d_type != DT_DIR) continue; - - dir_enum2 = g_file_enumerate_children (child, OSTREE_GIO_FAST_QUERYINFO, - G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, - NULL, error); - if (!dir_enum2) - goto out; + if (!glnx_dirfd_iterator_init_at (dfd_iter.fd, dent->d_name, FALSE, + &sub_dfd_iter, error)) + return FALSE; while (TRUE) { - GFileInfo *file_info2; - GFile *child2; + struct dirent *sub_dent; const char *name1; const char *name2; + g_autofree char *superblock_subpath = NULL; + struct stat stbuf; - if (!g_file_enumerator_iterate (dir_enum2, &file_info2, &child2, - NULL, error)) - goto out; - if (file_info2 == NULL) + if (!glnx_dirfd_iterator_next_dent_ensure_dtype (&sub_dfd_iter, &sub_dent, + cancellable, error)) + return FALSE; + if (sub_dent == NULL) break; - - if (g_file_info_get_file_type (file_info2) != G_FILE_TYPE_DIRECTORY) + if (dent->d_type != DT_DIR) continue; - name1 = g_file_info_get_name (file_info); - name2 = g_file_info_get_name (file_info2); + name1 = dent->d_name; + name2 = sub_dent->d_name; - { - g_autoptr(GFile) meta_path = g_file_get_child (child2, "superblock"); + superblock_subpath = g_strconcat (name2, "/superblock", NULL); + if (fstatat (sub_dfd_iter.fd, superblock_subpath, &stbuf, 0) < 0) + { + if (errno != ENOENT) + { + glnx_set_error_from_errno (error); + return FALSE; + } + } + else + { + g_autofree char *buf = g_strconcat (name1, name2, NULL); + GString *out = g_string_new (""); + char checksum[OSTREE_SHA256_STRING_LEN+1]; + guchar csum[OSTREE_SHA256_DIGEST_LEN]; + const char *dash = strchr (buf, '-'); - if (g_file_query_exists (meta_path, NULL)) - { - g_autofree char *buf = g_strconcat (name1, name2, NULL); - GString *out = g_string_new (""); - char checksum[OSTREE_SHA256_STRING_LEN+1]; - guchar csum[OSTREE_SHA256_DIGEST_LEN]; - const char *dash = strchr (buf, '-'); + ostree_checksum_b64_inplace_to_bytes (buf, csum); + ostree_checksum_inplace_from_bytes (csum, checksum); + g_string_append (out, checksum); + if (dash) + { + g_string_append_c (out, '-'); + ostree_checksum_b64_inplace_to_bytes (dash+1, csum); + ostree_checksum_inplace_from_bytes (csum, checksum); + g_string_append (out, checksum); + } - ostree_checksum_b64_inplace_to_bytes (buf, csum); - ostree_checksum_inplace_from_bytes (csum, checksum); - g_string_append (out, checksum); - if (dash) - { - g_string_append_c (out, '-'); - ostree_checksum_b64_inplace_to_bytes (dash+1, csum); - ostree_checksum_inplace_from_bytes (csum, checksum); - g_string_append (out, checksum); - } - - g_ptr_array_add (ret_deltas, g_string_free (out, FALSE)); - } - } + g_ptr_array_add (ret_deltas, g_string_free (out, FALSE)); + } } } } - ret = TRUE; if (out_deltas) *out_deltas = g_steal_pointer (&ret_deltas); - out: - return ret; + return TRUE; } gboolean @@ -435,8 +440,7 @@ ostree_repo_static_delta_execute_offline (OstreeRepo *self, } if (!_ostree_static_delta_part_execute (self, objects, part, skip_validation, - FALSE, NULL, - cancellable, error)) + NULL, cancellable, error)) { g_prefix_error (error, "Executing delta part %i: ", i); goto out; @@ -653,7 +657,7 @@ show_one_part (OstreeRepo *self, (guint64)g_variant_n_children (ops)); if (!_ostree_static_delta_part_execute (self, objects, - part, TRUE, TRUE, + part, TRUE, &stats, cancellable, error)) goto out; diff --git a/src/libostree/ostree-repo-static-delta-private.h b/src/libostree/ostree-repo-static-delta-private.h index 31e8971e..6121c482 100644 --- a/src/libostree/ostree-repo-static-delta-private.h +++ b/src/libostree/ostree-repo-static-delta-private.h @@ -141,7 +141,6 @@ typedef struct { gboolean _ostree_static_delta_part_execute (OstreeRepo *repo, GVariant *header, GVariant *part_payload, - gboolean trusted, gboolean stats_only, OstreeDeltaExecuteStats *stats, GCancellable *cancellable, @@ -150,7 +149,6 @@ gboolean _ostree_static_delta_part_execute (OstreeRepo *repo, void _ostree_static_delta_part_execute_async (OstreeRepo *repo, GVariant *header, GVariant *part_payload, - gboolean trusted, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); diff --git a/src/libostree/ostree-repo-static-delta-processing.c b/src/libostree/ostree-repo-static-delta-processing.c index eabe3925..a71e070f 100644 --- a/src/libostree/ostree-repo-static-delta-processing.c +++ b/src/libostree/ostree-repo-static-delta-processing.c @@ -39,7 +39,6 @@ G_STATIC_ASSERT (sizeof (guint) >= sizeof (guint32)); typedef struct { - gboolean trusted; gboolean stats_only; OstreeRepo *repo; guint checksum_index; @@ -180,7 +179,6 @@ gboolean _ostree_static_delta_part_execute (OstreeRepo *repo, GVariant *objects, GVariant *part, - gboolean trusted, gboolean stats_only, OstreeDeltaExecuteStats *stats, GCancellable *cancellable, @@ -200,7 +198,6 @@ _ostree_static_delta_part_execute (OstreeRepo *repo, state->repo = repo; state->async_error = error; - state->trusted = trusted; state->stats_only = stats_only; if (!_ostree_static_delta_parse_checksum_array (objects, @@ -286,6 +283,7 @@ _ostree_static_delta_part_execute (OstreeRepo *repo, ret = TRUE; out: + g_clear_pointer (&state->content_checksum, g_checksum_free); return ret; } @@ -295,7 +293,6 @@ typedef struct { GVariant *part; GCancellable *cancellable; GSimpleAsyncResult *result; - gboolean trusted; } StaticDeltaPartExecuteAsyncData; static void @@ -322,7 +319,6 @@ static_delta_part_execute_thread (GSimpleAsyncResult *res, if (!_ostree_static_delta_part_execute (data->repo, data->header, data->part, - data->trusted, FALSE, NULL, cancellable, &error)) g_simple_async_result_take_error (res, error); @@ -332,7 +328,6 @@ void _ostree_static_delta_part_execute_async (OstreeRepo *repo, GVariant *header, GVariant *part, - gboolean trusted, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -343,7 +338,6 @@ _ostree_static_delta_part_execute_async (OstreeRepo *repo, asyncdata->repo = g_object_ref (repo); asyncdata->header = g_variant_ref (header); asyncdata->part = g_variant_ref (part); - asyncdata->trusted = trusted; asyncdata->cancellable = cancellable ? g_object_ref (cancellable) : NULL; asyncdata->result = g_simple_async_result_new ((GObject*) repo, @@ -516,9 +510,9 @@ dispatch_bspatch (OstreeRepo *repo, return ret; } -/* When processing untrusted static deltas, we need to checksum the - * file content, which includes a header. Compare with what - * ostree_checksum_file_from_input() is doing too. +/* Before, we had a distinction between "trusted" and "untrusted" deltas + * which we've decided wasn't a good idea. Now, we always checksum the content. + * Compare with what ostree_checksum_file_from_input() is doing too. */ static gboolean handle_untrusted_content_checksum (OstreeRepo *repo, @@ -529,13 +523,10 @@ handle_untrusted_content_checksum (OstreeRepo *repo, g_autoptr(GVariant) header = NULL; g_autoptr(GFileInfo) finfo = NULL; gsize bytes_written; - - if (state->trusted) - return TRUE; finfo = _ostree_header_gfile_info_new (state->mode, state->uid, state->gid); header = _ostree_file_header_new (finfo, state->xattrs); - + state->content_checksum = g_checksum_new (G_CHECKSUM_SHA256); if (!_ostree_write_variant_with_size (NULL, header, 0, &bytes_written, state->content_checksum, @@ -578,26 +569,16 @@ dispatch_open_splice_and_close (OstreeRepo *repo, metadata = g_variant_new_from_data (ostree_metadata_variant_type (state->output_objtype), state->payload_data + offset, length, TRUE, NULL, NULL); - if (state->trusted) - { - if (!ostree_repo_write_metadata_trusted (state->repo, state->output_objtype, - state->checksum, - metadata, - cancellable, - error)) - goto out; - } - else - { - g_autofree guchar *actual_csum = NULL; + { + g_autofree guchar *actual_csum = NULL; - if (!ostree_repo_write_metadata (state->repo, state->output_objtype, - state->checksum, - metadata, &actual_csum, - cancellable, - error)) - goto out; - } + if (!ostree_repo_write_metadata (state->repo, state->output_objtype, + state->checksum, + metadata, &actual_csum, + cancellable, + error)) + goto out; + } } else { @@ -671,29 +652,18 @@ dispatch_open_splice_and_close (OstreeRepo *repo, &object_input, &objlen, cancellable, error)) goto out; - - if (state->trusted) - { - if (!ostree_repo_write_content_trusted (state->repo, - state->checksum, - object_input, - objlen, - cancellable, - error)) - goto out; - } - else - { - g_autofree guchar *actual_csum = NULL; - if (!ostree_repo_write_content (state->repo, - state->checksum, - object_input, - objlen, - &actual_csum, - cancellable, - error)) - goto out; - } + + { + g_autofree guchar *actual_csum = NULL; + if (!ostree_repo_write_content (state->repo, + state->checksum, + object_input, + objlen, + &actual_csum, + cancellable, + error)) + goto out; + } } } @@ -919,8 +889,6 @@ dispatch_close (OstreeRepo *repo, { const char *actual_checksum = g_checksum_get_string (state->content_checksum); - g_assert (!state->trusted); - if (strcmp (actual_checksum, state->checksum) != 0) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, @@ -941,6 +909,7 @@ dispatch_close (OstreeRepo *repo, goto out; g_clear_pointer (&state->xattrs, g_variant_unref); + g_clear_pointer (&state->content_checksum, g_checksum_free); g_clear_object (&state->content_out); state->checksum_index++; diff --git a/src/libostree/ostree-repo-traverse.c b/src/libostree/ostree-repo-traverse.c index 5d994763..d125f01a 100644 --- a/src/libostree/ostree-repo-traverse.c +++ b/src/libostree/ostree-repo-traverse.c @@ -348,9 +348,8 @@ traverse_iter (OstreeRepo *repo, ostree_repo_commit_traverse_iter_get_file (iter, &name, &checksum); g_debug ("Found file object %s", checksum); - key = ostree_object_name_serialize (checksum, OSTREE_OBJECT_TYPE_FILE); - g_hash_table_replace (inout_reachable, key, key); - key = NULL; + key = g_variant_ref_sink (ostree_object_name_serialize (checksum, OSTREE_OBJECT_TYPE_FILE)); + g_hash_table_add (inout_reachable, g_steal_pointer (&key)); } else if (iterres == OSTREE_REPO_COMMIT_ITER_RESULT_DIR) { @@ -363,15 +362,13 @@ traverse_iter (OstreeRepo *repo, g_debug ("Found dirtree object %s", content_checksum); g_debug ("Found dirmeta object %s", meta_checksum); - key = ostree_object_name_serialize (meta_checksum, OSTREE_OBJECT_TYPE_DIR_META); - g_hash_table_replace (inout_reachable, key, key); - key = NULL; + key = g_variant_ref_sink (ostree_object_name_serialize (meta_checksum, OSTREE_OBJECT_TYPE_DIR_META)); + g_hash_table_add (inout_reachable, g_steal_pointer (&key)); - key = ostree_object_name_serialize (content_checksum, OSTREE_OBJECT_TYPE_DIR_TREE); + key = g_variant_ref_sink (ostree_object_name_serialize (content_checksum, OSTREE_OBJECT_TYPE_DIR_TREE)); if (!g_hash_table_lookup (inout_reachable, key)) { - g_hash_table_replace (inout_reachable, key, key); - key = NULL; + g_hash_table_add (inout_reachable, g_steal_pointer (&key)); if (!traverse_dirtree (repo, content_checksum, inout_reachable, ignore_missing_dirs, cancellable, error)) @@ -407,7 +404,7 @@ traverse_dirtree (OstreeRepo *repo, if (ignore_missing_dirs && g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { - g_print ("Ignoring not-found dirmeta %s", checksum); + g_debug ("Ignoring not-found dirmeta %s", checksum); ret = TRUE; } else @@ -463,7 +460,7 @@ ostree_repo_traverse_commit_union (OstreeRepo *repo, OstreeRepoCommitState commitstate; gboolean ignore_missing_dirs = FALSE; - key = ostree_object_name_serialize (commit_checksum, OSTREE_OBJECT_TYPE_COMMIT); + key = g_variant_ref_sink (ostree_object_name_serialize (commit_checksum, OSTREE_OBJECT_TYPE_COMMIT)); if (g_hash_table_contains (inout_reachable, key)) break; diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 8aa76dac..1c4ae663 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -521,7 +521,6 @@ ostree_repo_finalize (GObject *object) (void) close (self->cache_dir_fd); if (self->objects_dir_fd != -1) (void) close (self->objects_dir_fd); - g_clear_object (&self->deltas_dir); if (self->uncompressed_objects_dir_fd != -1) (void) close (self->uncompressed_objects_dir_fd); g_clear_object (&self->sysroot_dir); @@ -606,8 +605,6 @@ ostree_repo_constructed (GObject *object) self->tmp_dir = g_file_resolve_relative_path (self->repodir, "tmp"); - self->deltas_dir = g_file_get_child (self->repodir, "deltas"); - /* Ensure the "sysroot-path" property is set. */ if (self->sysroot_dir == NULL) self->sysroot_dir = g_object_ref (_ostree_get_default_sysroot_path ()); @@ -1700,9 +1697,10 @@ out: * ostree_repo_remote_fetch_summary: * @self: Self * @name: name of a remote - * @out_summary: (nullable): return location for raw summary data, or %NULL - * @out_signatures: (nullable): return location for raw summary signature - * data, or %NULL + * @out_summary: (out) (optional): return location for raw summary data, or + * %NULL + * @out_signatures: (out) (optional): return location for raw summary + * signature data, or %NULL * @cancellable: a #GCancellable * @error: a #GError * diff --git a/src/libostree/ostree-sysroot-upgrader.c b/src/libostree/ostree-sysroot-upgrader.c index 447bd82b..daf2445c 100644 --- a/src/libostree/ostree-sysroot-upgrader.c +++ b/src/libostree/ostree-sysroot-upgrader.c @@ -77,7 +77,9 @@ parse_refspec (OstreeSysrootUpgrader *self, if ((self->flags & OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED) == 0) { - /* If explicit action by the OS creator is requried to upgrade, print their text as an error */ + /* If explicit action by the OS creator is requried to upgrade, print their text as an error. + * NOTE: If changing this, see the matching implementation in ostree-repo-pull.c. + */ unconfigured_state = g_key_file_get_string (self->origin, "origin", "unconfigured-state", NULL); if (unconfigured_state) { diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index 608d4cff..f50e34bd 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -613,8 +613,6 @@ parse_origin (OstreeSysroot *self, out: if (error) g_prefix_error (error, "Parsing %s: ", origin_path); - if (ret_origin) - g_key_file_unref (ret_origin); return ret; } @@ -689,7 +687,7 @@ parse_deployment (OstreeSysroot *self, glnx_fd_close int deployment_dfd = -1; const char *deploy_basename; g_autofree char *treebootserial_target = NULL; - GKeyFile *origin = NULL; + g_autoptr(GKeyFile) origin = NULL; g_autofree char *unlocked_development_path = NULL; struct stat stbuf; @@ -751,8 +749,6 @@ parse_deployment (OstreeSysroot *self, if (out_deployment) *out_deployment = g_steal_pointer (&ret_deployment); out: - if (origin) - g_key_file_unref (origin); return ret; } @@ -1327,7 +1323,7 @@ ostree_sysroot_try_lock (OstreeSysroot *self, GError **error) { gboolean ret = FALSE; - GError *local_error = NULL; + g_autoptr(GError) local_error = NULL; if (!ensure_sysroot_fd (self, error)) goto out; @@ -1342,7 +1338,7 @@ ostree_sysroot_try_lock (OstreeSysroot *self, } else { - g_propagate_error (error, local_error); + g_propagate_error (error, g_steal_pointer (&local_error)); goto out; } } diff --git a/src/ostree/ot-admin-builtin-cleanup.c b/src/ostree/ot-admin-builtin-cleanup.c index 7a76c14b..a6f74e38 100644 --- a/src/ostree/ot-admin-builtin-cleanup.c +++ b/src/ostree/ot-admin-builtin-cleanup.c @@ -36,7 +36,7 @@ static GOptionEntry options[] = { gboolean ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; gboolean ret = FALSE; @@ -55,7 +55,5 @@ ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GErr ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c index 3039cf0d..e59bec8e 100644 --- a/src/ostree/ot-admin-builtin-deploy.c +++ b/src/ostree/ot-admin-builtin-deploy.c @@ -54,7 +54,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro { gboolean ret = FALSE; const char *refspec; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; GKeyFile *origin = NULL; glnx_unref_object OstreeRepo *repo = NULL; @@ -173,7 +173,5 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro out: if (origin) g_key_file_unref (origin); - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-diff.c b/src/ostree/ot-admin-builtin-diff.c index 85a820ac..2615f24c 100644 --- a/src/ostree/ot-admin-builtin-diff.c +++ b/src/ostree/ot-admin-builtin-diff.c @@ -39,7 +39,7 @@ static GOptionEntry options[] = { gboolean ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; gboolean ret = FALSE; glnx_unref_object OstreeDeployment *deployment = NULL; @@ -95,7 +95,5 @@ ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-init-fs.c b/src/ostree/ot-admin-builtin-init-fs.c index 1f122553..9c08630d 100644 --- a/src/ostree/ot-admin-builtin-init-fs.c +++ b/src/ostree/ot-admin-builtin-init-fs.c @@ -36,7 +36,7 @@ static GOptionEntry options[] = { gboolean ot_admin_builtin_init_fs (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; gboolean ret = FALSE; glnx_fd_close int root_dfd = -1; @@ -88,7 +88,5 @@ ot_admin_builtin_init_fs (int argc, char **argv, GCancellable *cancellable, GErr ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-instutil.c b/src/ostree/ot-admin-builtin-instutil.c index 88894a6a..f27316a3 100644 --- a/src/ostree/ot-admin-builtin-instutil.c +++ b/src/ostree/ot-admin-builtin-instutil.c @@ -109,7 +109,7 @@ ot_admin_builtin_instutil (int argc, char **argv, GCancellable *cancellable, GEr if (!subcommand->name) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; g_autofree char *help; context = ostree_admin_instutil_option_context_new_with_commands (); @@ -134,8 +134,6 @@ ot_admin_builtin_instutil (int argc, char **argv, GCancellable *cancellable, GEr help = g_option_context_get_help (context, FALSE, NULL); g_printerr ("%s", help); - g_option_context_free (context); - goto out; } diff --git a/src/ostree/ot-admin-builtin-os-init.c b/src/ostree/ot-admin-builtin-os-init.c index fbb04949..cb95bebd 100644 --- a/src/ostree/ot-admin-builtin-os-init.c +++ b/src/ostree/ot-admin-builtin-os-init.c @@ -36,7 +36,7 @@ static GOptionEntry options[] = { gboolean ot_admin_builtin_os_init (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; gboolean ret = FALSE; const char *osname = NULL; @@ -66,7 +66,5 @@ ot_admin_builtin_os_init (int argc, char **argv, GCancellable *cancellable, GErr ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-set-origin.c b/src/ostree/ot-admin-builtin-set-origin.c index 0e79ab5e..a814d9d5 100644 --- a/src/ostree/ot-admin-builtin-set-origin.c +++ b/src/ostree/ot-admin-builtin-set-origin.c @@ -44,13 +44,13 @@ gboolean ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; const char *remotename = NULL; const char *url = NULL; const char *branch = NULL; glnx_unref_object OstreeRepo *repo = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; - OstreeDeployment *target_deployment = NULL; + glnx_unref_object OstreeDeployment *target_deployment = NULL; context = g_option_context_new ("REMOTENAME URL [BRANCH]"); @@ -85,6 +85,8 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G "Not currently booted into an OSTree system"); goto out; } + /* To match the below */ + target_deployment = g_object_ref (target_deployment); } else { @@ -142,7 +144,5 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-status.c b/src/ostree/ot-admin-builtin-status.c index 2550bcea..940e5df0 100644 --- a/src/ostree/ot-admin-builtin-status.c +++ b/src/ostree/ot-admin-builtin-status.c @@ -83,7 +83,7 @@ out: gboolean ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; gboolean ret = FALSE; glnx_unref_object OstreeRepo *repo = NULL; @@ -193,7 +193,5 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-switch.c b/src/ostree/ot-admin-builtin-switch.c index 485e6cd4..877cbe96 100644 --- a/src/ostree/ot-admin-builtin-switch.c +++ b/src/ostree/ot-admin-builtin-switch.c @@ -43,7 +43,7 @@ gboolean ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; const char *new_provided_refspec = NULL; glnx_unref_object OstreeRepo *repo = NULL; @@ -162,7 +162,5 @@ ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GErro out: if (new_origin) g_key_file_unref (new_origin); - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-undeploy.c b/src/ostree/ot-admin-builtin-undeploy.c index dd41950e..cc86ee43 100644 --- a/src/ostree/ot-admin-builtin-undeploy.c +++ b/src/ostree/ot-admin-builtin-undeploy.c @@ -36,7 +36,7 @@ gboolean ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; const char *deploy_index_str; int deploy_index; @@ -91,7 +91,5 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-unlock.c b/src/ostree/ot-admin-builtin-unlock.c index a1789377..0f22d0a6 100644 --- a/src/ostree/ot-admin-builtin-unlock.c +++ b/src/ostree/ot-admin-builtin-unlock.c @@ -42,7 +42,7 @@ gboolean ot_admin_builtin_unlock (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; OstreeDeployment *booted_deployment = NULL; OstreeDeploymentUnlockedState target_state; @@ -95,7 +95,5 @@ ot_admin_builtin_unlock (int argc, char **argv, GCancellable *cancellable, GErro ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c index 2ad74fc6..394b339a 100644 --- a/src/ostree/ot-admin-builtin-upgrade.c +++ b/src/ostree/ot-admin-builtin-upgrade.c @@ -49,7 +49,7 @@ gboolean ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; glnx_unref_object OstreeSysrootUpgrader *upgrader = NULL; g_autoptr(GKeyFile) origin = NULL; @@ -140,7 +140,5 @@ ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GErr ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c index 7d837ff4..4b8b581b 100644 --- a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c +++ b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c @@ -38,7 +38,7 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c { gboolean ret = FALSE; guint bootversion; - GOptionContext *context = NULL; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries"); @@ -76,7 +76,5 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c index 692a2623..424c7645 100644 --- a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c +++ b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c @@ -188,7 +188,7 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel glnx_unref_object OstreeSePolicy *sepolicy = NULL; g_autoptr(GPtrArray) deployments = NULL; OstreeDeployment *first_deployment; - GOptionContext *context = NULL; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; g_autoptr(GFile) deployment_path = NULL; @@ -241,7 +241,5 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-admin-instutil-builtin-set-kargs.c b/src/ostree/ot-admin-instutil-builtin-set-kargs.c index c51fc4d2..ad792a3a 100644 --- a/src/ostree/ot-admin-instutil-builtin-set-kargs.c +++ b/src/ostree/ot-admin-instutil-builtin-set-kargs.c @@ -50,7 +50,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel guint i; g_autoptr(GPtrArray) deployments = NULL; OstreeDeployment *first_deployment = NULL; - GOptionContext *context = NULL; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; __attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL; @@ -115,7 +115,5 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-admin.c b/src/ostree/ot-builtin-admin.c index 7e7b04b5..4760e532 100644 --- a/src/ostree/ot-builtin-admin.c +++ b/src/ostree/ot-builtin-admin.c @@ -124,7 +124,7 @@ ostree_builtin_admin (int argc, char **argv, GCancellable *cancellable, GError * if (!subcommand->name) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; g_autofree char *help; context = ostree_admin_option_context_new_with_commands (); @@ -149,8 +149,6 @@ ostree_builtin_admin (int argc, char **argv, GCancellable *cancellable, GError * help = g_option_context_get_help (context, FALSE, NULL); g_printerr ("%s", help); - g_option_context_free (context); - goto out; } diff --git a/src/ostree/ot-builtin-cat.c b/src/ostree/ot-builtin-cat.c index e258f3f7..a784afe1 100644 --- a/src/ostree/ot-builtin-cat.c +++ b/src/ostree/ot-builtin-cat.c @@ -61,7 +61,7 @@ cat_one_file (GFile *f, gboolean ostree_builtin_cat (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; int i; @@ -98,7 +98,5 @@ ostree_builtin_cat (int argc, char **argv, GCancellable *cancellable, GError **e ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-checkout.c b/src/ostree/ot-builtin-checkout.c index 21e568b2..95172f8b 100644 --- a/src/ostree/ot-builtin-checkout.c +++ b/src/ostree/ot-builtin-checkout.c @@ -230,7 +230,7 @@ process_many_checkouts (OstreeRepo *repo, gboolean ostree_builtin_checkout (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; const char *commit; @@ -281,7 +281,5 @@ ostree_builtin_checkout (int argc, char **argv, GCancellable *cancellable, GErro ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-checksum.c b/src/ostree/ot-builtin-checksum.c index 09697c88..540b02a1 100644 --- a/src/ostree/ot-builtin-checksum.c +++ b/src/ostree/ot-builtin-checksum.c @@ -58,7 +58,7 @@ on_checksum_received (GObject *obj, gboolean ostree_builtin_checksum (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; gboolean ret = FALSE; g_autoptr(GFile) f = NULL; AsyncChecksumData data = { 0, }; @@ -87,7 +87,5 @@ ostree_builtin_checksum (int argc, char **argv, GCancellable *cancellable, GErro out: if (data.loop) g_main_loop_unref (data.loop); - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c index fa829817..d3b634f9 100644 --- a/src/ostree/ot-builtin-commit.c +++ b/src/ostree/ot-builtin-commit.c @@ -331,7 +331,7 @@ parse_keyvalue_strings (char **strings, gboolean ostree_builtin_commit (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; gboolean skip_commit = FALSE; @@ -672,8 +672,6 @@ ostree_builtin_commit (int argc, char **argv, GCancellable *cancellable, GError out: if (repo) ostree_repo_abort_transaction (repo, cancellable, NULL); - if (context) - g_option_context_free (context); if (modifier) ostree_repo_commit_modifier_unref (modifier); return ret; diff --git a/src/ostree/ot-builtin-config.c b/src/ostree/ot-builtin-config.c index 75ccbeb0..0d8f7b77 100644 --- a/src/ostree/ot-builtin-config.c +++ b/src/ostree/ot-builtin-config.c @@ -55,7 +55,7 @@ split_key_string (const char *k, gboolean ostree_builtin_config (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context = NULL; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; const char *op; @@ -133,7 +133,5 @@ ostree_builtin_config (int argc, char **argv, GCancellable *cancellable, GError out: if (config) g_key_file_free (config); - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-diff.c b/src/ostree/ot-builtin-diff.c index a23ed83f..963a8b7c 100644 --- a/src/ostree/ot-builtin-diff.c +++ b/src/ostree/ot-builtin-diff.c @@ -121,7 +121,7 @@ gboolean ostree_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *src; const char *target; @@ -224,7 +224,5 @@ ostree_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError ** ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-export.c b/src/ostree/ot-builtin-export.c index db4dbc31..f3cdfbe0 100644 --- a/src/ostree/ot-builtin-export.c +++ b/src/ostree/ot-builtin-export.c @@ -24,6 +24,7 @@ #include "ot-builtins.h" #include "ostree.h" #include "ostree-repo-file.h" +#include "ostree-libarchive-private.h" #include "otutil.h" #ifdef HAVE_LIBARCHIVE @@ -59,7 +60,7 @@ propagate_libarchive_error (GError **error, gboolean ostree_builtin_export (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; const char *rev; @@ -67,7 +68,7 @@ ostree_builtin_export (int argc, char **argv, GCancellable *cancellable, GError g_autoptr(GFile) subtree = NULL; g_autofree char *commit = NULL; g_autoptr(GVariant) commit_data = NULL; - struct archive *a = NULL; + ot_cleanup_write_archive struct archive *a = NULL; OstreeRepoExportArchiveOptions opts = { 0, }; context = g_option_context_new ("COMMIT - Stream COMMIT to stdout in tar format"); @@ -154,11 +155,5 @@ ostree_builtin_export (int argc, char **argv, GCancellable *cancellable, GError ret = TRUE; out: -#ifdef HAVE_LIBARCHIVE - if (a) - archive_write_free (a); -#endif - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-fsck.c b/src/ostree/ot-builtin-fsck.c index 9809ad29..2f154cff 100644 --- a/src/ostree/ot-builtin-fsck.c +++ b/src/ostree/ot-builtin-fsck.c @@ -240,7 +240,7 @@ gboolean ostree_builtin_fsck (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; GHashTableIter hash_iter; gpointer key, value; @@ -311,7 +311,7 @@ ostree_builtin_fsck (int argc, char **argv, GCancellable *cancellable, GError ** if (commitstate & OSTREE_REPO_COMMIT_STATE_PARTIAL) n_partial++; else - g_hash_table_insert (commits, g_variant_ref (serialized_key), serialized_key); + g_hash_table_add (commits, g_variant_ref (serialized_key)); } } @@ -355,7 +355,5 @@ ostree_builtin_fsck (int argc, char **argv, GCancellable *cancellable, GError ** ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-gpg-sign.c b/src/ostree/ot-builtin-gpg-sign.c index 221e2004..c19ec682 100644 --- a/src/ostree/ot-builtin-gpg-sign.c +++ b/src/ostree/ot-builtin-gpg-sign.c @@ -197,7 +197,7 @@ out: gboolean ostree_builtin_gpg_sign (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; g_autofree char *resolved_commit = NULL; const char *commit; @@ -254,8 +254,5 @@ ostree_builtin_gpg_sign (int argc, char **argv, GCancellable *cancellable, GErro ret = TRUE; out: - if (context) - g_option_context_free (context); - return ret; } diff --git a/src/ostree/ot-builtin-init.c b/src/ostree/ot-builtin-init.c index a250b793..8180a8ae 100644 --- a/src/ostree/ot-builtin-init.c +++ b/src/ostree/ot-builtin-init.c @@ -36,7 +36,7 @@ static GOptionEntry options[] = { gboolean ostree_builtin_init (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context = NULL; + g_autoptr(GOptionContext) context = NULL; g_autoptr(OstreeRepo) repo = NULL; gboolean ret = FALSE; OstreeRepoMode mode; @@ -54,7 +54,5 @@ ostree_builtin_init (int argc, char **argv, GCancellable *cancellable, GError ** ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-log.c b/src/ostree/ot-builtin-log.c index ab0f1f0d..ca1cdc68 100644 --- a/src/ostree/ot-builtin-log.c +++ b/src/ostree/ot-builtin-log.c @@ -81,7 +81,7 @@ ostree_builtin_log (int argc, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; const char *rev; @@ -111,7 +111,5 @@ ostree_builtin_log (int argc, ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-ls.c b/src/ostree/ot-builtin-ls.c index ab63c8bb..3abeb5c4 100644 --- a/src/ostree/ot-builtin-ls.c +++ b/src/ostree/ot-builtin-ls.c @@ -242,7 +242,7 @@ print_one_argument (OstreeRepo *repo, gboolean ostree_builtin_ls (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; const char *rev; @@ -280,7 +280,5 @@ ostree_builtin_ls (int argc, char **argv, GCancellable *cancellable, GError **er ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-prune.c b/src/ostree/ot-builtin-prune.c index 393ba379..d226c84b 100644 --- a/src/ostree/ot-builtin-prune.c +++ b/src/ostree/ot-builtin-prune.c @@ -169,7 +169,7 @@ gboolean ostree_builtin_prune (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; g_autofree char *formatted_freed_size = NULL; OstreeRepoPruneFlags pruneflags = 0; @@ -235,7 +235,5 @@ ostree_builtin_prune (int argc, char **argv, GCancellable *cancellable, GError * ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c index 58a653ff..28717b85 100644 --- a/src/ostree/ot-builtin-pull-local.c +++ b/src/ostree/ot-builtin-pull-local.c @@ -53,7 +53,7 @@ gboolean ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; int i; const char *src_repo_arg; @@ -174,8 +174,6 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr ret = TRUE; out: - if (context) - g_option_context_free (context); if (repo) ostree_repo_abort_transaction (repo, cancellable, NULL); return ret; diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c index 8fa51002..f370ca01 100644 --- a/src/ostree/ot-builtin-pull.c +++ b/src/ostree/ot-builtin-pull.c @@ -109,7 +109,7 @@ dry_run_console_progress_changed (OstreeAsyncProgress *progress, gboolean ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; g_autofree char *remote = NULL; @@ -308,7 +308,5 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError ** out: if (signal_handler_id > 0) g_signal_handler_disconnect (repo, signal_handler_id); - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-refs.c b/src/ostree/ot-builtin-refs.c index 017b0c74..c7ea9a95 100644 --- a/src/ostree/ot-builtin-refs.c +++ b/src/ostree/ot-builtin-refs.c @@ -130,7 +130,7 @@ gboolean ostree_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; int i; @@ -172,8 +172,6 @@ ostree_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError ** ret = TRUE; out: - if (context) - g_option_context_free (context); if (repo) ostree_repo_abort_transaction (repo, cancellable, NULL); return ret; diff --git a/src/ostree/ot-builtin-remote.c b/src/ostree/ot-builtin-remote.c index 31924eb1..4f01cac2 100644 --- a/src/ostree/ot-builtin-remote.c +++ b/src/ostree/ot-builtin-remote.c @@ -33,13 +33,15 @@ typedef struct { static OstreeRemoteCommand remote_subcommands[] = { { "add", ot_remote_builtin_add }, - { "add-cookie", ot_remote_builtin_add_cookie }, { "delete", ot_remote_builtin_delete }, - { "delete-cookie", ot_remote_builtin_delete_cookie }, { "show-url", ot_remote_builtin_show_url }, { "list", ot_remote_builtin_list }, - { "list-cookies", ot_remote_builtin_list_cookies }, { "gpg-import", ot_remote_builtin_gpg_import }, +#ifdef HAVE_LIBSOUP + { "add-cookie", ot_remote_builtin_add_cookie }, + { "delete-cookie", ot_remote_builtin_delete_cookie }, + { "list-cookies", ot_remote_builtin_list_cookies }, +#endif { "refs", ot_remote_builtin_refs }, { "summary", ot_remote_builtin_summary }, { NULL, NULL } @@ -111,7 +113,7 @@ ostree_builtin_remote (int argc, char **argv, GCancellable *cancellable, GError if (!subcommand->name) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; g_autofree char *help; context = remote_option_context_new_with_commands (); @@ -135,8 +137,6 @@ ostree_builtin_remote (int argc, char **argv, GCancellable *cancellable, GError help = g_option_context_get_help (context, FALSE, NULL); g_printerr ("%s", help); - g_option_context_free (context); - goto out; } diff --git a/src/ostree/ot-builtin-reset.c b/src/ostree/ot-builtin-reset.c index 9468ae78..cab579ae 100644 --- a/src/ostree/ot-builtin-reset.c +++ b/src/ostree/ot-builtin-reset.c @@ -37,7 +37,7 @@ ostree_builtin_reset (int argc, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; g_autoptr(GHashTable) known_refs = NULL; gboolean ret = FALSE; @@ -83,8 +83,6 @@ ostree_builtin_reset (int argc, ret = TRUE; out: - if (context) - g_option_context_free (context); if (repo) ostree_repo_abort_transaction (repo, cancellable, NULL); return ret; diff --git a/src/ostree/ot-builtin-rev-parse.c b/src/ostree/ot-builtin-rev-parse.c index fb68d4ac..bedcc79d 100644 --- a/src/ostree/ot-builtin-rev-parse.c +++ b/src/ostree/ot-builtin-rev-parse.c @@ -34,7 +34,7 @@ static GOptionEntry options[] = { gboolean ostree_builtin_rev_parse (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; const char *rev = "master"; @@ -63,7 +63,5 @@ ostree_builtin_rev_parse (int argc, char **argv, GCancellable *cancellable, GErr ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-show.c b/src/ostree/ot-builtin-show.c index a9c1fbbc..6c45002a 100644 --- a/src/ostree/ot-builtin-show.c +++ b/src/ostree/ot-builtin-show.c @@ -252,7 +252,7 @@ print_if_found (OstreeRepo *repo, gboolean ostree_builtin_show (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; gboolean ret = FALSE; const char *rev; @@ -361,7 +361,5 @@ ostree_builtin_show (int argc, char **argv, GCancellable *cancellable, GError ** ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-static-delta.c b/src/ostree/ot-builtin-static-delta.c index ca29911a..c8843a65 100644 --- a/src/ostree/ot-builtin-static-delta.c +++ b/src/ostree/ot-builtin-static-delta.c @@ -110,7 +110,7 @@ ot_static_delta_builtin_list (int argc, char **argv, GCancellable *cancellable, gboolean ret = FALSE; g_autoptr(GPtrArray) delta_names = NULL; guint i; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; context = g_option_context_new ("LIST - list static delta files"); @@ -135,8 +135,6 @@ ot_static_delta_builtin_list (int argc, char **argv, GCancellable *cancellable, ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } @@ -144,7 +142,7 @@ static gboolean ot_static_delta_builtin_show (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *delta_id = NULL; @@ -167,8 +165,6 @@ ot_static_delta_builtin_show (int argc, char **argv, GCancellable *cancellable, ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } @@ -176,7 +172,7 @@ static gboolean ot_static_delta_builtin_delete (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *delta_id = NULL; @@ -199,8 +195,6 @@ ot_static_delta_builtin_delete (int argc, char **argv, GCancellable *cancellable ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } @@ -209,7 +203,7 @@ static gboolean ot_static_delta_builtin_generate (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; context = g_option_context_new ("GENERATE [TO] - Generate static delta files"); @@ -336,18 +330,18 @@ ot_static_delta_builtin_generate (int argc, char **argv, GCancellable *cancellab g_print ("Generating static delta:\n"); g_print (" From: %s\n", from_resolved ? from_resolved : "empty"); g_print (" To: %s\n", to_resolved); - if (!ostree_repo_static_delta_generate (repo, OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR, - from_resolved, to_resolved, NULL, - g_variant_builder_end (parambuilder), - cancellable, error)) - goto out; + { g_autoptr(GVariant) params = g_variant_ref_sink (g_variant_builder_end (parambuilder)); + if (!ostree_repo_static_delta_generate (repo, OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR, + from_resolved, to_resolved, NULL, + params, + cancellable, error)) + goto out; + } } ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } @@ -357,7 +351,7 @@ ot_static_delta_builtin_apply_offline (int argc, char **argv, GCancellable *canc gboolean ret = FALSE; const char *patharg; g_autoptr(GFile) path = NULL; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; context = g_option_context_new ("APPLY-OFFLINE - Apply static delta file"); @@ -388,8 +382,6 @@ ot_static_delta_builtin_apply_offline (int argc, char **argv, GCancellable *canc ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-builtin-summary.c b/src/ostree/ot-builtin-summary.c index 2ff1c965..04ba84e8 100644 --- a/src/ostree/ot-builtin-summary.c +++ b/src/ostree/ot-builtin-summary.c @@ -40,7 +40,7 @@ gboolean ostree_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; context = g_option_context_new ("Manage summary metadata"); @@ -75,7 +75,5 @@ ostree_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError ret = TRUE; out: - if (context) - g_option_context_free (context); return ret; } diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c index 0d0587f2..fb782275 100644 --- a/src/ostree/ot-main.c +++ b/src/ostree/ot-main.c @@ -83,7 +83,7 @@ int ostree_usage (OstreeCommand *commands, gboolean is_error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; g_autofree char *help; context = ostree_option_context_new_with_commands (commands); @@ -97,8 +97,6 @@ ostree_usage (OstreeCommand *commands, else g_print ("%s", help); - g_option_context_free (context); - return (is_error ? 1 : 0); } @@ -172,7 +170,7 @@ ostree_run (int argc, if (!command->fn) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; g_autofree char *help; context = ostree_option_context_new_with_commands (commands); @@ -196,8 +194,6 @@ ostree_run (int argc, help = g_option_context_get_help (context, FALSE, NULL); g_printerr ("%s", help); - g_option_context_free (context); - goto out; } diff --git a/src/ostree/ot-remote-builtin-add-cookie.c b/src/ostree/ot-remote-builtin-add-cookie.c index f1657bb8..509c9c7a 100644 --- a/src/ostree/ot-remote-builtin-add-cookie.c +++ b/src/ostree/ot-remote-builtin-add-cookie.c @@ -37,7 +37,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_add_cookie (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; const char *domain; @@ -80,7 +80,5 @@ ot_remote_builtin_add_cookie (int argc, char **argv, GCancellable *cancellable, /* jar takes ownership of cookie */ soup_cookie_jar_add_cookie (jar, cookie); - if (context) - g_option_context_free (context); return TRUE; } diff --git a/src/ostree/ot-remote-builtin-add.c b/src/ostree/ot-remote-builtin-add.c index 9d275cb5..93c989f9 100644 --- a/src/ostree/ot-remote-builtin-add.c +++ b/src/ostree/ot-remote-builtin-add.c @@ -44,7 +44,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_add (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; const char *remote_url; @@ -149,7 +149,5 @@ ot_remote_builtin_add (int argc, char **argv, GCancellable *cancellable, GError ret = TRUE; out: - g_option_context_free (context); - return ret; } diff --git a/src/ostree/ot-remote-builtin-delete-cookie.c b/src/ostree/ot-remote-builtin-delete-cookie.c index df65b277..d974dd8d 100644 --- a/src/ostree/ot-remote-builtin-delete-cookie.c +++ b/src/ostree/ot-remote-builtin-delete-cookie.c @@ -37,7 +37,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; const char *domain; @@ -92,7 +92,5 @@ ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellabl if (!found) g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Cookie not found in jar"); - if (context) - g_option_context_free (context); return found; } diff --git a/src/ostree/ot-remote-builtin-delete.c b/src/ostree/ot-remote-builtin-delete.c index caa5cf8f..8a4dd5f3 100644 --- a/src/ostree/ot-remote-builtin-delete.c +++ b/src/ostree/ot-remote-builtin-delete.c @@ -35,7 +35,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_delete (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; gboolean ret = FALSE; @@ -63,7 +63,5 @@ ot_remote_builtin_delete (int argc, char **argv, GCancellable *cancellable, GErr ret = TRUE; out: - g_option_context_free (context); - return ret; } diff --git a/src/ostree/ot-remote-builtin-gpg-import.c b/src/ostree/ot-remote-builtin-gpg-import.c index 4d2ad505..d1db06d0 100644 --- a/src/ostree/ot-remote-builtin-gpg-import.c +++ b/src/ostree/ot-remote-builtin-gpg-import.c @@ -93,7 +93,7 @@ out: gboolean ot_remote_builtin_gpg_import (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; g_autoptr(GInputStream) source_stream = NULL; const char *remote_name; @@ -136,7 +136,5 @@ ot_remote_builtin_gpg_import (int argc, char **argv, GCancellable *cancellable, ret = TRUE; out: - g_option_context_free (context); - return ret; } diff --git a/src/ostree/ot-remote-builtin-list-cookies.c b/src/ostree/ot-remote-builtin-list-cookies.c index 5ccc5d8d..1865fb07 100644 --- a/src/ostree/ot-remote-builtin-list-cookies.c +++ b/src/ostree/ot-remote-builtin-list-cookies.c @@ -37,7 +37,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_list_cookies (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; g_autofree char *jar_path = NULL; diff --git a/src/ostree/ot-remote-builtin-list.c b/src/ostree/ot-remote-builtin-list.c index c42c44ba..faf8d8ad 100644 --- a/src/ostree/ot-remote-builtin-list.c +++ b/src/ostree/ot-remote-builtin-list.c @@ -33,7 +33,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; g_auto(GStrv) remotes = NULL; guint ii, n_remotes = 0; @@ -73,7 +73,5 @@ ot_remote_builtin_list (int argc, char **argv, GCancellable *cancellable, GError ret = TRUE; out: - g_option_context_free (context); - return ret; } diff --git a/src/ostree/ot-remote-builtin-refs.c b/src/ostree/ot-remote-builtin-refs.c index 4317c45f..9e742912 100644 --- a/src/ostree/ot-remote-builtin-refs.c +++ b/src/ostree/ot-remote-builtin-refs.c @@ -35,7 +35,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; gboolean ret = FALSE; @@ -78,9 +78,6 @@ ot_remote_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError } ret = TRUE; - out: - g_option_context_free (context); - return ret; } diff --git a/src/ostree/ot-remote-builtin-summary.c b/src/ostree/ot-remote-builtin-summary.c index 4659dd4d..39321b53 100644 --- a/src/ostree/ot-remote-builtin-summary.c +++ b/src/ostree/ot-remote-builtin-summary.c @@ -39,7 +39,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; g_autoptr(GBytes) summary_bytes = NULL; @@ -120,9 +120,6 @@ ot_remote_builtin_summary (int argc, char **argv, GCancellable *cancellable, GEr } ret = TRUE; - out: - g_option_context_free (context); - return ret; } diff --git a/src/ostree/ot-remote-builtins.h b/src/ostree/ot-remote-builtins.h index 289e2e0d..aa2a7b6c 100644 --- a/src/ostree/ot-remote-builtins.h +++ b/src/ostree/ot-remote-builtins.h @@ -25,12 +25,14 @@ G_BEGIN_DECLS gboolean ot_remote_builtin_add (int argc, char **argv, GCancellable *cancellable, GError **error); -gboolean ot_remote_builtin_add_cookie (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_delete (int argc, char **argv, GCancellable *cancellable, GError **error); -gboolean ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_gpg_import (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error); +#ifdef HAVE_LIBSOUP +gboolean ot_remote_builtin_add_cookie (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_list_cookies (int argc, char **argv, GCancellable *cancellable, GError **error); +gboolean ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellable, GError **error); +#endif gboolean ot_remote_builtin_show_url (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError **error); diff --git a/tests/libtest.sh b/tests/libtest.sh index d16aae70..c0bf8d0d 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -86,13 +86,16 @@ if test -n "${OT_TESTS_DEBUG:-}"; then set -x fi +# This is substituted by the build for installed tests +BUILT_WITH_ASAN="" + if test -n "${OT_TESTS_VALGRIND:-}"; then CMD_PREFIX="env G_SLICE=always-malloc OSTREE_SUPPRESS_SYNCFS=1 valgrind -q --error-exitcode=1 --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/glib.supp --suppressions=${test_srcdir}/ostree.supp" else # In some cases the LD_PRELOAD may cause obscure problems, # e.g. right now it breaks for me with -fsanitize=address, so # let's allow users to skip it. - if test -z "${OT_SKIP_READDIR_RAND:-}"; then + if test -z "${OT_SKIP_READDIR_RAND:-}" && test -z "${BUILT_WITH_ASAN:-}"; then CMD_PREFIX="env LD_PRELOAD=${test_builddir}/libreaddir-rand.so" else CMD_PREFIX="" diff --git a/tests/pull-test.sh b/tests/pull-test.sh index 408d0539..56258b6c 100755 --- a/tests/pull-test.sh +++ b/tests/pull-test.sh @@ -35,7 +35,7 @@ function verify_initial_contents() { assert_file_has_content baz/cow '^moo$' } -echo "1..13" +echo "1..14" # Try both syntaxes repo_init @@ -249,3 +249,12 @@ assert_file_has_content baz/cow "further modified file for static deltas" assert_not_has_file baz/saucer echo "ok static delta 2" + +cd ${test_tmpdir} +${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false --set=unconfigured-state="Access to ExampleOS requires ONE BILLION DOLLARS." origin-subscription file://$(pwd)/ostree-srv/gnomerepo +if ${CMD_PREFIX} ostree --repo=repo pull origin-subscription main 2>err.txt; then + assert_not_reached "pull unexpectedly succeeded?" +fi +assert_file_has_content err.txt "ONE BILLION DOLLARS" + +echo "ok unconfigured" diff --git a/tests/test-basic-c.c b/tests/test-basic-c.c index 447c46ea..8e7882b9 100644 --- a/tests/test-basic-c.c +++ b/tests/test-basic-c.c @@ -73,7 +73,6 @@ test_raw_file_to_archive_z2_stream (gconstpointer data) &commit_checksum, &error); g_assert_no_error (error); - reachable = ostree_repo_traverse_new_reachable (); ostree_repo_traverse_commit (repo, commit_checksum, -1, diff --git a/tests/test-bsdiff.c b/tests/test-bsdiff.c index 5c5eb104..24772a1e 100644 --- a/tests/test-bsdiff.c +++ b/tests/test-bsdiff.c @@ -89,7 +89,9 @@ test_bsdiff (void) g_output_stream_close (out, NULL, NULL); /* Now generate NEW_GENERATED from OLD and OUT. */ - in = g_memory_input_stream_new_from_bytes (g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out))); + { g_autoptr(GBytes) bytes = g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out)); + in = g_memory_input_stream_new_from_bytes (bytes); + } bspatch_stream.read = bzpatch_read; bspatch_stream.opaque = in; diff --git a/tests/test-keyfile-utils.c b/tests/test-keyfile-utils.c index 4bf37578..376b0e82 100644 --- a/tests/test-keyfile-utils.c +++ b/tests/test-keyfile-utils.c @@ -31,37 +31,9 @@ static GKeyFile *g_keyfile; static void test_get_boolean_with_default (void) { - GError *error = NULL; + g_autoptr(GError) error = NULL; gboolean out = FALSE; - GLogLevelFlags always_fatal_mask; - - /* Avoid that g_return_val_if_fail causes the test to fail. */ - always_fatal_mask = g_log_set_always_fatal (0); - - - g_assert_false (ot_keyfile_get_boolean_with_default (NULL, - "section", - "a_boolean_true", - FALSE, - &out, - &error)); - g_assert_false (ot_keyfile_get_boolean_with_default (g_keyfile, - NULL, - "a_boolean_true", - FALSE, - &out, - &error)); - g_assert_false (ot_keyfile_get_boolean_with_default (g_keyfile, - "section", - NULL, - FALSE, - &out, - &error)); - - /* Restore the old mask. */ - g_log_set_always_fatal (always_fatal_mask); - g_assert (ot_keyfile_get_boolean_with_default (g_keyfile, "section", "a_boolean_true", @@ -86,6 +58,7 @@ test_get_boolean_with_default (void) &error)); g_assert_true (out); + g_clear_error (&error); g_assert_false (ot_keyfile_get_boolean_with_default (g_keyfile, "a_fake_section", "a_boolean_true", @@ -97,8 +70,8 @@ test_get_boolean_with_default (void) static void test_get_value_with_default (void) { - GError *error = NULL; - char *out = NULL; + g_autoptr(GError) error = NULL; + g_autofree char *out = NULL; GLogLevelFlags always_fatal_mask; const char *section = "section"; @@ -112,18 +85,21 @@ test_get_value_with_default (void) "none", &out, &error)); + g_clear_pointer (&out, g_free); g_assert_false (ot_keyfile_get_value_with_default (g_keyfile, section, NULL, "none", &out, &error)); + g_clear_pointer (&out, g_free); g_assert_false (ot_keyfile_get_value_with_default (g_keyfile, section, NULL, "something", &out, &error)); + g_clear_pointer (&out, g_free); /* Restore the old mask. */ g_log_set_always_fatal (always_fatal_mask); @@ -135,6 +111,7 @@ test_get_value_with_default (void) &out, &error)); g_assert_cmpstr (out, ==, "foo"); + g_clear_pointer (&out, g_free); g_assert (ot_keyfile_get_value_with_default (g_keyfile, section, @@ -143,6 +120,7 @@ test_get_value_with_default (void) &out, &error)); g_assert_cmpstr (out, ==, "correct"); + g_clear_pointer (&out, g_free); g_assert_false (ot_keyfile_get_value_with_default (g_keyfile, "a_fake_section", @@ -150,6 +128,8 @@ test_get_value_with_default (void) "no value", &out, &error)); + g_clear_error (&error); + g_clear_pointer (&out, g_free); } static void diff --git a/tests/test-libarchive-import.c b/tests/test-libarchive-import.c index 05c5568d..e9be7f66 100644 --- a/tests/test-libarchive-import.c +++ b/tests/test-libarchive-import.c @@ -26,6 +26,7 @@ #include #include +#include "ostree-libarchive-private.h" #include #include @@ -40,7 +41,7 @@ static void test_data_init (TestData *td) { GError *error = NULL; - struct archive *a = archive_write_new (); + ot_cleanup_write_archive struct archive *a = archive_write_new (); struct archive_entry *ae; uid_t uid = getuid (); gid_t gid = getgid (); @@ -115,12 +116,12 @@ test_data_init (TestData *td) archive_entry_free (ae); g_assert_cmpint (ARCHIVE_OK, ==, archive_write_close (a)); - g_assert_cmpint (ARCHIVE_OK, ==, archive_write_free (a)); td->fd_empty = openat (AT_FDCWD, "empty.tar.gz", O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, 0644); g_assert (td->fd_empty >= 0); (void) unlink ("empty.tar.gz"); + g_assert_cmpint (ARCHIVE_OK, ==, archive_write_free (a)); a = archive_write_new (); g_assert (a); @@ -128,7 +129,6 @@ test_data_init (TestData *td) g_assert_cmpint (0, ==, archive_write_add_filter_gzip (a)); g_assert_cmpint (0, ==, archive_write_open_fd (a, td->fd_empty)); g_assert_cmpint (ARCHIVE_OK, ==, archive_write_close (a)); - g_assert_cmpint (ARCHIVE_OK, ==, archive_write_free (a)); { g_autoptr(GFile) repopath = g_file_new_for_path ("repo"); td->repo = ostree_repo_new (repopath); @@ -165,7 +165,7 @@ test_libarchive_noautocreate_empty (gconstpointer data) { TestData *td = (void*)data; GError *error = NULL; - struct archive *a = archive_read_new (); + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0, }; glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new (); @@ -180,8 +180,8 @@ static void test_libarchive_autocreate_empty (gconstpointer data) { TestData *td = (void*)data; - GError *error = NULL; - struct archive *a = archive_read_new (); + g_autoptr(GError) error = NULL; + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0, }; glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new (); @@ -198,8 +198,8 @@ static void test_libarchive_error_device_file (gconstpointer data) { TestData *td = (void*)data; - GError *error = NULL; - struct archive *a = archive_read_new (); + g_autoptr(GError) error = NULL; + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0, }; glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new (); @@ -207,6 +207,7 @@ test_libarchive_error_device_file (gconstpointer data) (void)ostree_repo_import_archive_to_mtree (td->repo, &opts, a, mtree, NULL, NULL, &error); g_assert (error != NULL); + g_clear_error (&error); } static gboolean @@ -268,8 +269,8 @@ static void test_libarchive_ignore_device_file (gconstpointer data) { TestData *td = (void*)data; - GError *error = NULL; - struct archive *a = archive_read_new (); + g_autoptr(GError) error = NULL; + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0, }; if (skip_if_no_xattr (td)) @@ -331,7 +332,7 @@ test_libarchive_ostree_convention (gconstpointer data) { TestData *td = (void*)data; GError *error = NULL; - struct archive *a = archive_read_new (); + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0, }; if (skip_if_no_xattr (td)) @@ -373,7 +374,7 @@ test_libarchive_xattr_callback (gconstpointer data) { TestData *td = (void*)data; GError *error = NULL; - struct archive *a = archive_read_new (); + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0 }; OstreeRepoCommitModifier *modifier = NULL; char buf[7] = { 0 }; @@ -428,7 +429,7 @@ static void entry_pathname_test_helper (gconstpointer data, gboolean on) { TestData *td = (void*)data; GError *error = NULL; - struct archive *a = archive_read_new (); + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0, }; OstreeRepoCommitModifier *modifier = NULL; gboolean met_etc_file = FALSE; @@ -468,7 +469,6 @@ entry_pathname_test_helper (gconstpointer data, gboolean on) goto out; } - archive_read_free (a); ostree_repo_commit_modifier_unref (modifier); out: g_assert_no_error (error); @@ -491,7 +491,7 @@ test_libarchive_selinux (gconstpointer data) { TestData *td = (void*)data; GError *error = NULL; - struct archive *a = archive_read_new (); + ot_cleanup_read_archive struct archive *a = archive_read_new (); OstreeRepoImportArchiveOptions opts = { 0 }; glnx_unref_object OstreeSePolicy *sepol = NULL; OstreeRepoCommitModifier *modifier = NULL; @@ -536,7 +536,6 @@ test_libarchive_selinux (gconstpointer data) g_assert_cmpstr (buf, ==, "system_u:object_r:etc_t:s0"); out: - archive_read_free (a); if (modifier) ostree_repo_commit_modifier_unref (modifier); g_assert_no_error (error); @@ -563,6 +562,7 @@ int main (int argc, char **argv) r = g_test_run(); + g_clear_object (&td.repo); if (td.tmpd && g_getenv ("TEST_SKIP_CLEANUP") == NULL) (void) glnx_shutil_rm_rf_at (AT_FDCWD, td.tmpd, NULL, NULL); g_free (td.tmpd); diff --git a/tests/test-lzma.c b/tests/test-lzma.c index 8d37d47f..1f7d2559 100644 --- a/tests/test-lzma.c +++ b/tests/test-lzma.c @@ -32,7 +32,7 @@ static void helper_test_compress_decompress (const guint8 *data, gssize data_size) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_autoptr(GOutputStream) out_compress = g_memory_output_stream_new_resizable (); g_autoptr(GOutputStream) out_decompress = NULL; g_autoptr(GInputStream) in_compress = g_memory_input_stream_new_from_data (data, data_size, NULL); @@ -55,9 +55,10 @@ helper_test_compress_decompress (const guint8 *data, gssize data_size) { gssize n_bytes_written; g_autoptr(GInputStream) convin = NULL; - g_autoptr(GConverter) decompressor = (GConverter*)_ostree_lzma_decompressor_new (); + g_autoptr(GConverter) decompressor = (GConverter*)_ostree_lzma_decompressor_new (); + g_autoptr(GBytes) bytes = g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out_compress)); - in_decompress = g_memory_input_stream_new_from_bytes (g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out_compress))); + in_decompress = g_memory_input_stream_new_from_bytes (bytes); convin = g_converter_input_stream_new ((GInputStream*) in_decompress, decompressor); n_bytes_written = g_output_stream_splice (out_decompress, convin, G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET | G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE, diff --git a/tests/test-mutable-tree.c b/tests/test-mutable-tree.c index b357f691..9df36ac6 100644 --- a/tests/test-mutable-tree.c +++ b/tests/test-mutable-tree.c @@ -84,7 +84,7 @@ test_ensure_parent_dirs (void) glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new (); glnx_unref_object OstreeMutableTree *parent = NULL; g_autoptr(GPtrArray) split_path = NULL; - GError *error = NULL; + g_autoptr(GError) error = NULL; const char *pathname = "/foo/bar/baz"; const char *checksum = "01234567890123456789012345678901"; g_autofree char *source_checksum = NULL; @@ -103,6 +103,7 @@ test_ensure_parent_dirs (void) g_assert_false (ostree_mutable_tree_lookup (tree, "bar", &source_checksum2, &source_subdir2, &error)); + g_clear_error (&error); } static void @@ -110,7 +111,7 @@ test_ensure_dir (void) { glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new (); glnx_unref_object OstreeMutableTree *parent = NULL; - GError *error = NULL; + g_autoptr(GError) error = NULL; const char *dirname = "foo"; const char *filename = "bar"; const char *checksum = "01234567890123456789012345678901"; @@ -122,13 +123,14 @@ test_ensure_dir (void) g_assert (ostree_mutable_tree_replace_file (tree, filename, checksum, &error)); g_assert_false (ostree_mutable_tree_ensure_dir (tree, filename, &parent, &error)); + g_clear_error (&error); } static void test_replace_file (void) { glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new (); - GError *error = NULL; + g_autoptr(GError) error = NULL; const char *filename = "bar"; const char *checksum = "01234567890123456789012345678901"; const char *checksum2 = "ABCDEF01234567890123456789012345"; @@ -157,7 +159,7 @@ test_contents_checksum (void) const char *subdir_checksum = "ABCD0123456789012345678901234567"; glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new (); glnx_unref_object OstreeMutableTree *subdir = NULL; - GError *error = NULL; + g_autoptr(GError) error = NULL; g_assert_null (ostree_mutable_tree_get_contents_checksum (tree)); ostree_mutable_tree_set_contents_checksum (tree, checksum); diff --git a/tests/test-ot-opt-utils.c b/tests/test-ot-opt-utils.c index 7f334c36..77ecdf30 100644 --- a/tests/test-ot-opt-utils.c +++ b/tests/test-ot-opt-utils.c @@ -25,6 +25,7 @@ #include #include #include "ot-opt-utils.h" +#include "libglnx.h" static GString *printerr_str = NULL; @@ -39,19 +40,19 @@ util_usage_error_printerr (const gchar *string) static void test_ot_util_usage_error (void) { - GError *error = NULL; - GOptionContext *context = g_option_context_new ("[TEST]"); + g_autoptr(GError) error = NULL; + g_autoptr(GOptionContext) context = g_option_context_new ("[TEST]"); GPrintFunc old_printerr = g_set_printerr_handler (util_usage_error_printerr); ot_util_usage_error (context, "find_me", &error); g_assert_nonnull (strstr (printerr_str->str, "[TEST]")); g_assert_nonnull (strstr (error->message, "find_me")); + g_clear_error (&error); g_set_printerr_handler (old_printerr); g_string_free (printerr_str, TRUE); printerr_str = NULL; - g_option_context_free (context); } int main (int argc, char **argv) diff --git a/tests/test-ot-tool-util.c b/tests/test-ot-tool-util.c index e63a0185..13030fe4 100644 --- a/tests/test-ot-tool-util.c +++ b/tests/test-ot-tool-util.c @@ -43,7 +43,7 @@ ot_parse_keyvalue (const char *keyvalue, static void test_ot_parse_boolean (void) { - GError *error = NULL; + g_autoptr(GError) error = NULL; gboolean out = FALSE; g_assert_true (ot_parse_boolean ("yes", &out, &error)); g_assert_true (out); @@ -70,15 +70,17 @@ test_ot_parse_boolean (void) out = TRUE; g_assert_true (ot_parse_boolean ("none", &out, &error)); g_assert_false (out); + g_clear_error (&error); g_assert_false (ot_parse_boolean ("FOO", &out, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_FAILED); + g_clear_error (&error); } static void test_ot_parse_keyvalue (void) { - GError *error = NULL; + g_autoptr(GError) error = NULL; char *keyvalue[] = {"foo=bar", "a=", "b=1231231"}; char *key[] = {"foo", "a", "b"}; char *value[] = {"bar", "", "1231231"}; @@ -104,6 +106,7 @@ test_ot_parse_keyvalue (void) &out_value, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_FAILED); + g_clear_error (&error); } } diff --git a/tests/test-ot-unix-utils.c b/tests/test-ot-unix-utils.c index 6c77d2a2..5eeab1d1 100644 --- a/tests/test-ot-unix-utils.c +++ b/tests/test-ot-unix-utils.c @@ -50,22 +50,29 @@ test_ot_util_path_split_validate (void) static void test_ot_util_filename_validate (void) { - GError *error = NULL; + g_autoptr(GError) error = NULL; /* Check for valid inputs. */ g_assert (ot_util_filename_validate ("valid", &error)); + g_assert_no_error (error); g_assert (ot_util_filename_validate ("valid_file_name", &error)); + g_assert_no_error (error); g_assert (ot_util_filename_validate ("file.name", &error)); + g_assert_no_error (error); g_assert (ot_util_filename_validate ("foo..", &error)); + g_assert_no_error (error); g_assert (ot_util_filename_validate ("..bar", &error)); + g_assert_no_error (error); g_assert (ot_util_filename_validate ("baz:", &error)); + g_assert_no_error (error); /* Check for invalid inputs. */ g_assert_false (ot_util_filename_validate ("not/valid/file/name", &error)); - error = NULL; + g_clear_error (&error); g_assert_false (ot_util_filename_validate (".", &error)); - error = NULL; + g_clear_error (&error); g_assert_false (ot_util_filename_validate ("..", &error)); + g_clear_error (&error); } int main (int argc, char **argv) diff --git a/tests/test-pull-c.c b/tests/test-pull-c.c index d784312f..43d5d61d 100644 --- a/tests/test-pull-c.c +++ b/tests/test-pull-c.c @@ -127,6 +127,7 @@ int main (int argc, char **argv) g_test_add_data_func ("/test-pull-c/multi-ok-error-repeat", &td, test_pull_multi_error_then_ok); r = g_test_run(); + g_clear_object (&td.repo); return r; } diff --git a/tests/test-rollsum.c b/tests/test-rollsum.c index 97aeb0ae..1ed99645 100644 --- a/tests/test-rollsum.c +++ b/tests/test-rollsum.c @@ -74,8 +74,8 @@ test_rollsum (void) #define MAX_BUFFER_SIZE 1000000 gsize i; int len; - unsigned char *a = malloc (MAX_BUFFER_SIZE); - unsigned char *b = malloc (MAX_BUFFER_SIZE); + g_autofree unsigned char *a = malloc (MAX_BUFFER_SIZE); + g_autofree unsigned char *b = malloc (MAX_BUFFER_SIZE); g_autoptr(GRand) rand = g_rand_new (); /* These two buffers produce the same crc32. */ diff --git a/tests/test-varint.c b/tests/test-varint.c index 76f85573..062c47ef 100644 --- a/tests/test-varint.c +++ b/tests/test-varint.c @@ -27,7 +27,7 @@ static void check_one_roundtrip (guint64 val) { - GString *buf = g_string_new (NULL); + g_autoptr(GString) buf = g_string_new (NULL); guint64 newval; gsize bytes_read;