New upstream version

This commit is contained in:
Colin Walters 2016-05-20 09:13:01 -04:00
parent 4e9da1c5e2
commit 5738f10432
4 changed files with 15 additions and 102 deletions

2
.gitignore vendored
View File

@ -30,3 +30,5 @@
/rpm-ostree-2015.11.43.ga2c052b.tar.xz
/libhif.tar.gz
/rpm-ostree-2016.1.tar.xz
/rpm-ostree-2016.2.tar.xz
/rpm-ostree-2016.3.tar.xz

View File

@ -1,97 +0,0 @@
From 63761e51274e7e35f8164896b3c4bac6582e80f1 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Thu, 31 Mar 2016 13:16:42 -0400
Subject: [PATCH] core: Skip over local packages for downloads
Because `hif_source_get_location()` is actually a reference to the
upstream repo, we shouldn't create a cache directory there.
This is just a two line fix, but I changed some things so that we keep
track of the number of local packages, in order to make the "Need to
download" print accurate.
We still need to add them (confusingly) to the `packages_to_download`
because that's also used for the container path which imports them.
Closes: #255
Closes: #256
Approved by: jlebon
---
src/libpriv/rpmostree-core.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c
index ae29999..08c3530 100644
--- a/src/libpriv/rpmostree-core.c
+++ b/src/libpriv/rpmostree-core.c
@@ -58,6 +58,7 @@ struct _RpmOstreeInstall {
GPtrArray *packages_requested;
/* Target state */
+ guint n_packages_download_local;
GPtrArray *packages_to_download;
guint64 n_bytes_to_fetch;
@@ -653,6 +654,7 @@ static gboolean
get_packages_to_download (HifContext *hifctx,
OstreeRepo *ostreerepo,
GPtrArray **out_packages,
+ guint *out_n_local,
GError **error)
{
gboolean ret = FALSE;
@@ -660,6 +662,7 @@ get_packages_to_download (HifContext *hifctx,
g_autoptr(GPtrArray) packages = NULL;
g_autoptr(GPtrArray) packages_to_download = NULL;
GPtrArray *sources = hif_context_get_repos (hifctx);
+ guint n_local = 0;
packages = hif_goal_get_packages (hif_context_get_goal (hifctx),
HIF_PACKAGE_INFO_INSTALL,
@@ -721,12 +724,15 @@ get_packages_to_download (HifContext *hifctx,
if (g_file_test (cachepath, G_FILE_TEST_EXISTS))
continue;
}
+ else
+ n_local++;
g_ptr_array_add (packages_to_download, g_object_ref (pkg));
}
ret = TRUE;
*out_packages = g_steal_pointer (&packages_to_download);
+ *out_n_local = n_local;
out:
return ret;
}
@@ -766,11 +772,14 @@ rpmostree_context_prepare_install (RpmOstreeContext *self,
}
printf ("%s", "done\n");
- if (!get_packages_to_download (hifctx, self->ostreerepo, &ret_install->packages_to_download, error))
+ if (!get_packages_to_download (hifctx, self->ostreerepo, &ret_install->packages_to_download,
+ &ret_install->n_packages_download_local,
+ error))
goto out;
rpmostree_print_transaction (hifctx);
- g_print ("\n Need to download %u packages\n", ret_install->packages_to_download->len);
+ g_print ("\n Need to download %u packages\n",
+ ret_install->packages_to_download->len - ret_install->n_packages_download_local);
ret = TRUE;
*out_install = g_steal_pointer (&ret_install);
@@ -957,6 +966,9 @@ source_download_packages (HifRepo *source,
HifPackage *pkg = packages->pdata[i];
struct PkgDownloadState *dlstate;
+ if (pkg_is_local (pkg))
+ continue;
+
if (target_dfd == -1)
{
target_dir = g_build_filename (hif_repo_get_location (source), "/packages/", NULL);
--
1.8.3.1

View File

@ -1,15 +1,16 @@
Summary: Client side upgrade program and server side compose tool
Name: rpm-ostree
Version: 2016.1
Release: 3%{?dist}
Version: 2016.3
Release: 1%{?dist}
#VCS: https://github.com/cgwalters/rpm-ostree
# This tarball is generated via "make -f Makefile.dist-packaging dist-snapshot"
Source0: rpm-ostree-%{version}.tar.xz
# https://github.com/rpm-software-management/libhif
# Bundled because the library is API/ABI unstable, and we're trying to
# avoid being version locked with PackageKit/dnf right now.
# This source is generated via
# git archive --format=tar --prefix=libhif/
Source1: libhif.tar.gz
Patch0: 0001-core-Skip-over-local-packages-for-downloads.patch
Provides: bundled(libhif) = 0.7.0
License: LGPLv2+
URL: https://github.com/projectatomic/rpm-ostree
@ -31,7 +32,11 @@ BuildRequires: libcap-devel
BuildRequires: libattr-devel
# libhif deps
BuildRequires: pkgconfig(librepo)
%if (0%{?rhel} != 0 && 0%{?rhel} <= 7)
BuildRequires: libsolv-devel
%else
BuildRequires: pkgconfig(libsolv)
%endif
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(check)
BuildRequires: python-devel
@ -152,6 +157,9 @@ python autofiles.py > files.devel \
%files devel -f files.devel
%changelog
* Fri May 20 2016 Colin Walters <walters@redhat.com> - 2016.3-2
- New upstream version
* Thu Mar 31 2016 Colin Walters <walters@redhat.com> - 2016.1-3
- Backport patch to fix Fedora composes writing data into source file:/// URIs

View File

@ -1,2 +1,2 @@
5fdb7cb4a125c2c2b6259e2c7df28859 rpm-ostree-2016.1.tar.xz
9d791bf0b79b0607084e23b82cb29fdd libhif.tar.gz
c7a6c54d14945f2c2fcbcca45568fb87 rpm-ostree-2016.3.tar.xz
5f9bfe41ff9baedc18ef95f0db5516c4 libhif.tar.gz