From 2d4c7b454966f6dcf4fec80b76d945b3d7302055 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 26 Mar 2013 12:41:22 +0800 Subject: [PATCH] Readded the option to update the mirrored repo --- lib/commands/update.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/commands/update.py b/lib/commands/update.py index aceff6d..2e44755 100644 --- a/lib/commands/update.py +++ b/lib/commands/update.py @@ -39,6 +39,13 @@ class UpdateCommand(Command): } ), ( + ['-c', '--cached'], + { + 'action': 'store_true', + 'help': 'only update the cached (mirrored) repositories' + } + ), + ( ['-i', '--integration'], { 'action': 'store_true', @@ -76,6 +83,10 @@ class UpdateCommand(Command): def run(self, args): + if args.cached: + self.updateCached() + return + # Updating instances names = args.names if args.all: @@ -87,9 +98,7 @@ class UpdateCommand(Command): if len(Mlist) < 1: raise Exception('No instances to work on. Exiting...') - # Updating cache - print 'Updating cached repositories' - self.Wp.updateCachedClones(verbose=False) + self.updateCached() errors = [] @@ -119,3 +128,8 @@ class UpdateCommand(Command): logging.warning('- %s' % M.get('identifier')) # Remove sys.exit and handle error code sys.exit(1) + + def updateCached(self): + # Updating cache + print 'Updating cached repositories' + self.Wp.updateCachedClones(verbose=False) -- 2.11.0