---
 docs/yum.conf.5 | 16 ++++++++++++++--
 yum/config.py   |  2 ++
 yum/drpm.py     |  2 +-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index f9a924a..850b8be 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -378,6 +378,12 @@ When non-zero, delta-RPM files are used if available.  The 
value specifies
 the maximum number of "applydeltarpm" processes Yum will spawn. (4 by default).
 
 .IP
+\fBdeltarpm_percentage\fR
+
+When the relative size of delta vs pkg is larger than this, delta is not used.
+Default value is 75 (Deltas must be at least 25% smaller than the pkg).
+
+.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
@@ -937,12 +943,18 @@ Overrides the \fBip_resolve\fR option from the [main] 
section for this
 repository.
 
 .IP
-\fBpresto\fR
+\fBdeltarpm\fR
 
-Overrides the \fBpresto\fR option from the [main] section for this
+Overrides the \fBdeltarpm\fR option from the [main] section for this
 repository.
 
 .IP
+\fBdeltarpm_percentage\fR
+
+Overrides the \fBdeltarpm_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 d2ca937..d689ce2 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -792,6 +792,7 @@ class YumConf(StartupConf):
             mapper  = {'4': 'ipv4', '6': 'ipv6'})
     max_connections = IntOption(0)
     deltarpm = IntOption(4)
+    deltarpm_percentage = IntOption(75)
 
     http_caching = SelectionOption('all', ('none', 'packages', 'all'))
     metadata_expire = SecondsOption(60 * 60 * 6) # Time in seconds (6h).
@@ -951,6 +952,7 @@ class RepoConf(BaseConfig):
     timeout = Inherit(YumConf.timeout)
     ip_resolve = Inherit(YumConf.ip_resolve)
     deltarpm = Inherit(YumConf.deltarpm)
+    deltarpm_percentage = Inherit(YumConf.deltarpm_percentage)
 
     http_caching = Inherit(YumConf.http_caching)
     metadata_expire = Inherit(YumConf.metadata_expire)
diff --git a/yum/drpm.py b/yum/drpm.py
index 5b37c51..8536e4b 100644
--- a/yum/drpm.py
+++ b/yum/drpm.py
@@ -137,7 +137,7 @@ class DeltaInfo:
                 index = pinfo_repo.get(new)
                 if index is not None:
                     po = pkgs[index]
-                    best = po.size * 0.75 # make this configurable?
+                    best = po.size * (repo.deltarpm_percentage / 100.0)
                     have = installed(new[:2]) or []
                     for el in el.findall('delta'):
                         size = int(el.find('size').text)
-- 
1.7.11.7

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to