diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d97e526 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libhif-0.2.0.tar.xz diff --git a/.libhif.metadata b/.libhif.metadata new file mode 100644 index 0000000..de38168 --- /dev/null +++ b/.libhif.metadata @@ -0,0 +1 @@ +5698ca219deb1da722f425a71bc36ab9afad0863 SOURCES/libhif-0.2.0.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-context-Fix-rpmdb-file-monitor-with-installs.patch b/SOURCES/0001-context-Fix-rpmdb-file-monitor-with-installs.patch new file mode 100644 index 0000000..a6fdc14 --- /dev/null +++ b/SOURCES/0001-context-Fix-rpmdb-file-monitor-with-installs.patch @@ -0,0 +1,32 @@ +From efc37d3a9e52ebb83e4d686c81610277a4fb5ef7 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Wed, 13 May 2015 13:42:55 +0200 +Subject: [PATCH] context: Fix rpmdb file monitor with / installs + +Commit c50214d43a20941b2a950dd04d822fdc33a137d0 added a guard that was +supposed to avoid firing the rpmdb monitor signals when using a +non-default install root, but got the guard condition backwards which +prevented it working with regular / installs. + +Fixing this makes PackageKit properly invalidate its internal caches +when an external program, such as dnf, touches the rpmdb. +--- + libhif/hif-context.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libhif/hif-context.c b/libhif/hif-context.c +index 59fe113..57bda46 100644 +--- a/libhif/hif-context.c ++++ b/libhif/hif-context.c +@@ -1354,7 +1354,7 @@ hif_context_setup (HifContext *context, + return FALSE; + + /* setup a file monitor on the rpmdb, if we're operating on the native / */ +- if (g_strcmp0 (priv->install_root, "/") != 0) { ++ if (g_strcmp0 (priv->install_root, "/") == 0) { + rpmdb_path = g_build_filename (priv->install_root, "var/lib/rpm/Packages", NULL); + file_rpmdb = g_file_new_for_path (rpmdb_path); + priv->monitor_rpmdb = g_file_monitor_file (file_rpmdb, +-- +2.4.0 + diff --git a/SOURCES/0001-transaction-Remove-obsoleted-packages-when-committin.patch b/SOURCES/0001-transaction-Remove-obsoleted-packages-when-committin.patch new file mode 100644 index 0000000..8d7a169 --- /dev/null +++ b/SOURCES/0001-transaction-Remove-obsoleted-packages-when-committin.patch @@ -0,0 +1,29 @@ +From d8c8a2491e20996a5e1cbd428e38eb5cdeccd342 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Wed, 15 Apr 2015 21:05:13 +0200 +Subject: [PATCH] transaction: Remove obsoleted packages when committing the + transaction + +This matches the behaviour with DNF / yum that automatically remove any +obsoleted packages. + +https://bugzilla.redhat.com/show_bug.cgi?id=1211991 +--- + libhif/hif-transaction.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libhif/hif-transaction.c b/libhif/hif-transaction.c +index 40a0f7c..2c929bb 100644 +--- a/libhif/hif-transaction.c ++++ b/libhif/hif-transaction.c +@@ -1272,6 +1272,7 @@ hif_transaction_commit (HifTransaction *transaction, + + /* add things to remove */ + priv->remove = hif_goal_get_packages (goal, ++ HIF_PACKAGE_INFO_OBSOLETE, + HIF_PACKAGE_INFO_REMOVE, + -1); + for (i = 0; i < priv->remove->len; i++) { +-- +2.3.5 + diff --git a/SPECS/libhif.spec b/SPECS/libhif.spec new file mode 100644 index 0000000..7e8dc9d --- /dev/null +++ b/SPECS/libhif.spec @@ -0,0 +1,196 @@ +Summary: Simple package library built on top of hawkey and librepo +Name: libhif +Version: 0.2.0 +Release: 5.atomic.0%{?dist} +License: LGPLv2+ +URL: https://github.com/hughsie/libhif +Source0: http://people.freedesktop.org/~hughsient/releases/libhif-%{version}.tar.xz +# https://bugzilla.redhat.com/show_bug.cgi?id=1211991 +Patch0: 0001-transaction-Remove-obsoleted-packages-when-committin.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1221158 +Patch1: 0001-context-Fix-rpmdb-file-monitor-with-installs.patch + +BuildRequires: glib2-devel >= 2.16.1 +BuildRequires: libtool +BuildRequires: docbook-utils +BuildRequires: gtk-doc +BuildRequires: gobject-introspection-devel +BuildRequires: hawkey-devel >= 0.5.6 +BuildRequires: rpm-devel >= 4.11.0 +BuildRequires: librepo-devel >= 1.7.11 +BuildRequires: libsolv-devel + +# Bootstrap build requirements +BuildRequires: automake autoconf libtool + +%description +This library provides a simple interface to hawkey and librepo and is currently +used by PackageKit and rpm-ostree. + +%package devel +Summary: GLib Libraries and headers for libhif +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description devel +GLib headers and libraries for libhif. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 + +%build +# Support builds of both git snapshots and tarballs +(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi; +%configure \ + --enable-gtk-doc \ + --disable-static \ + --disable-silent-rules +) + +make %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +rm -f $RPM_BUILD_ROOT%{_libdir}/libhif*.la + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%doc README.md AUTHORS NEWS COPYING +%{_libdir}/libhif.so.1* +%{_libdir}/girepository-1.0/*.typelib + +%files devel +%{_libdir}/libhif.so +%{_libdir}/pkgconfig/libhif.pc +%dir %{_includedir}/libhif +%{_includedir}/libhif/*.h +%{_datadir}/gtk-doc +%{_datadir}/gir-1.0/*.gir + +%changelog +* Sun May 17 2015 Colin Walters - 0.2.0-5.atomic.0 +- Rebuild against latest hawkey + +* Fri May 15 2015 Colin Walters - 0.2.0-4.atomic.0 +- Build for atomic + +* Wed May 13 2015 Kalev Lember 0.2.0-3 +- context: Fix rpmdb file monitor with / installs (#1221158) + +* Wed Apr 15 2015 Kalev Lember 0.2.0-2 +- Remove obsoleted packages when committing transaction (#1211991) + +* Wed Apr 08 2015 Richard Hughes 0.2.0-1 +- Update to new upstream version +- Add new API required for ostree + +* Sat Mar 28 2015 Kalev Lember - 0.1.8-7 +- Fix broken -devel package requires + +* Mon Mar 16 2015 Than Ngo - 0.1.8-6 +- bump release and rebuild so that koji-shadow can rebuild it + against new gcc on secondary arch + +* Fri Feb 06 2015 Richard Hughes 0.1.8-5 +- Adapt to the new hawkey API. + +* Tue Feb 03 2015 Richard Hughes 0.1.8-4 +- Do not crash when file:///tmp exists, but file:///tmp/repodata does not + +* Tue Feb 03 2015 Richard Hughes 0.1.8-3 +- Do not add the source to the sack if it does not exist, which fixes a crash + for repo files with things like baseurl=file:///notgoingtoexist +- Resolves: #1135740 + +* Tue Feb 03 2015 Richard Hughes 0.1.8-2 +- Ensure the mirror list is set before trying to download packages +- This works around a librepo behaviour change in the latest update +- Resolves: #1188600 + +* Mon Jan 19 2015 Richard Hughes 0.1.8-1 +- Update to new upstream version +- Do not attempt to read from a closed file descriptor +- Do not use hif_context_get_transaction() from multiple threads +- Ensure HifContext can be finalised to prevent rpmdb index corruption +- Resolves: #1183010 + +* Thu Jan 15 2015 Richard Hughes 0.1.7-3 +- Do not download the mirrorlists when checking for updates +- Resolves: #1181501 + +* Wed Jan 14 2015 Richard Hughes 0.1.7-2 +- Fix auto-importing of GPG keys during installing +- Resolves: #1182090 and #1182156 + +* Fri Dec 19 2014 Richard Hughes 0.1.7-1 +- Update to new upstream version +- Add the concept of metadata-only software sources +- Correctly update sources with baseurls ending with a slash +- Don't unref the HifSource when invalidating as this is not threadsafe +- Improve handling of local metadata +- Support appstream and appstream-icons metadata types + +* Wed Nov 26 2014 Richard Hughes 0.1.6-2 +- Do not crash when trying to parse pathological files like bumblebee.repo +- Resolves: #1164330 + +* Mon Nov 11 2014 Richard Hughes 0.1.6-1 +- Update to new upstream version +- Add support for package reinstallation and downgrade +- Copy the vendor cache if present +- Ensure created directories are world-readable +- Support local repositories + +* Mon Sep 22 2014 Richard Hughes 0.1.5-1 +- Update to new upstream version +- Add all native architectures for ARM and i386 +- Check for libQtGui rather than libkde* to detect GUI apps + +* Mon Sep 12 2014 Richard Hughes 0.1.4-1 +- Update to new upstream version +- Allow setting the default lock directory +- Ensure all the required directories exist when setting up the context + +* Mon Sep 01 2014 Richard Hughes 0.1.3-1 +- Update to new upstream version +- Add an error path for when the sources are not valid +- Do not call hif_context_setup_sack() automatically +- Fix a logic error to fix refreshing with HIF_SOURCE_UPDATE_FLAG_FORCE + +* Sun Aug 17 2014 Fedora Release Engineering - 0.1.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Mon Jul 28 2014 Kalev Lember - 0.1.2-4 +- Rebuilt for hawkey soname bump + +* Tue Jul 22 2014 Kalev Lember - 0.1.2-3 +- Rebuilt for gobject-introspection 1.41.4 + +* Sat Jul 19 2014 Kalev Lember 0.1.2-2 +- Fix a PK crash with locally mounted iso media (#1114207) + +* Thu Jul 17 2014 Richard Hughes 0.1.2-1 +- Update to new upstream version +- Add HifContext accessor in -private for HifState +- Add name of failing repository +- Create an initial sack in HifContext +- Error if we can't find any package matching provided name +- Fix a mixup of HifStateAction and HifPackageInfo +- Improve rpm callback handling for packages in the cleanup state +- Only set librepo option if value is set +- Respect install root for rpmdb Packages monitor + +* Mon Jun 23 2014 Richard Hughes 0.1.1-1 +- Update to new upstream version +- Fix a potential crash when removing software +- Only add system repository if it exists +- Pass install root to hawkey + +* Tue Jun 10 2014 Richard Hughes 0.1.0-1 +- Initial version for Fedora package review +