diff --git a/.gitignore b/.gitignore index bd703ef..62eee5b 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,4 @@ /dnf-2.5.0.tar.gz /dnf-2.5.1.tar.gz /dnf-2.6.2.tar.gz +/dnf-2.6.3.tar.gz diff --git a/0001-Fix-problems-with-downloaddir-options-RhBug-1476464.patch b/0001-Fix-problems-with-downloaddir-options-RhBug-1476464.patch deleted file mode 100644 index 358eea7..0000000 --- a/0001-Fix-problems-with-downloaddir-options-RhBug-1476464.patch +++ /dev/null @@ -1,158 +0,0 @@ -From ab6eb565dc069d827a0b9fe0784ea9339554b010 Mon Sep 17 00:00:00 2001 -From: Jaroslav Mracek -Date: Tue, 1 Aug 2017 10:17:32 +0200 -Subject: [PATCH] Fix problems with --downloaddir options (RhBug:1476464) - -It will copy all files even from local repository - -It removes permissions change, because it will not work for repos where -pkg.location is not only filename but path + filename. - -https://bugzilla.redhat.com/show_bug.cgi?id=1476464 ---- - dnf/base.py | 44 ++++++++++++++++++++++++++++++++------------ - dnf/cli/cli.py | 35 ++--------------------------------- - 2 files changed, 34 insertions(+), 45 deletions(-) - -diff --git a/dnf/base.py b/dnf/base.py -index 4e02d5c6..fa44425d 100644 ---- a/dnf/base.py -+++ b/dnf/base.py -@@ -57,6 +57,7 @@ import dnf.transaction - import dnf.util - import dnf.yum.rpmtrans - import functools -+import hawkey - import itertools - import logging - import os -@@ -1008,8 +1009,7 @@ class Base(object): - with lock: - drpm = dnf.drpm.DeltaInfo(self.sack.query().installed(), - progress, self.conf.deltarpm_percentage) -- remote_pkgs = [po for po in pkglist -- if not po._is_local_pkg()] -+ remote_pkgs = self._select_remote_pkgs(pkglist) - self._add_tempfiles([pkg.localPkg() for pkg in remote_pkgs]) - - payloads = [dnf.repo._pkg2payload(pkg, progress, drpm.delta_factory, -@@ -1081,16 +1081,9 @@ class Base(object): - - if self.conf.destdir: - dnf.util.ensure_dir(self.conf.destdir) -- for pload in payloads: -- payloadlocation = os.path.join( -- pload.pkg.repo.pkgdir, -- os.path.basename(pload.pkg.location) -- ) -- shutil.copy(payloadlocation, self.conf.destdir) -- os.chmod( -- os.path.join(self.conf.destdir, os.path.basename(pload.pkg.location)), -- 0o755 -- ) -+ for pkg in pkglist: -+ location = os.path.join(pkg.repo.pkgdir, os.path.basename(pkg.location)) -+ shutil.copy(location, self.conf.destdir) - - def add_remote_rpms(self, path_list, strict=True): - # :api -@@ -2235,6 +2228,33 @@ class Base(object): - installonly = q.filter(provides=self.conf.installonlypkgs) - return installonly - -+ def _select_remote_pkgs(self, install_pkgs): -+ """ Check checksum of packages from local repositories and returns list packages from remote -+ repositories that will be downloaded. Packages from commandline are skipped. -+ -+ :param install_pkgs: list of packages -+ :return: list of remote pkgs -+ """ -+ remote_pkgs = [] -+ local_repository_pkgs = [] -+ for pkg in install_pkgs: -+ if pkg._is_local_pkg(): -+ if pkg.reponame != hawkey.CMDLINE_REPO_NAME: -+ local_repository_pkgs.append(pkg) -+ else: -+ remote_pkgs.append(pkg) -+ error = False -+ for pkg in local_repository_pkgs: -+ if not pkg.verifyLocalPkg(): -+ msg = _("Package {} from local repository {} has incorrect checksum").format( -+ pkg, pkg.reponame) -+ logger.critical(msg) -+ error = True -+ if error: -+ raise dnf.exceptions.Error( -+ _("Some packages from local repository have incorrect checksum")) -+ return remote_pkgs -+ - - def _msg_installed(pkg): - name = ucd(pkg) -diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py -index 00b2a425..6b6ad987 100644 ---- a/dnf/cli/cli.py -+++ b/dnf/cli/cli.py -@@ -70,7 +70,6 @@ import logging - import operator - import os - import random --import re - import sys - import time - -@@ -214,14 +213,11 @@ class BaseCli(dnf.Base): - return - - if trans: -- remote_pkgs = self.select_remote_pkgs(install_pkgs) -- -- if remote_pkgs: -+ if install_pkgs: - logger.info(_('Downloading Packages:')) - try: - total_cb = self.output.download_callback_total_cb -- self.download_packages(remote_pkgs, self.output.progress, -- total_cb) -+ self.download_packages(install_pkgs, self.output.progress, total_cb) - except dnf.exceptions.DownloadError as e: - specific = dnf.cli.format.indent_block(ucd(e)) - errstr = _('Error downloading packages:') + '\n%s' % specific -@@ -246,33 +242,6 @@ class BaseCli(dnf.Base): - if tsi.op_type == dnf.transaction.FAIL: - raise dnf.exceptions.Error(_('Transaction failed')) - -- def select_remote_pkgs(self, install_pkgs): -- """ Check checksum of packages from local repositories and returns list packages from remote -- repositories that will be downloaded. Packages from commandline are skipped. -- -- :param install_pkgs: list of packages -- :return: list of remote pkgs -- """ -- remote_pkgs = [] -- local_repository_pkgs = [] -- for pkg in install_pkgs: -- if pkg._is_local_pkg(): -- if pkg.reponame != hawkey.CMDLINE_REPO_NAME: -- local_repository_pkgs.append(pkg) -- else: -- remote_pkgs.append(pkg) -- error = False -- for pkg in local_repository_pkgs: -- if not pkg.verifyLocalPkg(): -- msg = _("Package {} from local repository {} has incorrect checksum").format( -- str(pkg), pkg.reponame) -- logger.critical(msg) -- error = True -- if error: -- raise dnf.exceptions.Error( -- _("Some packages from local repository have incorrect checksum")) -- return remote_pkgs -- - def gpgsigcheck(self, pkgs): - """Perform GPG signature verification on the given packages, - installing keys if possible. --- -2.13.3 - diff --git a/dnf.spec b/dnf.spec index ff3087f..f3b5bee 100644 --- a/dnf.spec +++ b/dnf.spec @@ -24,8 +24,8 @@ %global _docdir_fmt %{name} Name: dnf -Version: 2.6.2 -Release: 3%{?dist} +Version: 2.6.3 +Release: 1%{?dist} Summary: Package manager forked from Yum, using libsolv as a dependency resolver # For a breakdown of the licensing, see PACKAGE-LICENSING License: GPLv2+ and GPLv2 and GPL @@ -34,8 +34,6 @@ URL: https://github.com/rpm-software-management/dnf # cd dnf # tito build --tgz --tag=dnf-2.5.1-1 Source0: %{name}-%{version}.tar.gz -# https://bugzilla.redhat.com/show_bug.cgi?id=1476464 -Patch0001: 0001-Fix-problems-with-downloaddir-options-RhBug-1476464.patch BuildArch: noarch BuildRequires: cmake BuildRequires: gettext @@ -48,9 +46,13 @@ Requires: python3-%{name} = %{version}-%{release} %else Requires: python2-%{name} = %{version}-%{release} %endif -# TODO: use rich deps once it is allowed in Fedora +%if 0%{?rhel} && 0%{?rhel} <= 7 +Requires: python-dbus +%else +# TODO: use rich deps once it is allowed #Recommends: (python%{?with_python3:3}-dbus if NetworkManager) Recommends: python%{?with_python3:3}-dbus +%endif Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -96,6 +98,15 @@ Obsoletes: dnf-langpacks-conf < %{dnf_langpacks_ver} %description conf Configuration files for DNF. +%if 0%{?rhel} && 0%{?rhel} <= 7 +%package -n yum4 +Requires: %{name} = %{version}-%{release} +Summary: As a Yum CLI compatibility layer, supplies /usr/bin/yum4 redirecting to DNF + +%description -n yum4 +As a Yum CLI compatibility layer, supplies /usr/bin/yum redirecting to DNF. + +%else %package yum Conflicts: yum < 3.4.3-505 Requires: %{name} = %{version}-%{release} @@ -103,6 +114,7 @@ Summary: As a Yum CLI compatibility layer, supplies /usr/bin/yum redirect %description yum As a Yum CLI compatibility layer, supplies /usr/bin/yum redirecting to DNF. +%endif %package -n python2-%{name} Summary: Python 2 interface to DNF @@ -124,7 +136,11 @@ Requires: python2-hawkey >= %{hawkey_version} Requires: python-iniparse Requires: python-libcomps >= %{libcomps_version} Requires: python-librepo >= %{librepo_version} +%if 0%{?rhel} && 0%{?rhel} <= 7 Requires: rpm-plugin-systemd-inhibit +%else +Recommends: rpm-plugin-systemd-inhibit +%endif Requires: rpm-python >= %{rpm_version} # dnf-langpacks package is retired in F25 # to have clean upgrade path for dnf-langpacks @@ -153,7 +169,11 @@ Requires: python3-hawkey >= %{hawkey_version} Requires: python3-iniparse Requires: python3-libcomps >= %{libcomps_version} Requires: python3-librepo >= %{librepo_version} +%if 0%{?rhel} && 0%{?rhel} <= 7 Requires: rpm-plugin-systemd-inhibit +%else +Recommends: rpm-plugin-systemd-inhibit +%endif Requires: rpm-python3 >= %{rpm_version} # dnf-langpacks package is retired in F25 # to have clean upgrade path for dnf-langpacks @@ -214,17 +234,22 @@ mkdir -p %{buildroot}%{_localstatedir}/log/ mkdir -p %{buildroot}%{_var}/cache/dnf/ touch %{buildroot}%{_localstatedir}/log/%{name}.log %if %{with python3} -%{?system_python_abi:sed -i 's|#!%{__python3}|#!%{_libexecdir}/system-python|' %{buildroot}%{_bindir}/{dnf-3,yum-3}} +%{?system_python_abi:sed -i 's|#!%{__python3}|#!%{_libexecdir}/system-python|' %{buildroot}%{_bindir}/dnf-3} ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/dnf mv %{buildroot}%{_bindir}/dnf-automatic-3 %{buildroot}%{_bindir}/dnf-automatic -mv %{buildroot}%{_bindir}/yum-3 %{buildroot}%{_bindir}/yum +ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/yum %else ln -sr %{buildroot}%{_bindir}/dnf-2 %{buildroot}%{_bindir}/dnf mv %{buildroot}%{_bindir}/dnf-automatic-2 %{buildroot}%{_bindir}/dnf-automatic -mv %{buildroot}%{_bindir}/yum-2 %{buildroot}%{_bindir}/yum +%if 0%{?rhel} && 0%{?rhel} <= 7 +ln -sr %{buildroot}%{_bindir}/dnf-2 %{buildroot}%{_bindir}/yum4 +ln -sr %{buildroot}%{_mandir}/man8/dnf.8.gz %{buildroot}%{_mandir}/man8/yum4.8.gz +rm -f %{buildroot}%{_mandir}/man8/yum.8.gz +%else +ln -sr %{buildroot}%{_bindir}/dnf-2 %{buildroot}%{_bindir}/yum +%endif %endif rm -vf %{buildroot}%{_bindir}/dnf-automatic-* -rm -vf %{buildroot}%{_bindir}/yum-* %check pushd build @@ -293,13 +318,21 @@ popd %ghost %{_sharedstatedir}/%{name}/groups.json %ghost %{_sharedstatedir}/%{name}/yumdb %ghost %{_sharedstatedir}/%{name}/history -%{_mandir}/man5/%{name}.conf.5.gz +%{_mandir}/man5/%{name}.conf.5* %{_tmpfilesdir}/%{name}.conf %{_sysconfdir}/libreport/events.d/collect_dnf.conf +%if 0%{?rhel} && 0%{?rhel} <= 7 +%files -n yum4 +%{_bindir}/yum4 +%{_mandir}/man8/yum4.8* +%exclude %{_mandir}/man8/yum.8* + +%else %files yum %{_bindir}/yum -%{_mandir}/man8/yum.8.gz +%{_mandir}/man8/yum.8* +%endif %files -n python2-%{name} %{_bindir}/%{name}-2 @@ -319,7 +352,7 @@ popd %files automatic %{_bindir}/%{name}-automatic %config(noreplace) %{confdir}/automatic.conf -%{_mandir}/man8/%{name}.automatic.8.gz +%{_mandir}/man8/%{name}.automatic.8* %{_unitdir}/%{name}-automatic-notifyonly.service %{_unitdir}/%{name}-automatic-notifyonly.timer %{_unitdir}/%{name}-automatic-download.service @@ -333,6 +366,42 @@ popd %endif %changelog +* Mon Aug 07 2017 Jaroslav Mracek 2.6.3-1 +- Fix problem with dnf.Package().remote_location() (RhBug:1476215) (Jaroslav + Mracek) +- Change behavior of -C according to documentation (RhBug:1473964) (Jaroslav + Mracek) +- It should prevent to ask attribute of None (RhBug:1359482) (Jaroslav Mracek) +- Solve a problems with --arch options (RhBug:1476834) (Jaroslav Mracek) +- Use security plugin code for dnf-automatic (Jaroslav Mracek) +- Fix unicode error for python2 (Jaroslav Mracek) +- Inform about packages installed for group (Jaroslav Mracek) +- Provide info if pkg is removed due to dependency (RhBug:1244755) (Jaroslav + Mracek) +- Unify format of %%{_mandir} paths in dnf.spec (Jaroslav Mracek) +- Remove test_yumlayer.py as unneeded test (Jaroslav Mracek) +- Provide yum4 package for rhel7 build (Jaroslav Mracek) +- Make yum compatible layer very minimal (RhBug:1476748) (Jaroslav Mracek) +- Remove metadata_expire from yum compatible layer (Jaroslav Mracek) +- Remove keepcache from yum compatibility layer (Jaroslav Mracek) +- Remove options from yum conf (Jaroslav Mracek) +- Remove unused functionality from yum compatible layer (Jaroslav Mracek) +- Add deplist command for dnf (Jaroslav Mracek) +- Fix problems with --downloaddir options (RhBug:1476464) (Jaroslav Mracek) +- Move description of --forcearch into proper place (Jaroslav Mracek) +- Provide description of --downloaddir option (Jaroslav Mracek) +- Fix if in spec file (Jaroslav Mracek) +- Add description of "test" tsflags (Jaroslav Mracek) +- Enable import gpg_keys with tsflag test (RhBug:1464192) (Jaroslav Mracek) +- Keep old reason when undoing erase (RhBug:1463107) (Eduard Čuba) +- spec: eliminate other weak dependencies for el<=7 (Igor Gnatenko) +- spec: do not strongly require inhibit plugin (Igor Gnatenko) +- Inform that packages are only downloaded (RhBug:1426196) (Jaroslav Mracek) +- Move releasever check after the etc/dnf/vars substitutions. (Alexander + Kanavin) +- Provide substitution for Repodict.add_new_repo() (RhBug:1457507) (Jaroslav + Mracek) + * Tue Aug 01 2017 Igor Gnatenko - 2.6.2-3 - Unblock libguestfs builds due to regression here diff --git a/sources b/sources index b2112be..d227edf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dnf-2.6.2.tar.gz) = 57b9a415eaf2a00265ea62f16e09f773f70788996cfce6823950a5f40133e72586c2f189c2b117b6ebf2a23667de0c4b9a4dafbfe318746a1ebd27b976fcafbe +SHA512 (dnf-2.6.3.tar.gz) = 9926790479d61b4a3400c416cb3a06b7f5bbeb081a0be05616db8c246cf535f748de4d56983a97583d71757802d78c56fbe70f639e683158613a724d03cb6eba