From f1b79ebf1ff0df76c07e21a58dddc4f1840015d2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 17 Nov 2008 01:48:56 +0000 Subject: 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. git-svn-id: file:///home/or/svnrepo/updater/trunk@17306 55e972cd-5a19-0410-ae62-a4d7a52db4cd --- lib/thandy/ClientCLI.py | 9 ++++++++- lib/thandy/repository.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/thandy/ClientCLI.py b/lib/thandy/ClientCLI.py index 05f3647..3a8b760 100644 --- a/lib/thandy/ClientCLI.py +++ b/lib/thandy/ClientCLI.py @@ -20,13 +20,14 @@ def update(args): "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 @@ def update(args): logLevel = logging.INFO elif o == '--warn': logLevel = logging.WARN + elif o == '--force-check': + forceCheck = True logging.basicConfig(level=logLevel) @@ -69,6 +72,10 @@ def update(args): 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()))) diff --git a/lib/thandy/repository.py b/lib/thandy/repository.py index 6378586..ad0fe4d 100644 --- a/lib/thandy/repository.py +++ b/lib/thandy/repository.py @@ -13,7 +13,7 @@ import os 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 -- cgit v1.2.3