[yum-cvs] docs/yum.conf.5 yum/config.py

James Antill james at linux.duke.edu
Tue Dec 11 01:30:46 UTC 2007


 docs/yum.conf.5 |    5 ++++-
 yum/config.py   |   10 +++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 707f84e41561aff103b6b99838a46e592f9538f3
Author: James Antill <james at and.org>
Date:   Mon Dec 10 20:27:38 2007 -0500

     Compat. fix for -1 seconds usage, document that behaviour.

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index f521cf5..bef23e9 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -246,11 +246,14 @@ yum is not downloading information on updates as often as you would like
 lower the value of this option. You can also change from the default of using
 seconds to using days, hours or minutes by appending a d, h or m respectivley.
 The default is 1.5 hours, to compliment yum-updatesd running once an hour.
+It's also possible to use the word "never", meaning that the metadata will
+never expire.
 
 .IP \fBmirrorlist_expire \fR
 Time (in seconds) after which the mirrorlist locally cached will expire. 
 If the current mirrorlist is less than this many seconds old then yum
-will not download another copy of the mirrorlist
+will not download another copy of the mirrorlist, it has the same extra format
+as metadata_expire.
 If you find that yum is not downloading the mirrorlists as 
 often as you would like lower the value of this option.
 
diff --git a/yum/config.py b/yum/config.py
index 1d1a493..0162336 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -233,10 +233,12 @@ class SecondsOption(Option):
 
     """
     An option representing an integer value of seconds, or a human readable
-    variation specifying days, hours, minutes or seconds.
-    Works like BytesOption.
+    variation specifying days, hours, minutes or seconds until something
+    happens. Works like BytesOption.
+    Note that due to historical president -1 means "never", so this accepts
+    that and allows the word never too.
 
-    Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1
+    Valid inputs: 100, 1.5m, 90s, 1.2d, 1d, 0xF, 0.1, -1, never
     Invalid inputs: -10, -0.1, 45.6Z, 1d6h, 1day, 1y
 
     Return value will always be an integer
@@ -247,6 +249,8 @@ class SecondsOption(Option):
         if len(s) < 1:
             raise ValueError("no value specified")
 
+        if s == "-1" or s == "never": # Special cache timeout, meaning never
+            return -1
         if s[-1].isalpha():
             n = s[:-1]
             unit = s[-1].lower()



More information about the Yum-cvs-commits mailing list