[libhif] Fix a PK crash with locally mounted iso media
Kalev Lember
kalev at fedoraproject.org
Sat Jul 19 15:16:04 UTC 2014
commit c2c8438f9db663ba9eb289e524879f977ff33a7e
Author: Kalev Lember <kalevlember at gmail.com>
Date: Sat Jul 19 14:15:07 2014 +0200
Fix a PK crash with locally mounted iso media
https://bugzilla.redhat.com/show_bug.cgi?id=1114207
...on-t-error-out-for-missing-treeinfo-files.patch | 28 ++++++++++++++++++++
libhif.spec | 9 +++++-
2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/0001-repos-Don-t-error-out-for-missing-treeinfo-files.patch b/0001-repos-Don-t-error-out-for-missing-treeinfo-files.patch
new file mode 100644
index 0000000..3fdc8f7
--- /dev/null
+++ b/0001-repos-Don-t-error-out-for-missing-treeinfo-files.patch
@@ -0,0 +1,28 @@
+From 9b57af338fc9856fe01e2726ea25ab1b4b70aee7 Mon Sep 17 00:00:00 2001
+From: Kalev Lember <kalevlember at gmail.com>
+Date: Sat, 19 Jul 2014 13:53:49 +0200
+Subject: [PATCH] repos: Don't error out for missing treeinfo files
+
+Just silently ignore mount points that don't have a .treeinfo file.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1114207
+---
+ libhif/hif-repos.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libhif/hif-repos.c b/libhif/hif-repos.c
+index 6ba8ff7..db0b6b3 100644
+--- a/libhif/hif-repos.c
++++ b/libhif/hif-repos.c
+@@ -200,7 +200,7 @@ hif_repos_add_sack_from_mount_point (HifRepos *repos,
+ exists = g_file_test (treeinfo_fn, G_FILE_TEST_EXISTS);
+ g_debug ("checking %s for %s: %s", root, id, exists ? "yes" : "no");
+ if (!exists)
+- return FALSE;
++ return TRUE;
+
+ /* add the repodata/repomd.xml as a source */
+ if (!hif_repos_add_media (repos, root, *idx, error))
+--
+2.0.1
+
diff --git a/libhif.spec b/libhif.spec
index 723b7ab..7a17871 100644
--- a/libhif.spec
+++ b/libhif.spec
@@ -1,11 +1,14 @@
Summary: Simple package library built on top of hawkey and librepo
Name: libhif
Version: 0.1.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: LGPLv2+
URL: https://github.com/hughsie/libhif
Source0: http://people.freedesktop.org/~hughsient/releases/libhif-%{version}.tar.xz
+# Backported from upstream
+Patch0: 0001-repos-Don-t-error-out-for-missing-treeinfo-files.patch
+
BuildRequires: glib2-devel >= 2.16.1
BuildRequires: libtool
BuildRequires: docbook-utils
@@ -29,6 +32,7 @@ GLib headers and libraries for libhif.
%prep
%setup -q
+%patch0 -p1
%build
%configure \
@@ -61,6 +65,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libhif*.la
%{_datadir}/gir-1.0/*.gir
%changelog
+* Sat Jul 19 2014 Kalev Lember <kalevlember at gmail.com> 0.1.2-2
+- Fix a PK crash with locally mounted iso media (#1114207)
+
* Thu Jul 17 2014 Richard Hughes <richard at hughsie.com> 0.1.2-1
- Update to new upstream version
- Add HifContext accessor in -private for HifState
More information about the scm-commits
mailing list