Permalink
Browse files

Merge pull request #678 from poundbangbash/refresh-cache-2

Added subcommand refresh-cache
  • Loading branch information...
gregneagle committed Oct 21, 2016
2 parents 4c8ed8f + 69af0ba commit 5a1007b7eea0bc11874093bcd9e8b6eb5696d0d0
Showing with 20 additions and 0 deletions.
  1. +20 −0 code/client/manifestutil
@@ -1102,6 +1102,25 @@ def remove_included_manifest(args):
return 1 # Operation not permitted


def refresh_cache(args):
'''Refreshes the repo data if changes were made while manifestutil was running. Updates manifests, catalogs, and packages.'''
parser = MyOptionParser()
parser.set_usage('''refresh-cache
Refreshes the repo data''')
try:
_, arguments = parser.parse_args(args)
except MyOptParseError, errmsg:
print >> sys.stderr, str(errmsg)
return 22 # Invalid argument

if len(arguments) != 0:
parser.print_usage(sys.stderr)
return 22 # Invalid argument
CMD_ARG_DICT['manifests'] = get_manifest_names()
CMD_ARG_DICT['catalogs'] = get_catalogs()
CMD_ARG_DICT['pkgs'] = get_installer_item_names(get_catalogs())


def show_help():
'''Prints available subcommands'''
print "Available sub-commands:"
@@ -1212,6 +1231,7 @@ def main():
'new-manifest': 'default',
'copy-manifest': 'manifests',
'rename-manifest': 'manifests',
'refresh-cache': 'default',
'exit': 'default',
'help': 'default',
'configure': 'default',

0 comments on commit 5a1007b

Please sign in to comment.