Rename rpmostree-hif.[ch] -> core
This is really going to be the heart of rpm-ostree, so let's give it a better name.
This commit is contained in:
parent
f14d1a3536
commit
b3a7b4e218
@ -28,8 +28,8 @@ librpmostreepriv_la_SOURCES = \
|
||||
src/libpriv/rpmostree-passwd-util.h \
|
||||
src/libpriv/rpmostree-refts.h \
|
||||
src/libpriv/rpmostree-refts.c \
|
||||
src/libpriv/rpmostree-hif.c \
|
||||
src/libpriv/rpmostree-hif.h \
|
||||
src/libpriv/rpmostree-core.c \
|
||||
src/libpriv/rpmostree-core.h \
|
||||
src/libpriv/rpmostree-refsack.h \
|
||||
src/libpriv/rpmostree-refsack.c \
|
||||
src/libpriv/rpmostree-cleanup.h \
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "rpmostree-compose-builtins.h"
|
||||
#include "rpmostree-util.h"
|
||||
#include "rpmostree-hif.h"
|
||||
#include "rpmostree-core.h"
|
||||
#include "rpmostree-json-parsing.h"
|
||||
#include "rpmostree-postprocess.h"
|
||||
#include "rpmostree-passwd-util.h"
|
||||
@ -150,7 +150,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
gboolean ret = FALSE;
|
||||
guint progress_sigid;
|
||||
GFile *contextdir = self->treefile_context_dirs->pdata[0];
|
||||
g_auto(RpmOstreeHifInstall) hifinstall = { 0, };
|
||||
g_auto(RpmOstreeInstall) hifinstall = { 0, };
|
||||
gs_unref_object HifContext *hifctx = NULL;
|
||||
gs_free char *cachedir = g_build_filename (gs_file_get_path_cached (self->workdir),
|
||||
"cache",
|
||||
@ -163,7 +163,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
NULL);
|
||||
gs_free char *ret_new_inputhash = NULL;
|
||||
|
||||
hifctx = _rpmostree_libhif_new_default ();
|
||||
hifctx = _rpmostree_core_new_default ();
|
||||
if (opt_proxy)
|
||||
hif_context_set_http_proxy (hifctx, opt_proxy);
|
||||
hif_context_set_install_root (hifctx, gs_file_get_path_cached (yumroot));
|
||||
@ -195,7 +195,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
}
|
||||
}
|
||||
|
||||
if (!_rpmostree_libhif_setup (hifctx, cancellable, error))
|
||||
if (!_rpmostree_core_setup (hifctx, cancellable, error))
|
||||
goto out;
|
||||
|
||||
/* Bind the json \"repos\" member to the hif state, which looks at the
|
||||
@ -209,7 +209,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
guint i;
|
||||
guint n;
|
||||
|
||||
_rpmostree_libhif_repos_disable_all (hifctx);
|
||||
_rpmostree_core_repos_disable_all (hifctx);
|
||||
|
||||
if (!json_object_has_member (treedata, "repos"))
|
||||
{
|
||||
@ -226,7 +226,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
const char *reponame = _rpmostree_jsonutil_array_require_string_element (enable_repos, i, error);
|
||||
if (!reponame)
|
||||
goto out;
|
||||
if (!_rpmostree_libhif_repos_enable_by_name (hifctx, reponame, error))
|
||||
if (!_rpmostree_core_repos_enable_by_name (hifctx, reponame, error))
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@ -245,10 +245,10 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
}
|
||||
|
||||
/* --- Downloading metadata --- */
|
||||
if (!_rpmostree_libhif_console_download_metadata (hifctx, cancellable, error))
|
||||
if (!_rpmostree_core_download_metadata (hifctx, cancellable, error))
|
||||
goto out;
|
||||
|
||||
if (!_rpmostree_libhif_console_prepare_install (hifctx, NULL, (const char *const*)packages,
|
||||
if (!_rpmostree_core_prepare_install (hifctx, NULL, (const char *const*)packages,
|
||||
&hifinstall, cancellable, error))
|
||||
goto out;
|
||||
|
||||
@ -284,7 +284,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
}
|
||||
|
||||
/* --- Downloading packages --- */
|
||||
if (!_rpmostree_libhif_console_download_rpms (hifctx, -1, &hifinstall, cancellable, error))
|
||||
if (!_rpmostree_core_download_rpms (hifctx, -1, &hifinstall, cancellable, error))
|
||||
goto out;
|
||||
|
||||
{ g_auto(GLnxConsoleRef) console = { 0, };
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "rpmostree-container-builtins.h"
|
||||
#include "rpmostree-util.h"
|
||||
#include "rpmostree-hif.h"
|
||||
#include "rpmostree-core.h"
|
||||
#include "rpmostree-libbuiltin.h"
|
||||
#include "rpmostree-rpm-util.h"
|
||||
#include "rpmostree-unpacker.h"
|
||||
@ -140,7 +140,7 @@ roc_context_prepare_for_root (ROContainerContext *rocctx,
|
||||
if (have_a_repo_file)
|
||||
reposdir = glnx_fdrel_abspath (rocctx->userroot_dfd, "rpmmd.repos.d");
|
||||
|
||||
rocctx->hifctx = _rpmostree_libhif_new (rocctx->rpmmd_dfd, abs_instroot_tmp, reposdir,
|
||||
rocctx->hifctx = _rpmostree_core_new (rocctx->rpmmd_dfd, abs_instroot_tmp, reposdir,
|
||||
NULL, NULL, error);
|
||||
if (!rocctx->hifctx)
|
||||
goto out;
|
||||
@ -265,7 +265,7 @@ rpmostree_container_builtin_assemble (int argc,
|
||||
GOptionContext *context = g_option_context_new ("NAME [PKGNAME PKGNAME...]");
|
||||
g_auto(ROContainerContext) rocctx_data = RO_CONTAINER_CONTEXT_INIT;
|
||||
ROContainerContext *rocctx = &rocctx_data;
|
||||
g_auto(RpmOstreeHifInstall) hifinstall = {0,};
|
||||
g_auto(RpmOstreeInstall) hifinstall = {0,};
|
||||
const char *name;
|
||||
struct stat stbuf;
|
||||
g_autofree char**pkgnames = NULL;
|
||||
@ -325,16 +325,16 @@ rpmostree_container_builtin_assemble (int argc,
|
||||
goto out;
|
||||
|
||||
/* --- Downloading metadata --- */
|
||||
if (!_rpmostree_libhif_console_download_metadata (rocctx->hifctx, cancellable, error))
|
||||
if (!_rpmostree_core_download_metadata (rocctx->hifctx, cancellable, error))
|
||||
goto out;
|
||||
|
||||
/* --- Resolving dependencies --- */
|
||||
if (!_rpmostree_libhif_console_prepare_install (rocctx->hifctx, rocctx->repo, (const char*const*)pkgnames,
|
||||
if (!_rpmostree_core_prepare_install (rocctx->hifctx, rocctx->repo, (const char*const*)pkgnames,
|
||||
&hifinstall, cancellable, error))
|
||||
goto out;
|
||||
|
||||
/* --- Download and import as necessary --- */
|
||||
if (!_rpmostree_libhif_console_download_import (rocctx->hifctx, rocctx->repo, &hifinstall,
|
||||
if (!_rpmostree_core_download_import (rocctx->hifctx, rocctx->repo, &hifinstall,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
|
||||
@ -343,7 +343,7 @@ rpmostree_container_builtin_assemble (int argc,
|
||||
if (!glnx_opendirat (rocctx->userroot_dfd, "tmp", TRUE, &tmpdir_dfd, error))
|
||||
goto out;
|
||||
|
||||
if (!_rpmostree_libhif_console_assemble_commit (rocctx->hifctx, tmpdir_dfd,
|
||||
if (!_rpmostree_core_assemble_commit (rocctx->hifctx, tmpdir_dfd,
|
||||
rocctx->repo, name,
|
||||
&hifinstall,
|
||||
&commit,
|
||||
@ -440,7 +440,7 @@ rpmostree_container_builtin_upgrade (int argc, char **argv, GCancellable *cancel
|
||||
GOptionContext *context = g_option_context_new ("NAME");
|
||||
g_auto(ROContainerContext) rocctx_data = RO_CONTAINER_CONTEXT_INIT;
|
||||
ROContainerContext *rocctx = &rocctx_data;
|
||||
g_auto(RpmOstreeHifInstall) hifinstall = {0,};
|
||||
g_auto(RpmOstreeInstall) hifinstall = {0,};
|
||||
const char *name;
|
||||
const char *const*pkgnames;
|
||||
g_autofree char *commit_checksum = NULL;
|
||||
@ -499,7 +499,7 @@ rpmostree_container_builtin_upgrade (int argc, char **argv, GCancellable *cancel
|
||||
goto out;
|
||||
|
||||
/* --- Downloading metadata --- */
|
||||
if (!_rpmostree_libhif_console_download_metadata (rocctx->hifctx, cancellable, error))
|
||||
if (!_rpmostree_core_download_metadata (rocctx->hifctx, cancellable, error))
|
||||
goto out;
|
||||
|
||||
{ g_autoptr(GVariantDict) metadata_dict = NULL;
|
||||
@ -530,10 +530,10 @@ rpmostree_container_builtin_upgrade (int argc, char **argv, GCancellable *cancel
|
||||
}
|
||||
|
||||
/* --- Resolving dependencies --- */
|
||||
if (!_rpmostree_libhif_console_prepare_install (rocctx->hifctx, rocctx->repo,
|
||||
pkgnames,
|
||||
&hifinstall,
|
||||
cancellable, error))
|
||||
if (!_rpmostree_core_prepare_install (rocctx->hifctx, rocctx->repo,
|
||||
pkgnames,
|
||||
&hifinstall,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
|
||||
{ g_autofree char *new_goal_sha512 = _rpmostree_hif_checksum_goal (G_CHECKSUM_SHA512, hif_context_get_goal (rocctx->hifctx));
|
||||
@ -547,7 +547,7 @@ rpmostree_container_builtin_upgrade (int argc, char **argv, GCancellable *cancel
|
||||
}
|
||||
|
||||
/* --- Download and import as necessary --- */
|
||||
if (!_rpmostree_libhif_console_download_import (rocctx->hifctx, rocctx->repo, &hifinstall,
|
||||
if (!_rpmostree_core_download_import (rocctx->hifctx, rocctx->repo, &hifinstall,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
|
||||
@ -556,11 +556,11 @@ rpmostree_container_builtin_upgrade (int argc, char **argv, GCancellable *cancel
|
||||
if (!glnx_opendirat (rocctx->userroot_dfd, "tmp", TRUE, &tmpdir_dfd, error))
|
||||
goto out;
|
||||
|
||||
if (!_rpmostree_libhif_console_assemble_commit (rocctx->hifctx, tmpdir_dfd,
|
||||
rocctx->repo, name,
|
||||
&hifinstall,
|
||||
&new_commit_checksum,
|
||||
cancellable, error))
|
||||
if (!_rpmostree_core_assemble_commit (rocctx->hifctx, tmpdir_dfd,
|
||||
rocctx->repo, name,
|
||||
&hifinstall,
|
||||
&new_commit_checksum,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "rpmostree-internals-builtins.h"
|
||||
#include "rpmostree-util.h"
|
||||
#include "rpmostree-hif.h"
|
||||
#include "rpmostree-core.h"
|
||||
#include "rpmostree-libbuiltin.h"
|
||||
#include "rpmostree-rpm-util.h"
|
||||
#include "rpmostree-unpacker.h"
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include <libhif/hif-package.h>
|
||||
#include <librepo/librepo.h>
|
||||
|
||||
#include "rpmostree-hif.h"
|
||||
#include "rpmostree-core.h"
|
||||
#include "rpmostree-rpm-util.h"
|
||||
#include "rpmostree-unpacker.h"
|
||||
|
||||
@ -54,7 +54,7 @@ _rpmostree_reset_rpm_sighandlers (void)
|
||||
}
|
||||
|
||||
HifContext *
|
||||
_rpmostree_libhif_new_default (void)
|
||||
_rpmostree_core_new_default (void)
|
||||
{
|
||||
HifContext *hifctx;
|
||||
|
||||
@ -84,7 +84,7 @@ _rpmostree_libhif_new_default (void)
|
||||
}
|
||||
|
||||
HifContext *
|
||||
_rpmostree_libhif_new (int rpmmd_cache_dfd,
|
||||
_rpmostree_core_new (int rpmmd_cache_dfd,
|
||||
const char *installroot,
|
||||
const char *repos_dir,
|
||||
const char *const *enabled_repos,
|
||||
@ -92,9 +92,9 @@ _rpmostree_libhif_new (int rpmmd_cache_dfd,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
glnx_unref_object HifContext *hifctx = _rpmostree_libhif_new_default ();
|
||||
glnx_unref_object HifContext *hifctx = _rpmostree_core_new_default ();
|
||||
|
||||
_rpmostree_libhif_set_cache_dfd (hifctx, rpmmd_cache_dfd);
|
||||
_rpmostree_core_set_cache_dfd (hifctx, rpmmd_cache_dfd);
|
||||
if (repos_dir)
|
||||
hif_context_set_repo_dir (hifctx, repos_dir);
|
||||
|
||||
@ -106,18 +106,18 @@ _rpmostree_libhif_new (int rpmmd_cache_dfd,
|
||||
*/
|
||||
hif_context_set_release_ver (hifctx, "42");
|
||||
|
||||
if (!_rpmostree_libhif_setup (hifctx, cancellable, error))
|
||||
if (!_rpmostree_core_setup (hifctx, cancellable, error))
|
||||
goto out;
|
||||
|
||||
if (enabled_repos)
|
||||
{
|
||||
_rpmostree_libhif_repos_disable_all (hifctx);
|
||||
_rpmostree_core_repos_disable_all (hifctx);
|
||||
|
||||
{ const char * const *strviter = enabled_repos;
|
||||
for (; strviter && *strviter; strviter++)
|
||||
{
|
||||
const char *reponame = *strviter;
|
||||
if (!_rpmostree_libhif_repos_enable_by_name (hifctx, reponame, error))
|
||||
if (!_rpmostree_core_repos_enable_by_name (hifctx, reponame, error))
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@ -131,7 +131,7 @@ _rpmostree_libhif_new (int rpmmd_cache_dfd,
|
||||
}
|
||||
|
||||
void
|
||||
_rpmostree_libhif_set_cache_dfd (HifContext *hifctx, int dfd)
|
||||
_rpmostree_core_set_cache_dfd (HifContext *hifctx, int dfd)
|
||||
{
|
||||
g_autofree char *repomddir =
|
||||
glnx_fdrel_abspath (dfd, RPMOSTREE_DIR_CACHE_REPOMD);
|
||||
@ -146,7 +146,7 @@ _rpmostree_libhif_set_cache_dfd (HifContext *hifctx, int dfd)
|
||||
}
|
||||
|
||||
gboolean
|
||||
_rpmostree_libhif_setup (HifContext *context,
|
||||
_rpmostree_core_setup (HifContext *context,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
@ -157,7 +157,7 @@ _rpmostree_libhif_setup (HifContext *context,
|
||||
}
|
||||
|
||||
void
|
||||
_rpmostree_libhif_repos_disable_all (HifContext *context)
|
||||
_rpmostree_core_repos_disable_all (HifContext *context)
|
||||
{
|
||||
GPtrArray *sources;
|
||||
guint i;
|
||||
@ -172,7 +172,7 @@ _rpmostree_libhif_repos_disable_all (HifContext *context)
|
||||
}
|
||||
|
||||
gboolean
|
||||
_rpmostree_libhif_repos_enable_by_name (HifContext *context,
|
||||
_rpmostree_core_repos_enable_by_name (HifContext *context,
|
||||
const char *name,
|
||||
GError **error)
|
||||
{
|
||||
@ -218,7 +218,7 @@ on_hifstate_percentage_changed (HifState *hifstate,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_rpmostree_libhif_console_download_metadata (HifContext *hifctx,
|
||||
_rpmostree_core_download_metadata (HifContext *hifctx,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
@ -394,10 +394,10 @@ get_packages_to_download (HifContext *hifctx,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_rpmostree_libhif_console_prepare_install (HifContext *hifctx,
|
||||
_rpmostree_core_prepare_install (HifContext *hifctx,
|
||||
OstreeRepo *ostreerepo,
|
||||
const char *const *pkgnames,
|
||||
RpmOstreeHifInstall *out_install,
|
||||
RpmOstreeInstall *out_install,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
@ -436,7 +436,7 @@ _rpmostree_libhif_console_prepare_install (HifContext *hifctx,
|
||||
}
|
||||
|
||||
struct GlobalDownloadState {
|
||||
struct RpmOstreeHifInstall *install;
|
||||
struct RpmOstreeInstall *install;
|
||||
HifState *hifstate;
|
||||
gchar *last_mirror_url;
|
||||
gchar *last_mirror_failure_message;
|
||||
@ -456,7 +456,7 @@ package_download_update_state_cb (void *user_data,
|
||||
gdouble now_downloaded)
|
||||
{
|
||||
struct PkgDownloadState *dlstate = user_data;
|
||||
struct RpmOstreeHifInstall *install = dlstate->gdlstate->install;
|
||||
struct RpmOstreeInstall *install = dlstate->gdlstate->install;
|
||||
if (!dlstate->added_total)
|
||||
{
|
||||
dlstate->added_total = TRUE;
|
||||
@ -578,7 +578,7 @@ hif_source_checksum_hy_to_lr (int checksum_hy)
|
||||
static gboolean
|
||||
source_download_packages (HifRepo *source,
|
||||
GPtrArray *packages,
|
||||
RpmOstreeHifInstall *install,
|
||||
RpmOstreeInstall *install,
|
||||
int target_dfd,
|
||||
HifState *state,
|
||||
GCancellable *cancellable,
|
||||
@ -679,7 +679,7 @@ source_download_packages (HifRepo *source,
|
||||
|
||||
static GHashTable *
|
||||
gather_source_to_packages (HifContext *hifctx,
|
||||
RpmOstreeHifInstall *install)
|
||||
RpmOstreeInstall *install)
|
||||
{
|
||||
guint i;
|
||||
g_autoptr(GHashTable) source_to_packages =
|
||||
@ -706,9 +706,9 @@ gather_source_to_packages (HifContext *hifctx,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_rpmostree_libhif_console_download_rpms (HifContext *hifctx,
|
||||
_rpmostree_core_download_rpms (HifContext *hifctx,
|
||||
int target_dfd,
|
||||
RpmOstreeHifInstall *install,
|
||||
RpmOstreeInstall *install,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
@ -800,9 +800,9 @@ import_one_package (OstreeRepo *ostreerepo,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_rpmostree_libhif_console_download_import (HifContext *hifctx,
|
||||
_rpmostree_core_download_import (HifContext *hifctx,
|
||||
OstreeRepo *ostreerepo,
|
||||
RpmOstreeHifInstall *install,
|
||||
RpmOstreeInstall *install,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
@ -992,11 +992,11 @@ set_rpm_macro_define (const char *key, const char *value)
|
||||
}
|
||||
|
||||
gboolean
|
||||
_rpmostree_libhif_console_assemble_commit (HifContext *hifctx,
|
||||
_rpmostree_core_assemble_commit (HifContext *hifctx,
|
||||
int tmpdir_dfd,
|
||||
OstreeRepo *ostreerepo,
|
||||
const char *name,
|
||||
struct RpmOstreeHifInstall *install,
|
||||
struct RpmOstreeInstall *install,
|
||||
char **out_commit,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
122
src/libpriv/rpmostree-core.h
Normal file
122
src/libpriv/rpmostree-core.h
Normal file
@ -0,0 +1,122 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
|
||||
*
|
||||
* Copyright (C) 2015 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 <gio/gio.h>
|
||||
#include <libhif.h>
|
||||
#include <libhif/hif-utils.h>
|
||||
#include <libhif/hif-package.h>
|
||||
#include <ostree.h>
|
||||
|
||||
#include "libglnx.h"
|
||||
|
||||
struct RpmOstreeInstall {
|
||||
GPtrArray *packages_requested;
|
||||
/* Target state */
|
||||
GPtrArray *packages_to_download;
|
||||
guint64 n_bytes_to_fetch;
|
||||
|
||||
/* Current state */
|
||||
guint n_packages_fetched;
|
||||
guint64 n_bytes_fetched;
|
||||
};
|
||||
|
||||
typedef struct RpmOstreeInstall RpmOstreeInstall;
|
||||
|
||||
struct RpmOstreePackageDownloadMetrics {
|
||||
guint64 bytes;
|
||||
};
|
||||
|
||||
typedef struct RpmOstreePackageDownloadMetrics RpmOstreePackageDownloadMetrics;
|
||||
|
||||
HifContext *_rpmostree_core_new_default (void);
|
||||
|
||||
HifContext *_rpmostree_core_new (int rpmmd_cache_dfd,
|
||||
const char *installroot,
|
||||
const char *repos_dir,
|
||||
const char *const *enabled_repos,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _rpmostree_reset_rpm_sighandlers (void);
|
||||
|
||||
void _rpmostree_core_set_cache_dfd (HifContext *hifctx, int dfd);
|
||||
|
||||
rpmts _rpmostree_core_ts_new (HifContext *hifctx);
|
||||
|
||||
gboolean _rpmostree_core_setup (HifContext *context,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _rpmostree_core_repos_disable_all (HifContext *context);
|
||||
|
||||
void _rpmostree_core_set_ostree_repo (HifContext *context);
|
||||
|
||||
void _rpmostree_hif_add_checksum_goal (GChecksum *checksum, HyGoal goal);
|
||||
char * _rpmostree_hif_checksum_goal (GChecksumType type, HyGoal goal);
|
||||
|
||||
char *_rpmostree_get_cache_branch_header (Header hdr);
|
||||
char *_rpmostree_get_cache_branch_pkg (HifPackage *pkg);
|
||||
|
||||
gboolean _rpmostree_core_repos_enable_by_name (HifContext *context,
|
||||
const char *name,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_core_download_metadata (HifContext *context,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
/* This API allocates an install context, use with one of the later ones */
|
||||
gboolean _rpmostree_core_prepare_install (HifContext *context,
|
||||
OstreeRepo *repo,
|
||||
const char *const *packages,
|
||||
struct RpmOstreeInstall *out_install,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_core_download_rpms (HifContext *context,
|
||||
int target_dfd,
|
||||
struct RpmOstreeInstall *install,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_core_download_import (HifContext *context,
|
||||
OstreeRepo *repo,
|
||||
struct RpmOstreeInstall *install,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_core_assemble_commit (HifContext *context,
|
||||
int tmpdir_dfd,
|
||||
OstreeRepo *ostreerepo,
|
||||
const char *name,
|
||||
struct RpmOstreeInstall *install,
|
||||
char **out_commit,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
static inline void
|
||||
_rpmostree_core_install_cleanup (struct RpmOstreeInstall *inst)
|
||||
{
|
||||
g_clear_pointer (&inst->packages_requested, g_ptr_array_unref);
|
||||
g_clear_pointer (&inst->packages_to_download, g_ptr_array_unref);
|
||||
}
|
||||
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(RpmOstreeInstall, _rpmostree_core_install_cleanup)
|
@ -1,122 +0,0 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
|
||||
*
|
||||
* Copyright (C) 2015 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 <gio/gio.h>
|
||||
#include <libhif.h>
|
||||
#include <libhif/hif-utils.h>
|
||||
#include <libhif/hif-package.h>
|
||||
#include <ostree.h>
|
||||
|
||||
#include "libglnx.h"
|
||||
|
||||
struct RpmOstreeHifInstall {
|
||||
GPtrArray *packages_requested;
|
||||
/* Target state */
|
||||
GPtrArray *packages_to_download;
|
||||
guint64 n_bytes_to_fetch;
|
||||
|
||||
/* Current state */
|
||||
guint n_packages_fetched;
|
||||
guint64 n_bytes_fetched;
|
||||
};
|
||||
|
||||
typedef struct RpmOstreeHifInstall RpmOstreeHifInstall;
|
||||
|
||||
struct RpmOstreePackageDownloadMetrics {
|
||||
guint64 bytes;
|
||||
};
|
||||
|
||||
typedef struct RpmOstreePackageDownloadMetrics RpmOstreePackageDownloadMetrics;
|
||||
|
||||
HifContext *_rpmostree_libhif_new_default (void);
|
||||
|
||||
HifContext *_rpmostree_libhif_new (int rpmmd_cache_dfd,
|
||||
const char *installroot,
|
||||
const char *repos_dir,
|
||||
const char *const *enabled_repos,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _rpmostree_reset_rpm_sighandlers (void);
|
||||
|
||||
void _rpmostree_libhif_set_cache_dfd (HifContext *hifctx, int dfd);
|
||||
|
||||
rpmts _rpmostree_libhif_ts_new (HifContext *hifctx);
|
||||
|
||||
gboolean _rpmostree_libhif_setup (HifContext *context,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _rpmostree_libhif_repos_disable_all (HifContext *context);
|
||||
|
||||
void _rpmostree_libhif_set_ostree_repo (HifContext *context);
|
||||
|
||||
void _rpmostree_hif_add_checksum_goal (GChecksum *checksum, HyGoal goal);
|
||||
char * _rpmostree_hif_checksum_goal (GChecksumType type, HyGoal goal);
|
||||
|
||||
char *_rpmostree_get_cache_branch_header (Header hdr);
|
||||
char *_rpmostree_get_cache_branch_pkg (HifPackage *pkg);
|
||||
|
||||
gboolean _rpmostree_libhif_repos_enable_by_name (HifContext *context,
|
||||
const char *name,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_libhif_console_download_metadata (HifContext *context,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
/* This API allocates an install context, use with one of the later ones */
|
||||
gboolean _rpmostree_libhif_console_prepare_install (HifContext *context,
|
||||
OstreeRepo *repo,
|
||||
const char *const *packages,
|
||||
struct RpmOstreeHifInstall *out_install,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_libhif_console_download_rpms (HifContext *context,
|
||||
int target_dfd,
|
||||
struct RpmOstreeHifInstall *install,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_libhif_console_download_import (HifContext *context,
|
||||
OstreeRepo *repo,
|
||||
struct RpmOstreeHifInstall *install,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean _rpmostree_libhif_console_assemble_commit (HifContext *context,
|
||||
int tmpdir_dfd,
|
||||
OstreeRepo *ostreerepo,
|
||||
const char *name,
|
||||
struct RpmOstreeHifInstall *install,
|
||||
char **out_commit,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
static inline void
|
||||
_rpmostree_hif_install_cleanup (struct RpmOstreeHifInstall *hifinst)
|
||||
{
|
||||
g_clear_pointer (&hifinst->packages_requested, g_ptr_array_unref);
|
||||
g_clear_pointer (&hifinst->packages_to_download, g_ptr_array_unref);
|
||||
}
|
||||
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(RpmOstreeHifInstall, _rpmostree_hif_install_cleanup)
|
@ -34,7 +34,7 @@
|
||||
#include <sys/capability.h>
|
||||
#include <gio/gunixinputstream.h>
|
||||
#include "rpmostree-unpacker.h"
|
||||
#include "rpmostree-hif.h"
|
||||
#include "rpmostree-core.h"
|
||||
#include "rpmostree-ostree-libarchive-copynpaste.h"
|
||||
#include <rpm/rpmlib.h>
|
||||
#include <rpm/rpmlog.h>
|
||||
|
Loading…
Reference in New Issue
Block a user