Update for libhif -> libdnf
Still not many PRs outstanding, so it's a good time to take this plunge. Mostly automated via `sed`. Closes: #416 Approved by: Conan-Kudo
This commit is contained in:
parent
c4e98f3f47
commit
39913a2c25
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -2,5 +2,5 @@
|
||||
path = libglnx
|
||||
url = https://git.gnome.org/browse/libglnx
|
||||
[submodule "libhif"]
|
||||
path = libhif
|
||||
path = libdnf
|
||||
url = https://github.com/rpm-software-management/libhif
|
||||
|
@ -35,8 +35,8 @@ librpmostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libp
|
||||
librpmostree_1_la_LDFLAGS = $(AM_LDFLAGS) -version-number 1:0:0 -Bsymbolic-functions
|
||||
librpmostree_1_la_LIBADD = $(PKGDEP_RPMOSTREE_LIBS) librpmostreepriv.la
|
||||
|
||||
# bundled libhif
|
||||
INTROSPECTION_SCANNER_ENV = env LD_LIBRARY_PATH=$(top_builddir)/libhif-build/libhif
|
||||
# bundled libdnf
|
||||
INTROSPECTION_SCANNER_ENV = env LD_LIBRARY_PATH=$(top_builddir)/libdnf-build/libdnf
|
||||
|
||||
if BUILDOPT_INTROSPECTION
|
||||
RpmOstree-1.0.gir: librpmostree-1.la Makefile
|
||||
|
@ -17,18 +17,18 @@
|
||||
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
libhif.so.3:
|
||||
cd libhif-build && $(MAKE)
|
||||
ln -sf libhif-build/libhif/libhif.so.3 .
|
||||
CLEANFILES += libhif.so.3
|
||||
GITIGNOREFILES += libhif-build/
|
||||
libdnf.so.1:
|
||||
cd libdnf-build && $(MAKE)
|
||||
ln -sf libdnf-build/libdnf/libdnf.so.1 .
|
||||
CLEANFILES += libdnf.so.1
|
||||
GITIGNOREFILES += libdnf-build/
|
||||
|
||||
install-libhif-hook:
|
||||
install-libdnf-hook:
|
||||
install -d -m 0755 $(DESTDIR)$(libdir)/rpm-ostree
|
||||
install -m 0755 $$(readlink libhif.so.3) $(DESTDIR)$(libdir)/rpm-ostree
|
||||
INSTALL_DATA_HOOKS += install-libhif-hook
|
||||
install -m 0755 $$(readlink libdnf.so.1) $(DESTDIR)$(libdir)/rpm-ostree
|
||||
INSTALL_DATA_HOOKS += install-libdnf-hook
|
||||
|
||||
clean-local: clean-local-hif
|
||||
.PHONY: clean-local-hif
|
||||
clean-local-hif:
|
||||
cd libhif-build && $(MAKE) clean
|
||||
clean-local: clean-local-dnf
|
||||
.PHONY: clean-local-dnf
|
||||
clean-local-dnf:
|
||||
cd libdnf-build && $(MAKE) clean
|
@ -59,8 +59,8 @@ librpmostreepriv_la_LIBADD = \
|
||||
$(CAP_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
# bundled libhif
|
||||
EXTRA_librpmostreepriv_la_DEPENDENCIES = libhif.so.3
|
||||
# bundled libdnf
|
||||
EXTRA_librpmostreepriv_la_DEPENDENCIES = libdnf.so.1
|
||||
|
||||
gperf_gperf_sources = src/libpriv/rpmostree-script-gperf.gperf
|
||||
BUILT_SOURCES += $(gperf_gperf_sources:-gperf.gperf=-gperf.c)
|
||||
|
@ -10,10 +10,10 @@ AM_TESTS_ENVIRONMENT = \
|
||||
UNINSTALLEDTESTS=1 \
|
||||
$(BASE_TESTS_ENVIRONMENT)
|
||||
|
||||
# we consume libhif as a submodule, but we may not have installed it yet (and we
|
||||
# we consume libdnf as a submodule, but we may not have installed it yet (and we
|
||||
# don't want it to fall back to the system libhif if it's also installed)
|
||||
AM_TESTS_ENVIRONMENT += \
|
||||
LD_LIBRARY_PATH=$(abs_builddir)/libhif-build/libhif \
|
||||
LD_LIBRARY_PATH=$(abs_builddir)/libdnf-build/libdnf \
|
||||
$(NULL)
|
||||
|
||||
CLEANFILES += \
|
||||
|
@ -30,7 +30,7 @@ AM_CPPFLAGS += -DDATADIR='"$(datadir)"' \
|
||||
-DRPM_OSTREE_FEATURES='"$(RPM_OSTREE_FEATURES)"' \
|
||||
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40_
|
||||
AM_CFLAGS += -std=gnu99 $(WARN_CFLAGS)
|
||||
# bundled libhif
|
||||
# bundled libdnf
|
||||
AM_LDFLAGS += "-Wl,-rpath=$(libdir)/rpm-ostree"
|
||||
|
||||
EXTRA_DIST += autogen.sh COPYING
|
||||
@ -53,7 +53,7 @@ TYPELIBS = $(GIRS:.gir=.typelib)
|
||||
include libglnx/Makefile-libglnx.am.inc
|
||||
noinst_LTLIBRARIES += libglnx.la
|
||||
include Makefile-libpriv.am
|
||||
include Makefile-hif.am
|
||||
include Makefile-libdnf.am
|
||||
include Makefile-lib.am
|
||||
include Makefile-daemon.am
|
||||
include Makefile-rpm-ostree.am
|
||||
|
10
configure.ac
10
configure.ac
@ -66,9 +66,9 @@ PKG_CHECK_MODULES(PKGDEP_RPMOSTREE, [gio-unix-2.0 >= 2.40.0 json-glib-1.0
|
||||
libsystemd
|
||||
rpm librepo
|
||||
libarchive])
|
||||
dnl bundled libhif
|
||||
PKGDEP_RPMOSTREE_CFLAGS="-I $(pwd)/libhif -I $(pwd)/libhif-build $PKGDEP_RPMOSTREE_CFLAGS"
|
||||
PKGDEP_RPMOSTREE_LIBS="-L$(pwd)/libhif-build/libhif -lhif $PKGDEP_RPMOSTREE_LIBS"
|
||||
dnl bundled libdnf
|
||||
PKGDEP_RPMOSTREE_CFLAGS="-I $(pwd)/libdnf -I $(pwd)/libdnf-build $PKGDEP_RPMOSTREE_CFLAGS"
|
||||
PKGDEP_RPMOSTREE_LIBS="-L$(pwd)/libdnf-build/libdnf -ldnf $PKGDEP_RPMOSTREE_LIBS"
|
||||
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||
|
||||
@ -127,7 +127,7 @@ fi
|
||||
|
||||
dnl I picked /usr/libexec/rpm-ostree just because we need an
|
||||
dnl arbitrary path - we don't actually install there.
|
||||
(set -euo pipefail; mkdir -p libhif-build && cd libhif-build &&
|
||||
(set -euo pipefail; mkdir -p libdnf-build && cd libdnf-build &&
|
||||
set -x &&
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=/usr/libexec/rpm-ostree \
|
||||
@ -136,7 +136,7 @@ dnl arbitrary path - we don't actually install there.
|
||||
-DSYSCONF_INSTALL_DIR:PATH=/usr/libexec/rpm-ostree/etc \
|
||||
-DSHARE_INSTALL_PREFIX:PATH=/usr/libexec/rpm-ostree/share \
|
||||
-DBUILD_SHARED_LIBS:BOOL=ON \
|
||||
${cmake_args} ../libhif) || exit 1
|
||||
${cmake_args} ../libdnf) || exit 1
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
|
1
libdnf
Submodule
1
libdnf
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 050245b0e7e2449b09d67b508666f8d1a572676f
|
1
libhif
1
libhif
@ -1 +0,0 @@
|
||||
Subproject commit c84818ac9ddf365e5825018a45e13b47ae5aeddf
|
@ -24,7 +24,7 @@
|
||||
#include <glib-unix.h>
|
||||
#include <json-glib/json-glib.h>
|
||||
#include <gio/gunixoutputstream.h>
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
#include <stdio.h>
|
||||
#include <libglnx.h>
|
||||
#include <rpm/rpmmacro.h>
|
||||
@ -159,7 +159,7 @@ compute_checksum_from_treefile_and_goal (RpmOstreeTreeComposeContext *self,
|
||||
/* FIXME; we should also hash the post script */
|
||||
|
||||
/* Hash in each package */
|
||||
rpmostree_hif_add_checksum_goal (checksum, goal);
|
||||
rpmostree_dnf__add_checksum_goal (checksum, goal);
|
||||
|
||||
ret_checksum = g_strdup (g_checksum_get_string (checksum));
|
||||
|
||||
@ -172,7 +172,7 @@ compute_checksum_from_treefile_and_goal (RpmOstreeTreeComposeContext *self,
|
||||
|
||||
|
||||
static void
|
||||
on_hifstate_percentage_changed (HifState *hifstate,
|
||||
on_hifstate_percentage_changed (DnfState *hifstate,
|
||||
guint percentage,
|
||||
gpointer user_data)
|
||||
{
|
||||
@ -225,7 +225,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
guint progress_sigid;
|
||||
GFile *contextdir = self->treefile_context_dirs->pdata[0];
|
||||
g_autoptr(RpmOstreeInstall) hifinstall = { 0, };
|
||||
HifContext *hifctx;
|
||||
DnfContext *hifctx;
|
||||
g_autofree char *ret_new_inputhash = NULL;
|
||||
g_autoptr(GKeyFile) treespec = g_key_file_new ();
|
||||
JsonArray *enable_repos = NULL;
|
||||
@ -246,7 +246,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
|
||||
hifctx = rpmostree_context_get_hif (ctx);
|
||||
if (opt_proxy)
|
||||
hif_context_set_http_proxy (hifctx, opt_proxy);
|
||||
dnf_context_set_http_proxy (hifctx, opt_proxy);
|
||||
|
||||
/* Hack this here... see https://github.com/rpm-software-management/libhif/issues/53
|
||||
* but in the future we won't be using librpm at all for unpack/scripts, so it won't
|
||||
@ -255,15 +255,15 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
{ const char *debuglevel = getenv ("RPMOSTREE_RPM_VERBOSITY");
|
||||
if (!debuglevel)
|
||||
debuglevel = "info";
|
||||
hif_context_set_rpm_verbosity (hifctx, debuglevel);
|
||||
dnf_context_set_rpm_verbosity (hifctx, debuglevel);
|
||||
rpmlogSetFile(NULL);
|
||||
}
|
||||
|
||||
hif_context_set_repo_dir (hifctx, gs_file_get_path_cached (contextdir));
|
||||
dnf_context_set_repo_dir (hifctx, gs_file_get_path_cached (contextdir));
|
||||
|
||||
/* By default, retain packages in addition to metadata with --cachedir */
|
||||
if (opt_cachedir)
|
||||
hif_context_set_keep_cache (hifctx, TRUE);
|
||||
dnf_context_set_keep_cache (hifctx, TRUE);
|
||||
|
||||
g_key_file_set_string (treespec, "tree", "ref", self->ref);
|
||||
g_key_file_set_string_list (treespec, "tree", "packages", (const char *const*)packages, g_strv_length (packages));
|
||||
@ -326,7 +326,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
add_files = json_object_get_array_member (treedata, "add-files");
|
||||
|
||||
/* FIXME - just do a depsolve here before we compute download requirements */
|
||||
if (!compute_checksum_from_treefile_and_goal (self, hif_context_get_goal (hifctx),
|
||||
if (!compute_checksum_from_treefile_and_goal (self, dnf_context_get_goal (hifctx),
|
||||
contextdir, add_files,
|
||||
&ret_new_inputhash, error))
|
||||
goto out;
|
||||
@ -368,7 +368,7 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
goto out;
|
||||
|
||||
{ g_auto(GLnxConsoleRef) console = { 0, };
|
||||
glnx_unref_object HifState *hifstate = hif_state_new ();
|
||||
glnx_unref_object DnfState *hifstate = dnf_state_new ();
|
||||
|
||||
progress_sigid = g_signal_connect (hifstate, "percentage-changed",
|
||||
G_CALLBACK (on_hifstate_percentage_changed),
|
||||
@ -376,8 +376,8 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self,
|
||||
|
||||
glnx_console_lock (&console);
|
||||
|
||||
if (!hif_transaction_commit (hif_context_get_transaction (hifctx),
|
||||
hif_context_get_goal (hifctx),
|
||||
if (!dnf_transaction_commit (dnf_context_get_transaction (hifctx),
|
||||
dnf_context_get_goal (hifctx),
|
||||
hifstate,
|
||||
error))
|
||||
goto out;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <string.h>
|
||||
#include <glib-unix.h>
|
||||
#include <gio/gunixoutputstream.h>
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
#include <rpm/rpmts.h>
|
||||
#include <stdio.h>
|
||||
#include <libglnx.h>
|
||||
|
@ -1080,7 +1080,7 @@ overlay_final_pkgset (RpmOstreeSysrootUpgrader *self,
|
||||
ctx = rpmostree_context_new_system (cancellable, error);
|
||||
|
||||
/* point libhif to the yum.repos.d and os-release of the merge_deployment */
|
||||
{ HifContext *hifctx = rpmostree_context_get_hif (ctx);
|
||||
{ DnfContext *hifctx = rpmostree_context_get_hif (ctx);
|
||||
g_autofree char *sysroot_path =
|
||||
g_file_get_path (ostree_sysroot_get_path (self->sysroot));
|
||||
g_autofree char *merge_deployment_dirpath =
|
||||
@ -1090,8 +1090,8 @@ overlay_final_pkgset (RpmOstreeSysrootUpgrader *self,
|
||||
g_build_filename (sysroot_path, merge_deployment_dirpath, NULL);
|
||||
g_autofree char *reposdir = g_build_filename (merge_deployment_root,
|
||||
"etc/yum.repos.d", NULL);
|
||||
hif_context_set_repo_dir (hifctx, reposdir);
|
||||
hif_context_set_source_root (hifctx, merge_deployment_root);
|
||||
dnf_context_set_repo_dir (hifctx, reposdir);
|
||||
dnf_context_set_source_root (hifctx, merge_deployment_root);
|
||||
}
|
||||
|
||||
/* load the sepolicy to use during import */
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <rpm/rpmlib.h>
|
||||
#include <rpm/rpmlog.h>
|
||||
#include <rpm/rpmdb.h>
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
#include <libgsystem.h>
|
||||
|
||||
#include "rpmostreed-transaction-types.h"
|
||||
|
@ -53,7 +53,7 @@ query_all_packages_in_sack (RpmOstreeRefSack *rsack)
|
||||
c = pkglist->len;
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
HifPackage *pkg = pkglist->pdata[i];
|
||||
DnfPackage *pkg = pkglist->pdata[i];
|
||||
g_ptr_array_add (result, _rpm_ostree_package_new (rsack, pkg));
|
||||
}
|
||||
|
||||
@ -159,15 +159,15 @@ rpm_ostree_db_diff (OstreeRepo *repo,
|
||||
|
||||
for (i = 0; i < new_pkglist->len; i++)
|
||||
{
|
||||
HifPackage *pkg = new_pkglist->pdata[i];
|
||||
DnfPackage *pkg = new_pkglist->pdata[i];
|
||||
HyQuery query = NULL;
|
||||
g_autoptr(GPtrArray) pkglist = NULL;
|
||||
guint count;
|
||||
HifPackage *oldpkg;
|
||||
DnfPackage *oldpkg;
|
||||
|
||||
query = hy_query_create (orig_sack->sack);
|
||||
hy_query_filter (query, HY_PKG_NAME, HY_EQ, hif_package_get_name (pkg));
|
||||
hy_query_filter (query, HY_PKG_EVR, HY_NEQ, hif_package_get_evr (pkg));
|
||||
hy_query_filter (query, HY_PKG_NAME, HY_EQ, dnf_package_get_name (pkg));
|
||||
hy_query_filter (query, HY_PKG_EVR, HY_NEQ, dnf_package_get_evr (pkg));
|
||||
hy_query_filter (query, HY_PKG_REPONAME, HY_EQ, HY_SYSTEM_REPO_NAME);
|
||||
pkglist = hy_query_run (query);
|
||||
|
||||
@ -184,12 +184,12 @@ rpm_ostree_db_diff (OstreeRepo *repo,
|
||||
|
||||
for (i = 0; i < orig_pkglist->len; i++)
|
||||
{
|
||||
HifPackage *pkg = orig_pkglist->pdata[i];
|
||||
DnfPackage *pkg = orig_pkglist->pdata[i];
|
||||
HyQuery query = NULL;
|
||||
g_autoptr(GPtrArray) pkglist = NULL;
|
||||
|
||||
query = hy_query_create (new_sack->sack);
|
||||
hy_query_filter (query, HY_PKG_NAME, HY_EQ, hif_package_get_name (pkg));
|
||||
hy_query_filter (query, HY_PKG_NAME, HY_EQ, dnf_package_get_name (pkg));
|
||||
hy_query_filter (query, HY_PKG_REPONAME, HY_EQ, HY_SYSTEM_REPO_NAME);
|
||||
pkglist = hy_query_run (query);
|
||||
|
||||
@ -200,12 +200,12 @@ rpm_ostree_db_diff (OstreeRepo *repo,
|
||||
|
||||
for (i = 0; i < new_pkglist->len; i++)
|
||||
{
|
||||
HifPackage *pkg = new_pkglist->pdata[i];
|
||||
DnfPackage *pkg = new_pkglist->pdata[i];
|
||||
HyQuery query = NULL;
|
||||
g_autoptr(GPtrArray) pkglist = NULL;
|
||||
|
||||
query = hy_query_create (orig_sack->sack);
|
||||
hy_query_filter (query, HY_PKG_NAME, HY_EQ, hif_package_get_name (pkg));
|
||||
hy_query_filter (query, HY_PKG_NAME, HY_EQ, dnf_package_get_name (pkg));
|
||||
hy_query_filter (query, HY_PKG_REPONAME, HY_EQ, HY_SYSTEM_REPO_NAME);
|
||||
pkglist = hy_query_run (query);
|
||||
|
||||
|
@ -24,5 +24,5 @@
|
||||
#include "rpmostree-package.h"
|
||||
#include "rpmostree-refsack.h"
|
||||
|
||||
RpmOstreePackage * _rpm_ostree_package_new (RpmOstreeRefSack *rsack, HifPackage *hypkg);
|
||||
RpmOstreePackage * _rpm_ostree_package_new (RpmOstreeRefSack *rsack, DnfPackage *hypkg);
|
||||
|
||||
|
@ -41,7 +41,7 @@ struct RpmOstreePackage
|
||||
{
|
||||
GObject parent_instance;
|
||||
RpmOstreeRefSack *sack;
|
||||
HifPackage *hypkg;
|
||||
DnfPackage *hypkg;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(RpmOstreePackage, rpm_ostree_package, G_TYPE_OBJECT)
|
||||
@ -82,7 +82,7 @@ rpm_ostree_package_init (RpmOstreePackage *p)
|
||||
const char *
|
||||
rpm_ostree_package_get_nevra (RpmOstreePackage *p)
|
||||
{
|
||||
return hif_package_get_nevra (p->hypkg);
|
||||
return dnf_package_get_nevra (p->hypkg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,7 +94,7 @@ rpm_ostree_package_get_nevra (RpmOstreePackage *p)
|
||||
const char *
|
||||
rpm_ostree_package_get_name (RpmOstreePackage *p)
|
||||
{
|
||||
return hif_package_get_name (p->hypkg);
|
||||
return dnf_package_get_name (p->hypkg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,7 +106,7 @@ rpm_ostree_package_get_name (RpmOstreePackage *p)
|
||||
const char *
|
||||
rpm_ostree_package_get_evr (RpmOstreePackage *p)
|
||||
{
|
||||
return hif_package_get_evr (p->hypkg);
|
||||
return dnf_package_get_evr (p->hypkg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,7 +118,7 @@ rpm_ostree_package_get_evr (RpmOstreePackage *p)
|
||||
const char *
|
||||
rpm_ostree_package_get_arch (RpmOstreePackage *p)
|
||||
{
|
||||
return hif_package_get_arch (p->hypkg);
|
||||
return dnf_package_get_arch (p->hypkg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -156,7 +156,7 @@ rpm_ostree_package_cmp (RpmOstreePackage *p1, RpmOstreePackage *p2)
|
||||
|
||||
/* This assumes both pools (if they are different)
|
||||
* have identical configuration for epoch handling. */
|
||||
ret = hif_sack_evr_cmp (p1->sack->sack, str1, str2);
|
||||
ret = dnf_sack_evr_cmp (p1->sack->sack, str1, str2);
|
||||
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
@ -167,7 +167,7 @@ rpm_ostree_package_cmp (RpmOstreePackage *p1, RpmOstreePackage *p2)
|
||||
}
|
||||
|
||||
RpmOstreePackage *
|
||||
_rpm_ostree_package_new (RpmOstreeRefSack *rsack, HifPackage *hypkg)
|
||||
_rpm_ostree_package_new (RpmOstreeRefSack *rsack, DnfPackage *hypkg)
|
||||
{
|
||||
RpmOstreePackage *p = g_object_new (RPM_OSTREE_TYPE_PACKAGE, NULL);
|
||||
p->sack = rpmostree_refsack_ref (rsack);
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <rpm/rpmmacro.h>
|
||||
#include <rpm/rpmts.h>
|
||||
#include <gio/gunixoutputstream.h>
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
#include <librepo/librepo.h>
|
||||
|
||||
#include "rpmostree-core.h"
|
||||
@ -277,7 +277,7 @@ struct _RpmOstreeContext {
|
||||
GObject parent;
|
||||
|
||||
RpmOstreeTreespec *spec;
|
||||
HifContext *hifctx;
|
||||
DnfContext *hifctx;
|
||||
GHashTable *ignore_scripts;
|
||||
OstreeRepo *ostreerepo;
|
||||
gboolean unprivileged;
|
||||
@ -344,21 +344,21 @@ rpmostree_context_new_system (GCancellable *cancellable,
|
||||
rpmsqSetInterruptSafety (FALSE);
|
||||
#endif
|
||||
|
||||
self->hifctx = hif_context_new ();
|
||||
self->hifctx = dnf_context_new ();
|
||||
_rpmostree_reset_rpm_sighandlers ();
|
||||
hif_context_set_http_proxy (self->hifctx, g_getenv ("http_proxy"));
|
||||
dnf_context_set_http_proxy (self->hifctx, g_getenv ("http_proxy"));
|
||||
|
||||
hif_context_set_repo_dir (self->hifctx, "/etc/yum.repos.d");
|
||||
dnf_context_set_repo_dir (self->hifctx, "/etc/yum.repos.d");
|
||||
/* Operating on stale metadata is too annoying */
|
||||
hif_context_set_cache_age (self->hifctx, 0);
|
||||
hif_context_set_cache_dir (self->hifctx, "/var/cache/rpm-ostree/" RPMOSTREE_DIR_CACHE_REPOMD);
|
||||
hif_context_set_solv_dir (self->hifctx, "/var/cache/rpm-ostree/" RPMOSTREE_DIR_CACHE_SOLV);
|
||||
hif_context_set_lock_dir (self->hifctx, "/run/rpm-ostree/" RPMOSTREE_DIR_LOCK);
|
||||
hif_context_set_user_agent (self->hifctx, PACKAGE_NAME "/" PACKAGE_VERSION);
|
||||
dnf_context_set_cache_age (self->hifctx, 0);
|
||||
dnf_context_set_cache_dir (self->hifctx, "/var/cache/rpm-ostree/" RPMOSTREE_DIR_CACHE_REPOMD);
|
||||
dnf_context_set_solv_dir (self->hifctx, "/var/cache/rpm-ostree/" RPMOSTREE_DIR_CACHE_SOLV);
|
||||
dnf_context_set_lock_dir (self->hifctx, "/run/rpm-ostree/" RPMOSTREE_DIR_LOCK);
|
||||
dnf_context_set_user_agent (self->hifctx, PACKAGE_NAME "/" PACKAGE_VERSION);
|
||||
|
||||
hif_context_set_check_disk_space (self->hifctx, FALSE);
|
||||
hif_context_set_check_transaction (self->hifctx, FALSE);
|
||||
hif_context_set_yumdb_enabled (self->hifctx, FALSE);
|
||||
dnf_context_set_check_disk_space (self->hifctx, FALSE);
|
||||
dnf_context_set_check_transaction (self->hifctx, FALSE);
|
||||
dnf_context_set_yumdb_enabled (self->hifctx, FALSE);
|
||||
|
||||
return self;
|
||||
}
|
||||
@ -378,19 +378,19 @@ rpmostree_context_new_internal (int userroot_dfd,
|
||||
ret->unprivileged = unprivileged;
|
||||
|
||||
{ g_autofree char *reposdir = glnx_fdrel_abspath (userroot_dfd, "rpmmd.repos.d");
|
||||
hif_context_set_repo_dir (ret->hifctx, reposdir);
|
||||
dnf_context_set_repo_dir (ret->hifctx, reposdir);
|
||||
}
|
||||
{ const char *cache_rpmmd = glnx_strjoina ("cache/", RPMOSTREE_DIR_CACHE_REPOMD);
|
||||
g_autofree char *cachedir = glnx_fdrel_abspath (userroot_dfd, cache_rpmmd);
|
||||
hif_context_set_cache_dir (ret->hifctx, cachedir);
|
||||
dnf_context_set_cache_dir (ret->hifctx, cachedir);
|
||||
}
|
||||
{ const char *cache_solv = glnx_strjoina ("cache/", RPMOSTREE_DIR_CACHE_SOLV);
|
||||
g_autofree char *cachedir = glnx_fdrel_abspath (userroot_dfd, cache_solv);
|
||||
hif_context_set_solv_dir (ret->hifctx, cachedir);
|
||||
dnf_context_set_solv_dir (ret->hifctx, cachedir);
|
||||
}
|
||||
{ const char *lock = glnx_strjoina ("cache/", RPMOSTREE_DIR_LOCK);
|
||||
g_autofree char *cachedir = glnx_fdrel_abspath (userroot_dfd, lock);
|
||||
hif_context_set_lock_dir (ret->hifctx, lock);
|
||||
dnf_context_set_lock_dir (ret->hifctx, lock);
|
||||
}
|
||||
|
||||
if (fstatat (userroot_dfd, "repo", &stbuf, 0) < 0)
|
||||
@ -462,7 +462,7 @@ rpmostree_context_set_ignore_scripts (RpmOstreeContext *self,
|
||||
self->ignore_scripts = g_hash_table_ref (ignore_scripts);
|
||||
}
|
||||
|
||||
HifContext *
|
||||
DnfContext *
|
||||
rpmostree_context_get_hif (RpmOstreeContext *self)
|
||||
{
|
||||
return self->hifctx;
|
||||
@ -473,7 +473,7 @@ rpmostree_context_get_varsubsts (RpmOstreeContext *context)
|
||||
{
|
||||
GHashTable *r = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
|
||||
|
||||
g_hash_table_insert (r, g_strdup ("basearch"), g_strdup (hif_context_get_base_arch (context->hifctx)));
|
||||
g_hash_table_insert (r, g_strdup ("basearch"), g_strdup (dnf_context_get_base_arch (context->hifctx)));
|
||||
|
||||
return r;
|
||||
}
|
||||
@ -483,9 +483,9 @@ require_enabled_repos (GPtrArray *sources)
|
||||
{
|
||||
for (guint i = 0; i < sources->len; i++)
|
||||
{
|
||||
HifRepo *src = sources->pdata[i];
|
||||
if (hif_repo_get_enabled (src) != HIF_REPO_ENABLED_NONE)
|
||||
hif_repo_set_required (src, TRUE);
|
||||
DnfRepo *src = sources->pdata[i];
|
||||
if (dnf_repo_get_enabled (src) != DNF_REPO_ENABLED_NONE)
|
||||
dnf_repo_set_required (src, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -499,13 +499,13 @@ enable_one_repo (GPtrArray *sources,
|
||||
|
||||
for (guint i = 0; i < sources->len; i++)
|
||||
{
|
||||
HifRepo *src = sources->pdata[i];
|
||||
const char *id = hif_repo_get_id (src);
|
||||
DnfRepo *src = sources->pdata[i];
|
||||
const char *id = dnf_repo_get_id (src);
|
||||
|
||||
if (strcmp (reponame, id) != 0)
|
||||
continue;
|
||||
|
||||
hif_repo_set_enabled (src, HIF_REPO_ENABLED_PACKAGES);
|
||||
dnf_repo_set_enabled (src, DNF_REPO_ENABLED_PACKAGES);
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
@ -532,11 +532,11 @@ context_repos_enable_only (RpmOstreeContext *context,
|
||||
const char *const *iter;
|
||||
GPtrArray *sources;
|
||||
|
||||
sources = hif_context_get_repos (context->hifctx);
|
||||
sources = dnf_context_get_repos (context->hifctx);
|
||||
for (i = 0; i < sources->len; i++)
|
||||
{
|
||||
HifRepo *src = sources->pdata[i];
|
||||
hif_repo_set_enabled (src, HIF_REPO_ENABLED_NONE);
|
||||
DnfRepo *src = sources->pdata[i];
|
||||
dnf_repo_set_enabled (src, DNF_REPO_ENABLED_NONE);
|
||||
}
|
||||
|
||||
for (iter = enabled_repos; iter && *iter; iter++)
|
||||
@ -564,7 +564,7 @@ rpmostree_context_setup (RpmOstreeContext *self,
|
||||
char **instlangs = NULL;
|
||||
|
||||
if (install_root)
|
||||
hif_context_set_install_root (self->hifctx, install_root);
|
||||
dnf_context_set_install_root (self->hifctx, install_root);
|
||||
else
|
||||
{
|
||||
glnx_fd_close int dfd = -1; /* Auto close, we just use the path */
|
||||
@ -572,13 +572,13 @@ rpmostree_context_setup (RpmOstreeContext *self,
|
||||
&self->dummy_instroot_path,
|
||||
&dfd, error))
|
||||
goto out;
|
||||
hif_context_set_install_root (self->hifctx, self->dummy_instroot_path);
|
||||
dnf_context_set_install_root (self->hifctx, self->dummy_instroot_path);
|
||||
}
|
||||
|
||||
if (source_root)
|
||||
hif_context_set_source_root (self->hifctx, source_root);
|
||||
dnf_context_set_source_root (self->hifctx, source_root);
|
||||
|
||||
if (!hif_context_setup (self->hifctx, cancellable, error))
|
||||
if (!dnf_context_setup (self->hifctx, cancellable, error))
|
||||
goto out;
|
||||
|
||||
/* This is what we use as default. */
|
||||
@ -591,7 +591,7 @@ rpmostree_context_setup (RpmOstreeContext *self,
|
||||
if (!context_repos_enable_only (self, (const char *const*)enabled_repos, error))
|
||||
goto out;
|
||||
|
||||
repos = hif_context_get_repos (self->hifctx);
|
||||
repos = dnf_context_get_repos (self->hifctx);
|
||||
if (repos->len == 0)
|
||||
{
|
||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
@ -617,7 +617,7 @@ rpmostree_context_setup (RpmOstreeContext *self,
|
||||
g_string_append (opt, v);
|
||||
}
|
||||
|
||||
hif_context_set_rpm_macro (self->hifctx, "_install_langs", opt->str);
|
||||
dnf_context_set_rpm_macro (self->hifctx, "_install_langs", opt->str);
|
||||
g_string_free (opt, TRUE);
|
||||
}
|
||||
|
||||
@ -626,8 +626,8 @@ rpmostree_context_setup (RpmOstreeContext *self,
|
||||
g_variant_dict_lookup (self->spec->dict, "documentation", "b", &docs);
|
||||
|
||||
if (!docs)
|
||||
hif_transaction_set_flags (hif_context_get_transaction (self->hifctx),
|
||||
HIF_TRANSACTION_FLAG_NODOCS);
|
||||
dnf_transaction_set_flags (dnf_context_get_transaction (self->hifctx),
|
||||
DNF_TRANSACTION_FLAG_NODOCS);
|
||||
}
|
||||
|
||||
{ const char *const *ignore_scripts = NULL;
|
||||
@ -648,7 +648,7 @@ rpmostree_context_setup (RpmOstreeContext *self,
|
||||
|
||||
|
||||
static void
|
||||
on_hifstate_percentage_changed (HifState *hifstate,
|
||||
on_hifstate_percentage_changed (DnfState *hifstate,
|
||||
guint percentage,
|
||||
gpointer user_data)
|
||||
{
|
||||
@ -663,13 +663,13 @@ rpmostree_context_download_metadata (RpmOstreeContext *self,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
guint progress_sigid;
|
||||
glnx_unref_object HifState *hifstate = hif_state_new ();
|
||||
glnx_unref_object DnfState *hifstate = dnf_state_new ();
|
||||
|
||||
progress_sigid = g_signal_connect (hifstate, "percentage-changed",
|
||||
G_CALLBACK (on_hifstate_percentage_changed),
|
||||
"Downloading metadata:");
|
||||
|
||||
if (!hif_context_setup_sack (self->hifctx, hifstate, error))
|
||||
if (!dnf_context_setup_sack (self->hifctx, hifstate, error))
|
||||
goto out;
|
||||
|
||||
g_signal_handler_disconnect (hifstate, progress_sigid);
|
||||
@ -733,19 +733,19 @@ rpmostree_get_cache_branch_header (Header hdr)
|
||||
}
|
||||
|
||||
char *
|
||||
rpmostree_get_cache_branch_pkg (HifPackage *pkg)
|
||||
rpmostree_get_cache_branch_pkg (DnfPackage *pkg)
|
||||
{
|
||||
return cache_branch_for_n_evr_a (hif_package_get_name (pkg),
|
||||
hif_package_get_evr (pkg),
|
||||
hif_package_get_arch (pkg));
|
||||
return cache_branch_for_n_evr_a (dnf_package_get_name (pkg),
|
||||
dnf_package_get_evr (pkg),
|
||||
dnf_package_get_arch (pkg));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pkg_is_local (HifPackage *pkg)
|
||||
pkg_is_local (DnfPackage *pkg)
|
||||
{
|
||||
HifRepo *src = hif_package_get_repo (pkg);
|
||||
return (hif_repo_is_local (src) ||
|
||||
g_strcmp0 (hif_package_get_reponame (pkg), HY_CMDLINE_REPO_NAME) == 0);
|
||||
DnfRepo *src = dnf_package_get_repo (pkg);
|
||||
return (dnf_repo_is_local (src) ||
|
||||
g_strcmp0 (dnf_package_get_reponame (pkg), HY_CMDLINE_REPO_NAME) == 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -816,7 +816,7 @@ out:
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pkg_is_cached (HifPackage *pkg)
|
||||
pkg_is_cached (DnfPackage *pkg)
|
||||
{
|
||||
if (pkg_is_local (pkg))
|
||||
return TRUE;
|
||||
@ -828,12 +828,12 @@ pkg_is_cached (HifPackage *pkg)
|
||||
* that - which is what happens with the ostree commits
|
||||
* above.
|
||||
*/
|
||||
return g_file_test (hif_package_get_filename (pkg), G_FILE_TEST_EXISTS);
|
||||
return g_file_test (dnf_package_get_filename (pkg), G_FILE_TEST_EXISTS);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
find_pkg_in_ostree (OstreeRepo *repo,
|
||||
HifPackage *pkg,
|
||||
DnfPackage *pkg,
|
||||
OstreeSePolicy *sepolicy,
|
||||
gboolean *out_in_ostree,
|
||||
gboolean *out_selinux_match,
|
||||
@ -878,7 +878,7 @@ out:
|
||||
/* determine of all the marked packages, which ones we'll need to download,
|
||||
* which ones we'll need to import, and which ones we'll need to relabel */
|
||||
static gboolean
|
||||
sort_packages (HifContext *hifctx,
|
||||
sort_packages (DnfContext *hifctx,
|
||||
OstreeRepo *ostreerepo,
|
||||
OstreeSePolicy *sepolicy,
|
||||
RpmOstreeInstall *install,
|
||||
@ -886,7 +886,7 @@ sort_packages (HifContext *hifctx,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
g_autoptr(GPtrArray) packages = NULL;
|
||||
GPtrArray *sources = hif_context_get_repos (hifctx);
|
||||
GPtrArray *sources = dnf_context_get_repos (hifctx);
|
||||
|
||||
g_clear_pointer (&install->packages_to_download, g_ptr_array_unref);
|
||||
install->packages_to_download
|
||||
@ -900,24 +900,24 @@ sort_packages (HifContext *hifctx,
|
||||
install->packages_to_relabel
|
||||
= g_ptr_array_new_with_free_func ((GDestroyNotify)g_object_unref);
|
||||
|
||||
packages = hif_goal_get_packages (hif_context_get_goal (hifctx),
|
||||
HIF_PACKAGE_INFO_INSTALL,
|
||||
HIF_PACKAGE_INFO_REINSTALL,
|
||||
HIF_PACKAGE_INFO_DOWNGRADE,
|
||||
HIF_PACKAGE_INFO_UPDATE,
|
||||
packages = dnf_goal_get_packages (dnf_context_get_goal (hifctx),
|
||||
DNF_PACKAGE_INFO_INSTALL,
|
||||
DNF_PACKAGE_INFO_REINSTALL,
|
||||
DNF_PACKAGE_INFO_DOWNGRADE,
|
||||
DNF_PACKAGE_INFO_UPDATE,
|
||||
-1);
|
||||
|
||||
for (guint i = 0; i < packages->len; i++)
|
||||
{
|
||||
HifPackage *pkg = packages->pdata[i];
|
||||
HifRepo *src = NULL;
|
||||
DnfPackage *pkg = packages->pdata[i];
|
||||
DnfRepo *src = NULL;
|
||||
|
||||
/* Hackily look up the source...we need a hash table */
|
||||
for (guint j = 0; j < sources->len; j++)
|
||||
{
|
||||
HifRepo *tmpsrc = sources->pdata[j];
|
||||
if (g_strcmp0 (hif_package_get_reponame (pkg),
|
||||
hif_repo_get_id (tmpsrc)) == 0)
|
||||
DnfRepo *tmpsrc = sources->pdata[j];
|
||||
if (g_strcmp0 (dnf_package_get_reponame (pkg),
|
||||
dnf_repo_get_id (tmpsrc)) == 0)
|
||||
{
|
||||
src = tmpsrc;
|
||||
break;
|
||||
@ -925,7 +925,7 @@ sort_packages (HifContext *hifctx,
|
||||
}
|
||||
|
||||
g_assert (src);
|
||||
hif_package_set_repo (pkg, src);
|
||||
dnf_package_set_repo (pkg, src);
|
||||
|
||||
/* NB: We're assuming here that the presence of an ostree repo means that
|
||||
* the user intends to import the pkg vs e.g. installing it like during a
|
||||
@ -967,7 +967,7 @@ rpmostree_context_prepare_install (RpmOstreeContext *self,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
HifContext *hifctx = self->hifctx;
|
||||
DnfContext *hifctx = self->hifctx;
|
||||
char **pkgnames = NULL;
|
||||
g_autoptr(RpmOstreeInstall) ret_install = g_object_new (RPMOSTREE_TYPE_INSTALL, NULL);
|
||||
|
||||
@ -979,7 +979,7 @@ rpmostree_context_prepare_install (RpmOstreeContext *self,
|
||||
for (; strviter && *strviter; strviter++)
|
||||
{
|
||||
const char *pkgname = *strviter;
|
||||
if (!hif_context_install (hifctx, pkgname, error))
|
||||
if (!dnf_context_install (hifctx, pkgname, error))
|
||||
goto out;
|
||||
g_ptr_array_add (ret_install->packages_requested, g_strdup (pkgname));
|
||||
}
|
||||
@ -987,7 +987,7 @@ rpmostree_context_prepare_install (RpmOstreeContext *self,
|
||||
|
||||
rpmostree_output_task_begin ("Resolving dependencies");
|
||||
|
||||
if (!hif_goal_depsolve (hif_context_get_goal (hifctx), HIF_INSTALL, error))
|
||||
if (!dnf_goal_depsolve (dnf_context_get_goal (hifctx), DNF_INSTALL, error))
|
||||
{
|
||||
g_print ("failed\n");
|
||||
goto out;
|
||||
@ -1023,7 +1023,7 @@ ptrarray_sort_compare_strings (gconstpointer ap,
|
||||
* previous one.
|
||||
*/
|
||||
void
|
||||
rpmostree_hif_add_checksum_goal (GChecksum *checksum,
|
||||
rpmostree_dnf__add_checksum_goal (GChecksum *checksum,
|
||||
HyGoal goal)
|
||||
{
|
||||
g_autoptr(GPtrArray) pkglist = NULL;
|
||||
@ -1034,9 +1034,9 @@ rpmostree_hif_add_checksum_goal (GChecksum *checksum,
|
||||
g_assert (pkglist);
|
||||
for (i = 0; i < pkglist->len; i++)
|
||||
{
|
||||
HifPackage *pkg = pkglist->pdata[i];
|
||||
DnfPackage *pkg = pkglist->pdata[i];
|
||||
int pkg_checksum_type;
|
||||
const unsigned char *pkg_checksum_bytes = hif_package_get_chksum (pkg, &pkg_checksum_type);
|
||||
const unsigned char *pkg_checksum_bytes = dnf_package_get_chksum (pkg, &pkg_checksum_type);
|
||||
g_autofree char *pkg_checksum = hy_chksum_str (pkg_checksum_bytes, pkg_checksum_type);
|
||||
char *pkg_checksum_with_type = g_strconcat (hy_chksum_name (pkg_checksum_type), ":", pkg_checksum, NULL);
|
||||
|
||||
@ -1059,12 +1059,12 @@ rpmostree_context_get_state_sha512 (RpmOstreeContext *self)
|
||||
g_checksum_update (state_checksum, g_variant_get_data (self->spec->spec),
|
||||
g_variant_get_size (self->spec->spec));
|
||||
|
||||
rpmostree_hif_add_checksum_goal (state_checksum, hif_context_get_goal (self->hifctx));
|
||||
rpmostree_dnf__add_checksum_goal (state_checksum, dnf_context_get_goal (self->hifctx));
|
||||
return g_strdup (g_checksum_get_string (state_checksum));
|
||||
}
|
||||
|
||||
static GHashTable *
|
||||
gather_source_to_packages (HifContext *hifctx,
|
||||
gather_source_to_packages (DnfContext *hifctx,
|
||||
RpmOstreeInstall *install)
|
||||
{
|
||||
guint i;
|
||||
@ -1073,8 +1073,8 @@ gather_source_to_packages (HifContext *hifctx,
|
||||
|
||||
for (i = 0; i < install->packages_to_download->len; i++)
|
||||
{
|
||||
HifPackage *pkg = install->packages_to_download->pdata[i];
|
||||
HifRepo *src = hif_package_get_repo (pkg);
|
||||
DnfPackage *pkg = install->packages_to_download->pdata[i];
|
||||
DnfRepo *src = dnf_package_get_repo (pkg);
|
||||
GPtrArray *source_packages;
|
||||
|
||||
g_assert (src);
|
||||
@ -1098,12 +1098,12 @@ rpmostree_context_download (RpmOstreeContext *ctx,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
HifContext *hifctx = ctx->hifctx;
|
||||
DnfContext *hifctx = ctx->hifctx;
|
||||
int n = install->packages_to_download->len;
|
||||
|
||||
if (n > 0)
|
||||
{
|
||||
guint64 size = hif_package_array_get_download_size (install->packages_to_download);
|
||||
guint64 size = dnf_package_array_get_download_size (install->packages_to_download);
|
||||
g_autofree char *sizestr = g_format_size (size);
|
||||
g_print ("Will download: %u package%s (%s)\n", n, n > 1 ? "s" : "", sizestr);
|
||||
}
|
||||
@ -1119,22 +1119,22 @@ rpmostree_context_download (RpmOstreeContext *ctx,
|
||||
while (g_hash_table_iter_next (&hiter, &key, &value))
|
||||
{
|
||||
g_autofree char *target_dir = NULL;
|
||||
HifRepo *src = key;
|
||||
DnfRepo *src = key;
|
||||
GPtrArray *src_packages = value;
|
||||
glnx_unref_object HifState *hifstate = hif_state_new ();
|
||||
glnx_unref_object DnfState *hifstate = dnf_state_new ();
|
||||
|
||||
g_autofree char *prefix
|
||||
= g_strdup_printf (" Downloading from %s:", hif_repo_get_id (src));
|
||||
= g_strdup_printf (" Downloading from %s:", dnf_repo_get_id (src));
|
||||
|
||||
progress_sigid = g_signal_connect (hifstate, "percentage-changed",
|
||||
G_CALLBACK (on_hifstate_percentage_changed),
|
||||
prefix);
|
||||
|
||||
target_dir = g_build_filename (hif_repo_get_location (src), "/packages/", NULL);
|
||||
target_dir = g_build_filename (dnf_repo_get_location (src), "/packages/", NULL);
|
||||
if (!glnx_shutil_mkdir_p_at (AT_FDCWD, target_dir, 0755, cancellable, error))
|
||||
goto out;
|
||||
|
||||
if (!hif_repo_download_packages (src, src_packages, target_dir,
|
||||
if (!dnf_repo_download_packages (src, src_packages, target_dir,
|
||||
hifstate, error))
|
||||
goto out;
|
||||
|
||||
@ -1151,8 +1151,8 @@ rpmostree_context_download (RpmOstreeContext *ctx,
|
||||
|
||||
static gboolean
|
||||
import_one_package (RpmOstreeContext *self,
|
||||
HifContext *hifctx,
|
||||
HifPackage *pkg,
|
||||
DnfContext *hifctx,
|
||||
DnfPackage *pkg,
|
||||
OstreeSePolicy *sepolicy,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
@ -1165,12 +1165,12 @@ import_one_package (RpmOstreeContext *self,
|
||||
int flags = 0;
|
||||
|
||||
if (pkg_is_local (pkg))
|
||||
pkg_path = g_strdup (hif_package_get_filename (pkg));
|
||||
pkg_path = g_strdup (dnf_package_get_filename (pkg));
|
||||
else
|
||||
{
|
||||
g_autofree char *pkg_location = hif_package_get_location (pkg);
|
||||
g_autofree char *pkg_location = dnf_package_get_location (pkg);
|
||||
pkg_path =
|
||||
g_build_filename (hif_repo_get_location (hif_package_get_repo (pkg)),
|
||||
g_build_filename (dnf_repo_get_location (dnf_package_get_repo (pkg)),
|
||||
"packages", glnx_basename (pkg_location), NULL);
|
||||
}
|
||||
|
||||
@ -1186,7 +1186,7 @@ import_one_package (RpmOstreeContext *self,
|
||||
if (!rpmostree_unpacker_unpack_to_ostree (unpacker, ostreerepo, sepolicy,
|
||||
&ostree_commit, cancellable, error))
|
||||
{
|
||||
const char *nevra = hif_package_get_nevra (pkg);
|
||||
const char *nevra = dnf_package_get_nevra (pkg);
|
||||
g_prefix_error (error, "Unpacking %s: ", nevra);
|
||||
goto out;
|
||||
}
|
||||
@ -1207,10 +1207,10 @@ import_one_package (RpmOstreeContext *self,
|
||||
}
|
||||
|
||||
static inline void
|
||||
hif_state_assert_done (HifState *hifstate)
|
||||
dnf_state_assert_done (DnfState *hifstate)
|
||||
{
|
||||
gboolean r;
|
||||
r = hif_state_done (hifstate, NULL);
|
||||
r = dnf_state_done (hifstate, NULL);
|
||||
g_assert (r);
|
||||
}
|
||||
|
||||
@ -1221,7 +1221,7 @@ rpmostree_context_import (RpmOstreeContext *self,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
HifContext *hifctx = self->hifctx;
|
||||
DnfContext *hifctx = self->hifctx;
|
||||
guint progress_sigid;
|
||||
int n = install->packages_to_import->len;
|
||||
|
||||
@ -1231,19 +1231,19 @@ rpmostree_context_import (RpmOstreeContext *self,
|
||||
g_return_val_if_fail (self->ostreerepo != NULL, FALSE);
|
||||
|
||||
{
|
||||
glnx_unref_object HifState *hifstate = hif_state_new ();
|
||||
hif_state_set_number_steps (hifstate, install->packages_to_import->len);
|
||||
glnx_unref_object DnfState *hifstate = dnf_state_new ();
|
||||
dnf_state_set_number_steps (hifstate, install->packages_to_import->len);
|
||||
progress_sigid = g_signal_connect (hifstate, "percentage-changed",
|
||||
G_CALLBACK (on_hifstate_percentage_changed),
|
||||
"Importing:");
|
||||
|
||||
for (guint i = 0; i < install->packages_to_import->len; i++)
|
||||
{
|
||||
HifPackage *pkg = install->packages_to_import->pdata[i];
|
||||
DnfPackage *pkg = install->packages_to_import->pdata[i];
|
||||
if (!import_one_package (self, hifctx, pkg,
|
||||
self->sepolicy, cancellable, error))
|
||||
goto out;
|
||||
hif_state_assert_done (hifstate);
|
||||
dnf_state_assert_done (hifstate);
|
||||
}
|
||||
|
||||
g_signal_handler_disconnect (hifstate, progress_sigid);
|
||||
@ -1257,7 +1257,7 @@ rpmostree_context_import (RpmOstreeContext *self,
|
||||
|
||||
static gboolean
|
||||
ostree_checkout_package (OstreeRepo *repo,
|
||||
HifPackage *pkg,
|
||||
DnfPackage *pkg,
|
||||
int dfd,
|
||||
const char *path,
|
||||
OstreeRepoDevInoCache *devino_cache,
|
||||
@ -1290,7 +1290,7 @@ ostree_checkout_package (OstreeRepo *repo,
|
||||
out:
|
||||
if (error && *error)
|
||||
{
|
||||
const char *nevra = hif_package_get_nevra (pkg);
|
||||
const char *nevra = dnf_package_get_nevra (pkg);
|
||||
g_prefix_error (error, "Unpacking %s: ", nevra);
|
||||
}
|
||||
return ret;
|
||||
@ -1541,7 +1541,7 @@ relabel_rootfs (OstreeRepo *repo,
|
||||
|
||||
static gboolean
|
||||
relabel_one_package (OstreeRepo *repo,
|
||||
HifPackage *pkg,
|
||||
DnfPackage *pkg,
|
||||
OstreeSePolicy *sepolicy,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
@ -1685,22 +1685,22 @@ rpmostree_context_relabel (RpmOstreeContext *self,
|
||||
g_return_val_if_fail (self->ostreerepo != NULL, FALSE);
|
||||
|
||||
{
|
||||
glnx_unref_object HifState *hifstate = hif_state_new ();
|
||||
glnx_unref_object DnfState *hifstate = dnf_state_new ();
|
||||
g_autofree char *prefix = g_strdup_printf ("Relabeling %d package%s:",
|
||||
n, n>1 ? "s" : "");
|
||||
|
||||
hif_state_set_number_steps (hifstate, install->packages_to_relabel->len);
|
||||
dnf_state_set_number_steps (hifstate, install->packages_to_relabel->len);
|
||||
progress_sigid = g_signal_connect (hifstate, "percentage-changed",
|
||||
G_CALLBACK (on_hifstate_percentage_changed),
|
||||
prefix);
|
||||
|
||||
for (guint i = 0; i < install->packages_to_relabel->len; i++)
|
||||
{
|
||||
HifPackage *pkg = install->packages_to_relabel->pdata[i];
|
||||
DnfPackage *pkg = install->packages_to_relabel->pdata[i];
|
||||
if (!relabel_one_package (self->ostreerepo, pkg, self->sepolicy,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
hif_state_assert_done (hifstate);
|
||||
dnf_state_assert_done (hifstate);
|
||||
}
|
||||
|
||||
g_signal_handler_disconnect (hifstate, progress_sigid);
|
||||
@ -1731,8 +1731,8 @@ ts_callback (const void * h,
|
||||
{
|
||||
case RPMCALLBACK_INST_OPEN_FILE:
|
||||
{
|
||||
HifPackage *pkg = (void*)key;
|
||||
const char *nevra = hif_package_get_nevra (pkg);
|
||||
DnfPackage *pkg = (void*)key;
|
||||
const char *nevra = dnf_package_get_nevra (pkg);
|
||||
g_autofree char *path = glnx_fdrel_abspath (tdata->tmp_metadata_dfd, nevra);
|
||||
g_assert (tdata->current_trans_fd == NULL);
|
||||
tdata->current_trans_fd = Fopen (path, "r.ufdio");
|
||||
@ -1753,12 +1753,12 @@ ts_callback (const void * h,
|
||||
|
||||
static Header
|
||||
get_header_for_package (int tmp_metadata_dfd,
|
||||
HifPackage *pkg,
|
||||
DnfPackage *pkg,
|
||||
GError **error)
|
||||
{
|
||||
Header hdr = NULL;
|
||||
glnx_fd_close int metadata_fd = -1;
|
||||
const char *nevra = hif_package_get_nevra (pkg);
|
||||
const char *nevra = dnf_package_get_nevra (pkg);
|
||||
|
||||
if ((metadata_fd = openat (tmp_metadata_dfd, nevra, O_RDONLY | O_CLOEXEC)) < 0)
|
||||
{
|
||||
@ -1774,7 +1774,7 @@ get_header_for_package (int tmp_metadata_dfd,
|
||||
|
||||
static gboolean
|
||||
add_to_transaction (rpmts ts,
|
||||
HifPackage *pkg,
|
||||
DnfPackage *pkg,
|
||||
int tmp_metadata_dfd,
|
||||
gboolean noscripts,
|
||||
GHashTable *ignore_scripts,
|
||||
@ -1802,7 +1802,7 @@ add_to_transaction (rpmts ts,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"Failed to add install element for %s",
|
||||
hif_package_get_filename (pkg));
|
||||
dnf_package_get_filename (pkg));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1816,7 +1816,7 @@ add_to_transaction (rpmts ts,
|
||||
static gboolean
|
||||
run_posttrans_sync (int tmp_metadata_dfd,
|
||||
int rootfs_dfd,
|
||||
HifPackage *pkg,
|
||||
DnfPackage *pkg,
|
||||
GHashTable *ignore_scripts,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
@ -1865,14 +1865,14 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
HifContext *hifctx = self->hifctx;
|
||||
DnfContext *hifctx = self->hifctx;
|
||||
TransactionData tdata = { 0, -1 };
|
||||
rpmts ordering_ts = NULL;
|
||||
rpmts rpmdb_ts = NULL;
|
||||
guint i, n_rpmts_elements;
|
||||
g_autoptr(GHashTable) pkg_to_ostree_commit =
|
||||
g_hash_table_new_full (NULL, NULL, (GDestroyNotify)g_object_unref, (GDestroyNotify)g_free);
|
||||
HifPackage *filesystem_package = NULL; /* It's special... */
|
||||
DnfPackage *filesystem_package = NULL; /* It's special... */
|
||||
int r;
|
||||
char *tmp_metadata_dir_path = NULL;
|
||||
glnx_fd_close int tmp_metadata_dfd = -1;
|
||||
@ -1885,7 +1885,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
tdata.tmp_metadata_dfd = tmp_metadata_dfd;
|
||||
|
||||
ordering_ts = rpmtsCreate ();
|
||||
rpmtsSetRootDir (ordering_ts, hif_context_get_install_root (hifctx));
|
||||
rpmtsSetRootDir (ordering_ts, dnf_context_get_install_root (hifctx));
|
||||
/* First for the ordering TS, set the dbpath to relative, which will also gain
|
||||
* the root dir.
|
||||
*/
|
||||
@ -1903,19 +1903,19 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
*/
|
||||
{ g_autoptr(GPtrArray) package_list = NULL;
|
||||
|
||||
package_list = hif_goal_get_packages (hif_context_get_goal (hifctx),
|
||||
HIF_PACKAGE_INFO_INSTALL,
|
||||
package_list = dnf_goal_get_packages (dnf_context_get_goal (hifctx),
|
||||
DNF_PACKAGE_INFO_INSTALL,
|
||||
-1);
|
||||
|
||||
for (i = 0; i < package_list->len; i++)
|
||||
{
|
||||
HifPackage *pkg = package_list->pdata[i];
|
||||
DnfPackage *pkg = package_list->pdata[i];
|
||||
glnx_unref_object RpmOstreeUnpacker *unpacker = NULL;
|
||||
g_autofree char *cachebranch = rpmostree_get_cache_branch_pkg (pkg);
|
||||
g_autofree char *cached_rev = NULL;
|
||||
g_autoptr(GVariant) pkg_commit = NULL;
|
||||
g_autoptr(GVariant) header_variant = NULL;
|
||||
const char *nevra = hif_package_get_nevra (pkg);
|
||||
const char *nevra = dnf_package_get_nevra (pkg);
|
||||
|
||||
{
|
||||
g_autofree char *branch_head_rev = NULL;
|
||||
@ -1943,7 +1943,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
(GVariantType*)"ay", error);
|
||||
if (!header_variant)
|
||||
{
|
||||
g_prefix_error (error, "In commit %s of %s: ", cached_rev, hif_package_get_package_id (pkg));
|
||||
g_prefix_error (error, "In commit %s of %s: ", cached_rev, dnf_package_get_package_id (pkg));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1962,7 +1962,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
|
||||
g_hash_table_insert (pkg_to_ostree_commit, g_object_ref (pkg), g_steal_pointer (&cached_rev));
|
||||
|
||||
if (strcmp (hif_package_get_name (pkg), "filesystem") == 0)
|
||||
if (strcmp (dnf_package_get_name (pkg), "filesystem") == 0)
|
||||
filesystem_package = g_object_ref (pkg);
|
||||
}
|
||||
}
|
||||
@ -2004,7 +2004,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
* rootfs dir.
|
||||
*/
|
||||
rpmte te = rpmtsElement (ordering_ts, 0);
|
||||
HifPackage *pkg = (void*)rpmteKey (te);
|
||||
DnfPackage *pkg = (void*)rpmteKey (te);
|
||||
|
||||
g_assert (pkg);
|
||||
|
||||
@ -2024,7 +2024,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
for (; i < n_rpmts_elements; i++)
|
||||
{
|
||||
rpmte te = rpmtsElement (ordering_ts, i);
|
||||
HifPackage *pkg = (void*)rpmteKey (te);
|
||||
DnfPackage *pkg = (void*)rpmteKey (te);
|
||||
|
||||
g_assert (pkg);
|
||||
|
||||
@ -2049,7 +2049,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
for (i = 0; i < n_rpmts_elements; i++)
|
||||
{
|
||||
rpmte te = rpmtsElement (ordering_ts, i);
|
||||
HifPackage *pkg = (void*)rpmteKey (te);
|
||||
DnfPackage *pkg = (void*)rpmteKey (te);
|
||||
|
||||
g_assert (pkg);
|
||||
|
||||
@ -2098,7 +2098,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
g_hash_table_iter_init (&hiter, pkg_to_ostree_commit);
|
||||
while (g_hash_table_iter_next (&hiter, &k, &v))
|
||||
{
|
||||
HifPackage *pkg = k;
|
||||
DnfPackage *pkg = k;
|
||||
|
||||
/* Set noscripts since we already validated them above */
|
||||
if (!add_to_transaction (rpmdb_ts, pkg, tmp_metadata_dfd, TRUE, NULL,
|
||||
@ -2127,7 +2127,7 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
|
||||
}
|
||||
if (r > 0)
|
||||
{
|
||||
if (!hif_rpmts_look_for_problems (rpmdb_ts, error))
|
||||
if (!dnf_rpmts_look_for_problems (rpmdb_ts, error))
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
#include <ostree.h>
|
||||
|
||||
#include "libglnx.h"
|
||||
@ -46,7 +46,7 @@ RpmOstreeContext *rpmostree_context_new_unprivileged (int basedir_dfd,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
HifContext * rpmostree_context_get_hif (RpmOstreeContext *self);
|
||||
DnfContext * rpmostree_context_get_hif (RpmOstreeContext *self);
|
||||
|
||||
RpmOstreeTreespec *rpmostree_treespec_new_from_keyfile (GKeyFile *keyfile, GError **error);
|
||||
RpmOstreeTreespec *rpmostree_treespec_new_from_path (const char *path, GError **error);
|
||||
@ -71,11 +71,11 @@ void rpmostree_context_set_sepolicy (RpmOstreeContext *self,
|
||||
void rpmostree_context_set_ignore_scripts (RpmOstreeContext *self,
|
||||
GHashTable *ignore_scripts);
|
||||
|
||||
void rpmostree_hif_add_checksum_goal (GChecksum *checksum, HyGoal goal);
|
||||
void rpmostree_dnf__add_checksum_goal (GChecksum *checksum, HyGoal goal);
|
||||
char *rpmostree_context_get_state_sha512 (RpmOstreeContext *self);
|
||||
|
||||
char *rpmostree_get_cache_branch_header (Header hdr);
|
||||
char *rpmostree_get_cache_branch_pkg (HifPackage *pkg);
|
||||
char *rpmostree_get_cache_branch_pkg (DnfPackage *pkg);
|
||||
|
||||
gboolean rpmostree_context_download_metadata (RpmOstreeContext *context,
|
||||
GCancellable *cancellable,
|
||||
|
@ -1018,11 +1018,11 @@ handle_remove_files_from_package (GFile *yumroot,
|
||||
|
||||
for (j = 0; j < npackages; j++)
|
||||
{
|
||||
HifPackage *pkg;
|
||||
DnfPackage *pkg;
|
||||
g_auto(GStrv) pkg_files = NULL;
|
||||
|
||||
pkg = pkglist->pdata[j];
|
||||
pkg_files = hif_package_get_files (pkg);
|
||||
pkg_files = dnf_package_get_files (pkg);
|
||||
|
||||
for (i = 1; i < len; i++)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "rpmostree-rpm-util.h"
|
||||
|
||||
RpmOstreeRefSack *
|
||||
rpmostree_refsack_new (HifSack *sack, int temp_base_dfd, const char *temp_path)
|
||||
rpmostree_refsack_new (DnfSack *sack, int temp_base_dfd, const char *temp_path)
|
||||
{
|
||||
RpmOstreeRefSack *rsack = g_new0 (RpmOstreeRefSack, 1);
|
||||
rsack->sack = g_object_ref (sack);
|
||||
|
@ -21,17 +21,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
|
||||
typedef struct {
|
||||
volatile gint refcount;
|
||||
HifSack *sack;
|
||||
DnfSack *sack;
|
||||
int temp_base_dfd;
|
||||
char *temp_path;
|
||||
} RpmOstreeRefSack;
|
||||
|
||||
RpmOstreeRefSack *
|
||||
rpmostree_refsack_new (HifSack *sack, int temp_base_dfd, const char *temp_path);
|
||||
rpmostree_refsack_new (DnfSack *sack, int temp_base_dfd, const char *temp_path);
|
||||
|
||||
RpmOstreeRefSack *
|
||||
rpmostree_refsack_ref (RpmOstreeRefSack *rsack);
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
|
||||
typedef struct {
|
||||
volatile gint refcount;
|
||||
|
@ -762,23 +762,23 @@ rpmostree_checkout_only_rpmdb_tempdir (OstreeRepo *repo,
|
||||
static gboolean
|
||||
get_sack_for_root (int dfd,
|
||||
const char *path,
|
||||
HifSack **out_sack,
|
||||
DnfSack **out_sack,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
g_autoptr(HifSack) sack = NULL;
|
||||
g_autoptr(DnfSack) sack = NULL;
|
||||
g_autofree char *fullpath = glnx_fdrel_abspath (dfd, path);
|
||||
|
||||
g_return_val_if_fail (out_sack != NULL, FALSE);
|
||||
|
||||
sack = hif_sack_new ();
|
||||
hif_sack_set_rootdir (sack, fullpath);
|
||||
sack = dnf_sack_new ();
|
||||
dnf_sack_set_rootdir (sack, fullpath);
|
||||
|
||||
if (!hif_sack_setup (sack, HIF_SACK_LOAD_FLAG_BUILD_CACHE, error))
|
||||
if (!dnf_sack_setup (sack, DNF_SACK_LOAD_FLAG_BUILD_CACHE, error))
|
||||
goto out;
|
||||
|
||||
if (!hif_sack_load_system_repo (sack, NULL, 0, error))
|
||||
if (!dnf_sack_load_system_repo (sack, NULL, 0, error))
|
||||
goto out;
|
||||
|
||||
ret = TRUE;
|
||||
@ -794,7 +794,7 @@ rpmostree_get_refsack_for_root (int dfd,
|
||||
GError **error)
|
||||
{
|
||||
RpmOstreeRefSack *ret = NULL;
|
||||
HifSack *sack;
|
||||
DnfSack *sack;
|
||||
|
||||
if (!get_sack_for_root (dfd, path,
|
||||
&sack, cancellable, error))
|
||||
@ -815,7 +815,7 @@ rpmostree_get_refsack_for_commit (OstreeRepo *repo,
|
||||
RpmOstreeRefSack *ret = NULL;
|
||||
g_autofree char *tempdir = NULL;
|
||||
glnx_fd_close int tempdir_dfd = -1;
|
||||
HifSack *hsack;
|
||||
DnfSack *hsack;
|
||||
|
||||
if (!rpmostree_checkout_only_rpmdb_tempdir (repo, ref,
|
||||
"/tmp/rpmostree-dbquery-XXXXXX",
|
||||
@ -901,23 +901,23 @@ rpmostree_get_pkglist_for_root (int dfd,
|
||||
}
|
||||
|
||||
static gint
|
||||
pkg_array_compare (HifPackage **p_pkg1,
|
||||
HifPackage **p_pkg2)
|
||||
pkg_array_compare (DnfPackage **p_pkg1,
|
||||
DnfPackage **p_pkg2)
|
||||
{
|
||||
return hif_package_cmp (*p_pkg1, *p_pkg2);
|
||||
return dnf_package_cmp (*p_pkg1, *p_pkg2);
|
||||
}
|
||||
|
||||
void
|
||||
rpmostree_print_transaction (HifContext *hifctx)
|
||||
rpmostree_print_transaction (DnfContext *hifctx)
|
||||
{
|
||||
guint i;
|
||||
g_autoptr(GPtrArray) install = NULL;
|
||||
|
||||
install = hif_goal_get_packages (hif_context_get_goal (hifctx),
|
||||
HIF_PACKAGE_INFO_INSTALL,
|
||||
HIF_PACKAGE_INFO_REINSTALL,
|
||||
HIF_PACKAGE_INFO_DOWNGRADE,
|
||||
HIF_PACKAGE_INFO_UPDATE,
|
||||
install = dnf_goal_get_packages (dnf_context_get_goal (hifctx),
|
||||
DNF_PACKAGE_INFO_INSTALL,
|
||||
DNF_PACKAGE_INFO_REINSTALL,
|
||||
DNF_PACKAGE_INFO_DOWNGRADE,
|
||||
DNF_PACKAGE_INFO_UPDATE,
|
||||
-1);
|
||||
|
||||
g_print ("Transaction: %u packages\n", install->len);
|
||||
@ -930,8 +930,8 @@ rpmostree_print_transaction (HifContext *hifctx)
|
||||
|
||||
for (i = 0; i < install->len; i++)
|
||||
{
|
||||
HifPackage *pkg = install->pdata[i];
|
||||
g_print (" %s (%s)\n", hif_package_get_nevra (pkg), hif_package_get_reponame (pkg));
|
||||
DnfPackage *pkg = install->pdata[i];
|
||||
g_print (" %s (%s)\n", dnf_package_get_nevra (pkg), dnf_package_get_reponame (pkg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ rpmostree_get_pkglist_for_root (int dfd,
|
||||
GError **error);
|
||||
|
||||
void
|
||||
rpmostree_print_transaction (HifContext *context);
|
||||
rpmostree_print_transaction (DnfContext *context);
|
||||
|
||||
|
||||
void _rpmostree_reset_rpm_sighandlers (void);
|
||||
|
@ -126,11 +126,11 @@ fusermount_cleanup (const char *mountpoint)
|
||||
}
|
||||
|
||||
static RpmOstreeScriptAction
|
||||
lookup_script_action (HifPackage *package,
|
||||
lookup_script_action (DnfPackage *package,
|
||||
GHashTable *ignored_scripts,
|
||||
const char *scriptdesc)
|
||||
{
|
||||
const char *pkg_script = glnx_strjoina (hif_package_get_name (package), ".", scriptdesc+1);
|
||||
const char *pkg_script = glnx_strjoina (dnf_package_get_name (package), ".", scriptdesc+1);
|
||||
const struct RpmOstreePackageScriptHandler *handler = rpmostree_script_gperf_lookup (pkg_script, strlen (pkg_script));
|
||||
if (ignored_scripts && g_hash_table_contains (ignored_scripts, pkg_script))
|
||||
return RPMOSTREE_SCRIPT_ACTION_IGNORE;
|
||||
@ -140,7 +140,7 @@ lookup_script_action (HifPackage *package,
|
||||
}
|
||||
|
||||
gboolean
|
||||
rpmostree_script_txn_validate (HifPackage *package,
|
||||
rpmostree_script_txn_validate (DnfPackage *package,
|
||||
Header hdr,
|
||||
GHashTable *override_ignored_scripts,
|
||||
GCancellable *cancellable,
|
||||
@ -166,7 +166,7 @@ rpmostree_script_txn_validate (HifPackage *package,
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Package '%s' has (currently) unsupported script of type '%s'",
|
||||
hif_package_get_name (package), desc);
|
||||
dnf_package_get_name (package), desc);
|
||||
goto out;
|
||||
}
|
||||
case RPMOSTREE_SCRIPT_ACTION_IGNORE:
|
||||
@ -339,7 +339,7 @@ run_script_in_bwrap_container (int rootfs_fd,
|
||||
}
|
||||
|
||||
gboolean
|
||||
rpmostree_posttrans_run_sync (HifPackage *pkg,
|
||||
rpmostree_posttrans_run_sync (DnfPackage *pkg,
|
||||
Header hdr,
|
||||
GHashTable *ignore_scripts,
|
||||
int rootfs_fd,
|
||||
@ -366,11 +366,11 @@ rpmostree_posttrans_run_sync (HifPackage *pkg,
|
||||
{
|
||||
case RPMOSTREE_SCRIPT_ACTION_DEFAULT:
|
||||
{
|
||||
rpmostree_output_task_begin ("Running %s for %s...", desc, hif_package_get_name (pkg));
|
||||
if (!run_script_in_bwrap_container (rootfs_fd, hif_package_get_name (pkg), desc, script,
|
||||
rpmostree_output_task_begin ("Running %s for %s...", desc, dnf_package_get_name (pkg));
|
||||
if (!run_script_in_bwrap_container (rootfs_fd, dnf_package_get_name (pkg), desc, script,
|
||||
cancellable, error))
|
||||
{
|
||||
g_prefix_error (error, "Running %s for %s: ", desc, hif_package_get_name (pkg));
|
||||
g_prefix_error (error, "Running %s for %s: ", desc, dnf_package_get_name (pkg));
|
||||
return FALSE;
|
||||
}
|
||||
rpmostree_output_task_end ("done");
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <rpm/rpmfi.h>
|
||||
#include <rpm/rpmmacro.h>
|
||||
#include <rpm/rpmts.h>
|
||||
#include <libhif/libhif.h>
|
||||
#include <libdnf/libdnf.h>
|
||||
|
||||
#include "libglnx.h"
|
||||
|
||||
@ -50,14 +50,14 @@ gboolean rpmostree_script_ignore_hash_from_strv (const char *const *strv,
|
||||
GError **error);
|
||||
|
||||
gboolean
|
||||
rpmostree_script_txn_validate (HifPackage *package,
|
||||
rpmostree_script_txn_validate (DnfPackage *package,
|
||||
Header hdr,
|
||||
GHashTable *ignore_scripts,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean
|
||||
rpmostree_posttrans_run_sync (HifPackage *pkg,
|
||||
rpmostree_posttrans_run_sync (DnfPackage *pkg,
|
||||
Header hdr,
|
||||
GHashTable *ignore_scripts,
|
||||
int rootfs_fd,
|
||||
|
Loading…
Reference in New Issue
Block a user