[yum-commits] 2 commits - docs/yum.8 docs/yum.conf.5 yum/config.py yum/drpm.py

James Antill james at osuosl.org
Thu Nov 21 14:40:27 UTC 2013


 docs/yum.8      |    5 +++--
 docs/yum.conf.5 |   14 ++++++++++++++
 yum/config.py   |    6 ++++++
 yum/drpm.py     |    9 +++++++--
 4 files changed, 30 insertions(+), 4 deletions(-)

New commits:
commit 6e193f4bc67fcc9fdf4e872d8b6d8a282b63be12
Author: James Antill <james at and.org>
Date:   Thu Nov 21 09:39:43 2013 -0500

    Fix the man page formatting for ! explanation in repolist, so it can be read.

diff --git a/docs/yum.8 b/docs/yum.8
index 2cbdf72..0914765 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -397,9 +397,10 @@ You can pass repo id or name arguments, or wildcards which to match against
 both of those. However if the id or name matches exactly then the repo will
 be listed even if you are listing enabled repos. and it is disabled.
 
-In non-verbose mode the first column will start with a '*' if the repo. has
+In non-verbose mode the first column will start with a \'*\' if the repo. has
 metalink data and the latest metadata is not local and will start with a
-'!' if the repo. has metadata that is expired. For non-verbose mode the
+\'!\' if the repo. has metadata that is expired (this can happen due to
+metadata_expire_filter). For non-verbose mode the
 last column will also display the number of packages in the repo. and (if there
 are any user specified excludes) the number of packages excluded.
 
commit 977a79be0f79069febde1ad81d8c71d240d08605
Author: James Antill <james at and.org>
Date:   Tue Nov 19 14:28:03 2013 -0500

    Add deltarpm_metadata_percentage config. so people can configure MD downloads.

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 6fae41d..4e79298 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -420,6 +420,15 @@ Use `0' to turn off delta rpm processing. Local repositories (with file://
 baseurl) have delta rpms turned off by default.
 
 .IP
+\fBdeltarpm_metadata_percentage\fR
+When the relative size of deltarpm metadata vs pkgs is larger than this,
+deltarpm metadata is not downloaded from the repo.
+Default value is 100 (Deltarpm metadata must be smaller than the packages from
+the repo). Note that you can give values over 100, so 200 means that the
+metadata is required to be half the size of the packages.
+Use `0' to turn off this check, and always download metadata.
+
+.IP
 \fBsslcacert \fR
 Path to the directory containing the databases of the certificate authorities
 yum should use to verify SSL certificates. Defaults to none - uses system
@@ -1043,6 +1052,11 @@ Overrides the \fBdeltarpm_percentage\fR option from the [main] section
 for this repository.
 
 .IP
+\fBdeltarpm_metadata_percentage\fR
+Overrides the \fBdeltarpm_metadata_percentage\fR option from the [main] section
+for this repository.
+
+.IP
 \fBsslcacert \fR
 Overrides the \fBsslcacert\fR option from the [main] section for this
 repository.
diff --git a/yum/config.py b/yum/config.py
index cdad4bc..b891f82 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -805,6 +805,7 @@ class YumConf(StartupConf):
     max_connections = IntOption(0, range_min=0)
     deltarpm = IntOption(2, range_min=-16, range_max=128)
     deltarpm_percentage = IntOption(75, range_min=0, range_max=100)
+    deltarpm_metadata_percentage = IntOption(100, range_min=0)
 
     http_caching = SelectionOption('all', ('none', 'packages', 'all'))
     metadata_expire = SecondsOption(60 * 60 * 6) # Time in seconds (6h).
@@ -977,7 +978,12 @@ class RepoConf(BaseConfig):
     throttle = Inherit(YumConf.throttle)
     timeout = Inherit(YumConf.timeout)
     ip_resolve = Inherit(YumConf.ip_resolve)
+    #  This isn't inherited so that we can automatically disable file:// _only_
+    # repos. if they haven't set an explicit deltarpm_percentage for the repo.
     deltarpm_percentage = IntOption(None, range_min=0, range_max=100)
+    #  Rely on the above config. to do automatic disabling, and thus. no hack
+    # needed here.
+    deltarpm_metadata_percentage = Inherit(YumConf.deltarpm_metadata_percentage)
 
     http_caching = Inherit(YumConf.http_caching)
     metadata_expire = Inherit(YumConf.metadata_expire)
diff --git a/yum/drpm.py b/yum/drpm.py
index 1fd7a11..42bf70e 100644
--- a/yum/drpm.py
+++ b/yum/drpm.py
@@ -168,8 +168,13 @@ class DeltaInfo:
                 self.verbose_logger.info(_('No Presto metadata available for %s'), repo)
                 continue
             path = repo.cachedir +'/'+ os.path.basename(data.location[1])
-            if not os.path.exists(path) and int(data.size) > reposize[repo]:
-                self.verbose_logger.info(_('Not downloading Presto metadata for %s'), repo)
+            perc = repo.deltarpm_metadata_percentage
+            data_size = int(data.size) * (perc / 100.0)
+            if perc and not os.path.exists(path) and data_size > reposize[repo]:
+                msg = _('Not downloading deltainfo for %s, MD is %s and rpms are %s')
+                self.verbose_logger.info(msg, repo,
+                                         progress.format_number(data_size),
+                                         progress.format_number(reposize[repo]))
                 continue
 
             def failfunc(e, name=name, repo=repo):


More information about the Yum-commits mailing list