Add patch to use yum-deprecated

Resolves: #1209695
This commit is contained in:
Colin Walters 2015-04-08 12:47:16 -04:00
parent 7800f4f443
commit 1cd0463856

130
2015.3-yumbased.patch Normal file
View File

@ -0,0 +1,130 @@
From 3d214c4a4f42d48ae3752f50d3a3aa92264b821e Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Thu, 5 Feb 2015 09:21:07 -0500
Subject: [PATCH 1/2] treepkgdiff: Adapt to Hawkey 0.5.3 API break
We will work on both old and new versions.
See https://github.com/rpm-software-management/hawkey/commit/8ce3ce754f50b4284587ceaa2eb4c0acf328912a
Conflicts:
configure.ac
---
configure.ac | 2 ++
src/rpmostree-treepkgdiff.c | 11 ++++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index dcb75a1..6240c88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,8 @@ PKG_CHECK_MODULES(PKGDEP_GIO_UNIX, [gio-unix-2.0])
PKG_CHECK_MODULES(PKGDEP_RPMOSTREE, [gio-unix-2.0 json-glib-1.0
ostree-1 >= 2015.1 libgsystem >= 2015.1
rpm hawkey])
+AS_IF([pkg-config --atleast-version=0.5.3 hawkey],
+ [AC_DEFINE([BUILDOPT_HAWKEY_SACK_CREATE2], 1, [Hawkey ABI change in 0.5.3])])
AC_PATH_PROG([XSLTPROC], [xsltproc])
GLIB_TESTS
diff --git a/src/rpmostree-treepkgdiff.c b/src/rpmostree-treepkgdiff.c
index f722e7e..b09c72e 100644
--- a/src/rpmostree-treepkgdiff.c
+++ b/src/rpmostree-treepkgdiff.c
@@ -38,7 +38,16 @@ rpmostree_get_pkglist_for_root (GFile *root,
_cleanup_hyquery_ HyQuery query = NULL;
_cleanup_hypackagelist_ HyPackageList pkglist = NULL;
- sack = hy_sack_create (NULL, NULL, gs_file_get_path_cached (root), 0);
+#ifdef BUILDOPT_HAWKEY_SACK_CREATE2
+ sack = hy_sack_create (NULL, NULL,
+ gs_file_get_path_cached (root),
+ NULL,
+ HY_MAKE_CACHE_DIR);
+#else
+ sack = hy_sack_create (NULL, NULL,
+ gs_file_get_path_cached (root),
+ HY_MAKE_CACHE_DIR);
+#endif
if (sack == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
--
1.8.3.1
From 99765147e70ea140549841a8dcec52ff6a7f580f Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Wed, 8 Apr 2015 09:01:00 -0400
Subject: [PATCH 2/2] build: Add --with-yum-binary, use yum-deprecated
Related: https://github.com/projectatomic/rpm-ostree/issues/121
---
configure.ac | 5 +++++
packaging/rpm-ostree.spec.in | 4 ++--
src/rpmostree-compose-builtin-tree.c | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6240c88..a231e2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,6 +53,11 @@ GLIB_TESTS
GOBJECT_INTROSPECTION_REQUIRE([1.34.0])
+AC_ARG_WITH(yum-binary,
+ AS_HELP_STRING([--with-yum-binary], [Use this yum binary @<:@default=yum@:>@]),
+ [], [with_yum_binary=yum])
+AC_DEFINE_UNQUOTED(YUM_BINARY, ["$with_yum_binary"], [Define to name or path of yum binary])
+
AC_ARG_ENABLE(installed_tests,
AS_HELP_STRING([--enable-installed-tests],
[Install test programs (default: no)]),,
diff --git a/packaging/rpm-ostree.spec.in b/packaging/rpm-ostree.spec.in
index f94f66e..48f9c65 100644
--- a/packaging/rpm-ostree.spec.in
+++ b/packaging/rpm-ostree.spec.in
@@ -19,7 +19,7 @@ BuildRequires: pkgconfig(rpm)
BuildRequires: pkgconfig(hawkey)
BuildRequires: libcap-devel
-Requires: /usr/bin/yum
+Requires: /usr/bin/yum-deprecated
%description
This tool takes a set of packages, and commits them to an OSTree
@@ -30,7 +30,7 @@ repository. At the moment, it is intended for use on build servers.
%build
env NOCONFIGURE=1 ./autogen.sh
-%configure --disable-silent-rules --enable-patched-hawkey-and-libsolv --enable-usrbinatomic
+%configure --disable-silent-rules --enable-patched-hawkey-and-libsolv --enable-usrbinatomic --with-yum-binary=/usr/bin/yum-deprecated
make %{?_smp_mflags}
%install
diff --git a/src/rpmostree-compose-builtin-tree.c b/src/rpmostree-compose-builtin-tree.c
index fc1220f..00f8ed6 100644
--- a/src/rpmostree-compose-builtin-tree.c
+++ b/src/rpmostree-compose-builtin-tree.c
@@ -286,7 +286,7 @@ yum_context_new (RpmOstreeTreeComposeContext *self,
int clone_flags = SIGCHLD | CLONE_NEWNS | CLONE_NEWPID;
int pipefds[2];
- g_ptr_array_add (yum_argv, g_strdup ("yum"));
+ g_ptr_array_add (yum_argv, g_strdup (YUM_BINARY));
g_ptr_array_add (yum_argv, g_strdup ("-y"));
if (!append_repo_and_cache_opts (self, treedata, yum_argv,
@@ -364,7 +364,7 @@ yum_context_new (RpmOstreeTreeComposeContext *self,
_rpmostree_perror_fatal ("mount(/, MS_PRIVATE | MS_NOSUID)");
}
- if (execvp ("yum", (char**)yum_argv->pdata) < 0)
+ if (execvp (YUM_BINARY, (char**)yum_argv->pdata) < 0)
_rpmostree_perror_fatal ("execvp");
}
--
1.8.3.1