parent
5dd0d5da40
commit
2535f32c56
|
|
@ -59,6 +59,17 @@ libostree_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)
|
||||||
libostree_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS)
|
libostree_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS)
|
||||||
endif
|
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_DATA_HOOKS += install-libostree-data-hook
|
||||||
install-libostree-data-hook:
|
install-libostree-data-hook:
|
||||||
rm -f $(DESTDIR)$(privlibdir)/libostree.la
|
rm -f $(DESTDIR)$(privlibdir)/libostree.la
|
||||||
|
|
|
||||||
|
|
@ -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)
|
ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
|
||||||
|
|
||||||
if USE_LIBSOUP
|
if USE_LIBSOUP
|
||||||
ostree_SOURCES += src/ostree/ostree-fetcher.h \
|
ostree_SOURCES += src/ostree/ot-builtin-pull.c
|
||||||
src/ostree/ostree-fetcher.c \
|
|
||||||
src/ostree/ostree-pull.h \
|
|
||||||
src/ostree/ostree-pull.c \
|
|
||||||
src/ostree/ot-builtin-pull.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
|
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
|
||||||
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
|
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,8 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include "ostree.h"
|
#include "ostree.h"
|
||||||
#include "ot-main.h"
|
|
||||||
#include "ot-builtins.h"
|
|
||||||
|
|
||||||
#include "ostree-fetcher.h"
|
#include "ostree-fetcher.h"
|
||||||
#include "ostree-pull.h"
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -91,7 +86,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
OstreeRepo *repo;
|
OstreeRepo *repo;
|
||||||
OstreePullFlags flags;
|
OstreeRepoPullFlags flags;
|
||||||
char *remote_name;
|
char *remote_name;
|
||||||
OstreeRepoMode remote_mode;
|
OstreeRepoMode remote_mode;
|
||||||
OstreeFetcher *fetcher;
|
OstreeFetcher *fetcher;
|
||||||
|
|
@ -783,7 +778,7 @@ scan_commit_object (OtPullData *pull_data,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (pull_data->flags & OSTREE_PULL_FLAGS_RELATED)
|
if (pull_data->flags & OSTREE_REPO_PULL_FLAGS_RELATED)
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
gs_unref_variant GVariant *csum_v = NULL;
|
gs_unref_variant GVariant *csum_v = NULL;
|
||||||
|
|
@ -1184,12 +1179,12 @@ load_remote_repo_config (OtPullData *pull_data,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ostree_pull (OstreeRepo *repo,
|
ostree_repo_pull (OstreeRepo *repo,
|
||||||
const char *remote_name,
|
const char *remote_name,
|
||||||
char **refs_to_fetch,
|
char **refs_to_fetch,
|
||||||
OstreePullFlags flags,
|
OstreeRepoPullFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GHashTableIter hash_iter;
|
GHashTableIter hash_iter;
|
||||||
|
|
@ -347,5 +347,17 @@ gboolean ostree_repo_prune (OstreeRepo *repo,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
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
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013 Colin Walters <walters@verbum.org>
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
#include "ot-admin-builtins.h"
|
#include "ot-admin-builtins.h"
|
||||||
#include "ot-admin-functions.h"
|
#include "ot-admin-functions.h"
|
||||||
#include "ot-admin-deploy.h"
|
#include "ot-admin-deploy.h"
|
||||||
#include "ostree-pull.h"
|
|
||||||
#include "ostree.h"
|
#include "ostree.h"
|
||||||
#include "otutil.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);
|
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,
|
if (!ostree_repo_pull (repo, origin_remote, refs_to_fetch, OSTREE_REPO_PULL_FLAGS_NONE,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
#include "ot-builtins.h"
|
#include "ot-builtins.h"
|
||||||
#include "ostree.h"
|
#include "ostree.h"
|
||||||
#include "ostree-pull.h"
|
|
||||||
#include "ostree-repo-file.h"
|
#include "ostree-repo-file.h"
|
||||||
|
|
||||||
#include <gio/gunixoutputstream.h>
|
#include <gio/gunixoutputstream.h>
|
||||||
|
|
@ -44,7 +43,7 @@ ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GError **error)
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GCancellable *cancellable = NULL;
|
GCancellable *cancellable = NULL;
|
||||||
const char *remote;
|
const char *remote;
|
||||||
OstreePullFlags pullflags = 0;
|
OstreeRepoPullFlags pullflags = 0;
|
||||||
gs_unref_object OstreeRepo *repo = NULL;
|
gs_unref_object OstreeRepo *repo = NULL;
|
||||||
gs_unref_ptrarray GPtrArray *refs_to_fetch = 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)
|
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))
|
pullflags, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue