diff --git a/Makefile-libostree.am b/Makefile-libostree.am index 3e5bce64..884d05c5 100644 --- a/Makefile-libostree.am +++ b/Makefile-libostree.am @@ -59,6 +59,17 @@ libostree_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS) libostree_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS) endif +if USE_LIBSOUP +libostree_la_SOURCES += \ + src/libostree/ostree-fetcher.h \ + src/libostree/ostree-fetcher.c \ + src/libostree/ostree-repo-pull.c \ + $(NULL) +libostree_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS) +libostree_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS) +endif + + INSTALL_DATA_HOOKS += install-libostree-data-hook install-libostree-data-hook: rm -f $(DESTDIR)$(privlibdir)/libostree.la diff --git a/Makefile-ostree.am b/Makefile-ostree.am index 8083bf2d..b4382356 100644 --- a/Makefile-ostree.am +++ b/Makefile-ostree.am @@ -82,13 +82,7 @@ ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS) if USE_LIBSOUP -ostree_SOURCES += src/ostree/ostree-fetcher.h \ - src/ostree/ostree-fetcher.c \ - src/ostree/ostree-pull.h \ - src/ostree/ostree-pull.c \ - src/ostree/ot-builtin-pull.c \ - $(NULL) - +ostree_SOURCES += src/ostree/ot-builtin-pull.c ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS) ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS) endif diff --git a/src/ostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c similarity index 100% rename from src/ostree/ostree-fetcher.c rename to src/libostree/ostree-fetcher.c diff --git a/src/ostree/ostree-fetcher.h b/src/libostree/ostree-fetcher.h similarity index 100% rename from src/ostree/ostree-fetcher.h rename to src/libostree/ostree-fetcher.h diff --git a/src/ostree/ostree-pull.c b/src/libostree/ostree-repo-pull.c similarity index 99% rename from src/ostree/ostree-pull.c rename to src/libostree/ostree-repo-pull.c index 8e59d296..ec5701d1 100644 --- a/src/ostree/ostree-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -67,13 +67,8 @@ #include "config.h" - #include "ostree.h" -#include "ot-main.h" -#include "ot-builtins.h" - #include "ostree-fetcher.h" -#include "ostree-pull.h" typedef struct { enum { @@ -91,7 +86,7 @@ typedef struct { typedef struct { OstreeRepo *repo; - OstreePullFlags flags; + OstreeRepoPullFlags flags; char *remote_name; OstreeRepoMode remote_mode; OstreeFetcher *fetcher; @@ -783,7 +778,7 @@ scan_commit_object (OtPullData *pull_data, cancellable, error)) goto out; - if (pull_data->flags & OSTREE_PULL_FLAGS_RELATED) + if (pull_data->flags & OSTREE_REPO_PULL_FLAGS_RELATED) { const char *name; gs_unref_variant GVariant *csum_v = NULL; @@ -1184,12 +1179,12 @@ load_remote_repo_config (OtPullData *pull_data, } gboolean -ostree_pull (OstreeRepo *repo, - const char *remote_name, - char **refs_to_fetch, - OstreePullFlags flags, - GCancellable *cancellable, - GError **error) +ostree_repo_pull (OstreeRepo *repo, + const char *remote_name, + char **refs_to_fetch, + OstreeRepoPullFlags flags, + GCancellable *cancellable, + GError **error) { gboolean ret = FALSE; GHashTableIter hash_iter; diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h index 998bf433..60b213dc 100644 --- a/src/libostree/ostree-repo.h +++ b/src/libostree/ostree-repo.h @@ -347,5 +347,17 @@ gboolean ostree_repo_prune (OstreeRepo *repo, GCancellable *cancellable, GError **error); +typedef enum { + OSTREE_REPO_PULL_FLAGS_NONE, + OSTREE_REPO_PULL_FLAGS_RELATED +} OstreeRepoPullFlags; + +gboolean ostree_repo_pull (OstreeRepo *repo, + const char *remote_name, + char **refs_to_fetch, + OstreeRepoPullFlags flags, + GCancellable *cancellable, + GError **error); + G_END_DECLS diff --git a/src/ostree/ostree-pull.h b/src/ostree/ostree-pull.h deleted file mode 100644 index ee6927ee..00000000 --- a/src/ostree/ostree-pull.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * - * Copyright (C) 2013 Colin Walters - * - * This program 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 licence 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. - */ - -#pragma once - -#include "ostree.h" - -G_BEGIN_DECLS - -typedef enum { - OSTREE_PULL_FLAGS_NONE, - OSTREE_PULL_FLAGS_RELATED -} OstreePullFlags; - -gboolean ostree_pull (OstreeRepo *repo, - const char *remote_name, - char **refs_to_fetch, - OstreePullFlags flags, - GCancellable *cancellable, - GError **error); - -G_END_DECLS - diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c index 1222803c..b4b99815 100644 --- a/src/ostree/ot-admin-builtin-upgrade.c +++ b/src/ostree/ot-admin-builtin-upgrade.c @@ -25,7 +25,6 @@ #include "ot-admin-builtins.h" #include "ot-admin-functions.h" #include "ot-admin-deploy.h" -#include "ostree-pull.h" #include "ostree.h" #include "otutil.h" @@ -123,8 +122,8 @@ ot_admin_builtin_upgrade (int argc, char **argv, OtAdminBuiltinOpts *admin_opts, g_print ("Fetching remote %s ref %s\n", origin_remote, origin_ref); - if (!ostree_pull (repo, origin_remote, refs_to_fetch, OSTREE_PULL_FLAGS_NONE, - cancellable, error)) + if (!ostree_repo_pull (repo, origin_remote, refs_to_fetch, OSTREE_REPO_PULL_FLAGS_NONE, + cancellable, error)) goto out; } diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c index a2f266e6..a3aa73ba 100644 --- a/src/ostree/ot-builtin-pull.c +++ b/src/ostree/ot-builtin-pull.c @@ -24,7 +24,6 @@ #include "ot-builtins.h" #include "ostree.h" -#include "ostree-pull.h" #include "ostree-repo-file.h" #include @@ -44,7 +43,7 @@ ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GError **error) gboolean ret = FALSE; GCancellable *cancellable = NULL; const char *remote; - OstreePullFlags pullflags = 0; + OstreeRepoPullFlags pullflags = 0; gs_unref_object OstreeRepo *repo = NULL; gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL; @@ -75,9 +74,9 @@ ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GError **error) } if (opt_related) - pullflags |= OSTREE_PULL_FLAGS_RELATED; + pullflags |= OSTREE_REPO_PULL_FLAGS_RELATED; - if (!ostree_pull (repo, remote, refs_to_fetch ? (char**)refs_to_fetch->pdata : NULL, + if (!ostree_repo_pull (repo, remote, refs_to_fetch ? (char**)refs_to_fetch->pdata : NULL, pullflags, cancellable, error)) goto out;