[yum] Added debuglevel option to yum-cron.conf BZ 873428, 982088
Zdeněk Pavlas
zpavlas at fedoraproject.org
Wed Jul 24 12:29:25 UTC 2013
commit 5ad230146e81403accc71b2b89de0583a30bdc56
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date: Wed Jul 24 14:29:09 2013 +0200
Added debuglevel option to yum-cron.conf BZ 873428, 982088
- RepoMD: support loading/dumping of <delta>s.
yum-HEAD.patch | 102 ++++++++++++++++++++++++++++++++++++++++++++++---------
yum.spec | 6 +++-
2 files changed, 90 insertions(+), 18 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index aeacfe2..507fe01 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -2699,7 +2699,7 @@ index 0000000..2af059d
+ the mailing list, yum at lists.baseurl.org, or consult bugzilla.
+.fi
diff --git a/docs/yum.8 b/docs/yum.8
-index 1a8202a..716e211 100644
+index 1a8202a..39dcbb8 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -25,6 +25,8 @@ gnome\-packagekit application\&.
@@ -3265,7 +3265,18 @@ index 1a8202a..716e211 100644
options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
.br
Configuration Option: \fBrpmverbosity\fP
-@@ -461,8 +783,13 @@ processing logic. For more information see the \fBupdate\fP command above.
+@@ -428,9 +750,7 @@ Configuration Option: \fBrpmverbosity\fP
+ Sets the maximum amount of time yum will wait before performing a command \- it randomizes over the time.
+ .IP "\fB\-C, \-\-cacheonly\fP"
+ Tells yum to run entirely from system cache - does not download or
+-update any headers unless it has to to perform the requested action. If you're
+-using this as a user yum will not use the tempcache for the user but will only
+-use the system cache in the system cachedir.
++update any headers unless it has to to perform the requested action.
+ .IP "\fB\-\-version\fP"
+ Reports the \fByum\fP version number and installed package versions for
+ everything in history_record_packages (can be added to by plugins).
+@@ -461,8 +781,13 @@ processing logic. For more information see the \fBupdate\fP command above.
.br
Configuration Option: \fBobsoletes\fP
.IP "\fB\-x, \-\-exclude=package\fP"
@@ -3281,7 +3292,7 @@ index 1a8202a..716e211 100644
.br
.IP "\fB\-\-color=[always|auto|never]\fP"
Display colorized output automatically, depending on the output terminal,
-@@ -506,7 +833,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
+@@ -506,7 +831,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
configuration to stop this).
.PP
.IP "\fB\-t, \-\-tolerant\fP"
@@ -3297,7 +3308,7 @@ index 1a8202a..716e211 100644
.br
.IP "\fB\-\-setopt=option=value\fP"
Set any config option in yum config or repo files. For options in the global
-@@ -523,7 +857,7 @@ version of the package\&.
+@@ -523,7 +855,7 @@ version of the package\&.
The format of the output of yum list is:
@@ -3306,7 +3317,7 @@ index 1a8202a..716e211 100644
.IP "\fByum list [all | glob_exp1] [glob_exp2] [\&.\&.\&.]\fP"
List all available and installed packages\&.
-@@ -542,6 +876,10 @@ shell\-style glob and any matches are printed\&.
+@@ -542,6 +874,10 @@ shell\-style glob and any matches are printed\&.
List the packages installed on the system that are not available in any yum
repository listed in the config file.
.IP
@@ -4179,10 +4190,10 @@ index 0000000..3d4392d
+mdpolicy = group:main
diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf
new file mode 100644
-index 0000000..3fc756e
+index 0000000..56940ff
--- /dev/null
+++ b/etc/yum-cron.conf
-@@ -0,0 +1,70 @@
+@@ -0,0 +1,76 @@
+[commands]
+# What kind of update to use:
+# default = yum upgrade
@@ -4249,6 +4260,12 @@ index 0000000..3fc756e
+group_package_types = mandatory, default
+
+[base]
++# Use this to filter Yum core messages
++# -4: critical
++# -3: critical+errors
++# -2: critical+errors+warnings (default)
++debuglevel = -2
++
+# override yum options of the same name
+# skip_broken = True
+
@@ -184078,10 +184095,10 @@ index 0000000..28e1964
+- Check if we're running as root; exit nicely.
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
new file mode 100755
-index 0000000..26526b7
+index 0000000..74eb6d7
--- /dev/null
+++ b/yum-cron/yum-cron.py
-@@ -0,0 +1,1124 @@
+@@ -0,0 +1,1123 @@
+#!/usr/bin/python -tt
+import os
+import sys
@@ -184793,6 +184810,7 @@ index 0000000..26526b7
+ group_list = ListOption([])
+ group_package_types = ListOption(['mandatory', 'default'])
+ skip_broken = BoolOption()
++ debuglevel = IntOption(-2, -4, 10)
+
+
+class YumCronBase(yum.YumBase):
@@ -184876,14 +184894,12 @@ index 0000000..26526b7
+ try :
+ # Set the configuration file
+ self.preconf.fn = self.opts.yum_config_file
++ self.preconf.debuglevel = self.opts.debuglevel
+
+ # if we are not root do the special subdir thing
+ if os.geteuid() != 0:
+ self.setCacheDir()
+
-+ # Turn off the plugins line
-+ self.preconf.debuglevel = 0
-+
+ # Create the configuration
+ self.conf
+
@@ -194547,7 +194563,7 @@ index 0000000..cbb070f
+
+ return returns.values()
diff --git a/yum/logginglevels.py b/yum/logginglevels.py
-index 14c5e73..dfdd90c 100644
+index 14c5e73..8a811ae 100644
--- a/yum/logginglevels.py
+++ b/yum/logginglevels.py
@@ -42,7 +42,7 @@ logging.addLevelName(DEBUG_3, "DEBUG_3")
@@ -194559,6 +194575,17 @@ index 14c5e73..dfdd90c 100644
__NO_LOGGING = 100
logging.raiseExceptions = False
+@@ -87,7 +87,9 @@ def logLevelFromErrorLevel(error_level):
+
+ def logLevelFromDebugLevel(debug_level):
+ """ Convert an old-style debug logging level to the new style. """
+- debug_table = {-1 : __NO_LOGGING, 0 : logging.INFO, 1 : INFO_1, 2 : INFO_2,
++ debug_table = {
++ -4 : logging.CRITICAL, -3 : logging.ERROR, -2 : logging.WARNING,
++ -1 : __NO_LOGGING, 0 : logging.INFO, 1 : INFO_1, 2 : INFO_2,
+ 3 : logging.DEBUG, 4 : DEBUG_1, 5 : DEBUG_2, 6 : DEBUG_3, 7 : DEBUG_4}
+
+ return __convertLevel(debug_level, debug_table)
diff --git a/yum/metalink.py b/yum/metalink.py
index aaa4f25..a2c5135 100755
--- a/yum/metalink.py
@@ -196080,7 +196107,7 @@ index bfc49b7..a10e4fb 100644
b = parsever(b)
diff --git a/yum/repoMDObject.py b/yum/repoMDObject.py
-index 31b1080..88b82dc 100755
+index 31b1080..97e6797 100755
--- a/yum/repoMDObject.py
+++ b/yum/repoMDObject.py
@@ -15,6 +15,7 @@
@@ -196091,7 +196118,48 @@ index 31b1080..88b82dc 100755
from Errors import RepoMDError
import sys
-@@ -133,6 +134,7 @@ class RepoMD:
+@@ -38,6 +39,7 @@ class RepoData:
+ self.dbversion = None
+ self.size = None
+ self.opensize = None
++ self.deltas = []
+
+ if elem:
+ self.parse(elem)
+@@ -69,6 +71,10 @@ class RepoData:
+ self.size = child.text
+ elif child_name == 'open-size':
+ self.opensize = child.text
++ elif child_name == 'delta':
++ delta = RepoData(child)
++ delta.type = self.type
++ self.deltas.append(delta)
+
+ def dump_xml(self):
+ msg = ""
+@@ -102,10 +108,21 @@ class RepoData:
+ xmlname)
+ msg += d_xml
+
++ for delta in self.deltas:
++ # change tag to "delta" and increase indent
++ body = '\n '.join(delta.dump_xml().split('\n')[1:-2])
++ msg += ' <delta>\n %s\n </delta>\n' % body
++
+ bottom = """</data>\n"""
+ msg += bottom
+ return msg
+
++ def getDelta(self, old_timestamp):
++ old_timestamp = int(old_timestamp)
++ for deltamd in self.deltas:
++ if int(deltamd.timestamp) <= old_timestamp:
++ return deltamd
++
+ class RepoMD:
+ """represents the repomd xml file"""
+
+@@ -133,6 +150,7 @@ class RepoMD:
else:
# srcfile is a file object
infile = srcfile
@@ -196099,7 +196167,7 @@ index 31b1080..88b82dc 100755
# We trust any of these to mean the repomd.xml is valid.
infile = AutoFileChecksums(infile, ['sha256', 'sha512'],
-@@ -145,6 +147,13 @@ class RepoMD:
+@@ -145,6 +163,13 @@ class RepoMD:
if elem_name == "data":
thisdata = RepoData(elem=elem)
@@ -196113,7 +196181,7 @@ index 31b1080..88b82dc 100755
self.repoData[thisdata.type] = thisdata
try:
nts = int(thisdata.timestamp)
-@@ -225,13 +234,19 @@ class RepoMD:
+@@ -225,13 +250,19 @@ class RepoMD:
for item in self.tags['repo']:
tag = """ <repo>%s</repo>\n""" % (to_xml(item))
tags += tag
diff --git a/yum.spec b/yum.spec
index 9e41f42..aa2cf6d 100644
--- a/yum.spec
+++ b/yum.spec
@@ -41,7 +41,7 @@ BuildRequires: bash-completion
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 102%{?dist}
+Release: 103%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -403,6 +403,10 @@ exit 0
%endif
%changelog
+* Thu Jul 18 2013 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-103
+- Added debuglevel option to yum-cron.conf BZ 873428, 982088
+- RepoMD: support loading/dumping of <delta>s.
+
* Thu Jul 18 2013 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-102
- Preload from root cache when --cacheonly. BZ 830523, 903631
More information about the scm-commits
mailing list