Bugfix update 1.1.7-2

This commit is contained in:
Michal Luscon 2016-03-03 13:44:20 +01:00
parent 7b59b46ec6
commit 91c781c1a2
3 changed files with 117 additions and 1 deletions

View File

@ -11,12 +11,14 @@
Name: dnf
Version: 1.1.7
Release: 1%{?snapshot}%{?dist}
Release: 2%{?snapshot}%{?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
URL: https://github.com/rpm-software-management/dnf
Source0: https://github.com/rpm-software-management/dnf/archive/%{name}-%{version}.tar.gz
Patch0: restore-basearch-needed-by-koji.patch
Patch1: fix-empty-history-cmd.patch
BuildArch: noarch
BuildRequires: cmake
BuildRequires: gettext
@ -138,6 +140,8 @@ Alternative CLI to "dnf upgrade" suitable for automatic, regular execution.
%prep
%setup -q -n dnf-%{version}
%patch0 -p1
%patch1 -p1
rm -rf py3
mkdir ../py3
cp -a . ../py3/
@ -285,6 +289,10 @@ exit 0
%systemd_postun_with_restart dnf-automatic.timer
%changelog
* Thu Mar 03 2016 Michal Luscon <mluscon@redhat.com> 1.1.7-2
- restore basearch() needed by koji
- fix empty history cmd
* Thu Feb 25 2016 Michal Luscon <mluscon@redhat.com> 1.1.7-1
- Add `/etc/distro.repos.d` as a path owned by the dnf package (Neal Gompa
(ニール・ゴンパ))

View File

@ -0,0 +1,25 @@
From 84557105cc1253d49bdacf99226b89bcef4096ab Mon Sep 17 00:00:00 2001
From: Michal Luscon <mluscon@redhat.com>
Date: Mon, 7 Mar 2016 15:33:00 +0100
Subject: [PATCH] history: fix empty history cmd (RhBug:1313215)
---
dnf/cli/commands/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/cli/commands/__init__.py b/dnf/cli/commands/__init__.py
index e85f65f..d274e0c 100644
--- a/dnf/cli/commands/__init__.py
+++ b/dnf/cli/commands/__init__.py
@@ -1049,7 +1049,7 @@ class HistoryCommand(Command):
def configure(self, args):
demands = self.cli.demands
- if args[0] in ['redo', 'undo', 'rollback']:
+ if args and args[0] in ['redo', 'undo', 'rollback']:
demands.available_repos = True
else:
demands.fresh_metadata = False
--
2.7.0

View File

@ -0,0 +1,83 @@
From c8c98c8b70577674b606e7b05430ac3c6cb4d15c Mon Sep 17 00:00:00 2001
From: Michal Luscon <mluscon@redhat.com>
Date: Thu, 3 Mar 2016 12:10:50 +0100
Subject: [PATCH] arch: restore basearch needed by koji
---
dnf/arch.py | 33 +++++++++++++++++++++++++++++++++
dnf/exceptions.py | 4 ++++
dnf/logging.py | 3 +++
3 files changed, 40 insertions(+)
create mode 100644 dnf/arch.py
diff --git a/dnf/arch.py b/dnf/arch.py
new file mode 100644
index 0000000..5df4753
--- /dev/null
+++ b/dnf/arch.py
@@ -0,0 +1,33 @@
+# arch.py
+# Manipulating the machine architecture string.
+#
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# the GNU General Public License v.2, or (at your option) any later version.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY expressed or implied, including the implied warranties of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details. You should have received a copy of the
+# GNU General Public License along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
+# source code or documentation are not subject to the GNU General Public
+# License and may only be used or replicated with the express permission of
+# Red Hat, Inc.
+#
+
+import dnf
+import sys
+
+def basearch(arch):
+ msg = 'The dnf.arch.basearch function is not a part of DNF API ' \
+ 'and will be removed in the upcoming DNF release. ' \
+ 'Please use dnf.rpm.basearch instead. ' \
+ 'DNF API documentation is available at ' \
+ 'https://dnf.readthedocs.org/en/latest/api.html.\n'
+ dnf.logging.nonapi(msg)
+ sys.stdout.write(msg)
+ sys.stderr.write(msg)
+ return dnf.rpm.basearch(arch)
diff --git a/dnf/exceptions.py b/dnf/exceptions.py
index aafb898..60b07a6 100644
--- a/dnf/exceptions.py
+++ b/dnf/exceptions.py
@@ -26,6 +26,10 @@ class DeprecationWarning(DeprecationWarning):
pass
+class NonApiWarning(DeprecationWarning):
+ pass
+
+
class Error(Exception):
"""Base Error. All other Errors thrown by DNF should inherit from this.
diff --git a/dnf/logging.py b/dnf/logging.py
index 362ece4..e3ace6a 100644
--- a/dnf/logging.py
+++ b/dnf/logging.py
@@ -103,6 +103,9 @@ def _paint_mark(logger):
def depr(msg):
warnings.warn(msg, dnf.exceptions.DeprecationWarning, 2)
+def nonapi(msg):
+ warnings.warn(msg, dnf.exceptions.NonApiWarning, 2)
+
class Logging(object):
def __init__(self):
--
2.7.0