[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17306: {updater} Add a --force-check option to make the client download a new (updater/trunk/lib/thandy)



Author: nickm
Date: 2008-11-16 20:48:56 -0500 (Sun, 16 Nov 2008)
New Revision: 17306

Modified:
   updater/trunk/lib/thandy/ClientCLI.py
   updater/trunk/lib/thandy/repository.py
Log:
Add a --force-check option to make the client download a new timestamp file whether it is too old or not.  Crank the maximum timestamp age down to 3 hours.

Modified: updater/trunk/lib/thandy/ClientCLI.py
===================================================================
--- updater/trunk/lib/thandy/ClientCLI.py	2008-11-17 01:41:01 UTC (rev 17305)
+++ updater/trunk/lib/thandy/ClientCLI.py	2008-11-17 01:48:56 UTC (rev 17306)
@@ -20,13 +20,14 @@
                                               "loop", "no-packagesys",
                                               "install", "socks-port=",
                                               "debug", "info",
-                                              "warn"])
+                                              "warn", "force-check"])
     download = True
     keep_looping = False
     use_packagesys = True
     install = False
     socksPort = None
     logLevel = logging.INFO
+    forceCheck = False
 
     for o, v in options:
         if o == '--repo':
@@ -47,6 +48,8 @@
             logLevel = logging.INFO
         elif o == '--warn':
             logLevel = logging.WARN
+        elif o == '--force-check':
+            forceCheck = True
 
     logging.basicConfig(level=logLevel)
 
@@ -69,6 +72,10 @@
                                       pkgSystems=packagesys,
                                       installableDict=installable)
 
+        if forceCheck:
+            files.add("/meta/timestamp.txt")
+            forceCheck = False
+
         if installable and not files:
             logging.info("Ready to install files: %s",
                            ", ".join(sorted(installable.keys())))

Modified: updater/trunk/lib/thandy/repository.py
===================================================================
--- updater/trunk/lib/thandy/repository.py	2008-11-17 01:41:01 UTC (rev 17305)
+++ updater/trunk/lib/thandy/repository.py	2008-11-17 01:48:56 UTC (rev 17306)
@@ -13,7 +13,7 @@
 import threading
 import time
 
-MAX_TIMESTAMP_AGE = 24*60*60
+MAX_TIMESTAMP_AGE = 3*60*60
 
 class RepositoryFile:
     """Represents information about a file stored in our local repository