From 4ae170f7f9dd0c8d701d290d89704f6256aa4ccf Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 21 Jun 2011 14:33:54 +0200 Subject: [PATCH] [server] eit: add more wrapped options --- server/eit | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/server/eit b/server/eit index bd31bee12..c8d164a40 100755 --- a/server/eit +++ b/server/eit @@ -32,30 +32,34 @@ ACTIVATOR_EXEC = "/usr/sbin/activator" help_opts = [ None, - (0, " ~ reagent ~ ", 1, + (0, " ~ eit ~ ", 1, 'Entropy Server Commands Wrapper - (C) %s' % ( entropy.tools.get_year(),) ), None, (0, _('Options'), 0, None), None, + (1, 'add ', 3, _('commit to current repository only the provided packages')), (1, 'checkout ', 2, _('switch from a repository to another')), (1, 'commit []', 2, _('commit changes to repository')), - (1, 'cp [packages]', 1, _('copy packages from a repository to another')), + (1, 'cp ', 1, _('copy packages from a repository to another')), + (1, 'deps ', 3, _('edit package dependencies')), + (1, 'fit ', 2, _('inject package files into the current repository')), (1, 'log []', 2, _('show log for repository')), - (1, 'mv [packages]', 1, _('move packages from a repository to another')), + (1, 'mv ', 1, _('move packages from a repository to another')), (1, 'push []', 2, _('push committed packages remotely')), (1, 'repo', 4, _('show current repository')), - (1, 'rm [packages]', 3, _('remove packages from current repository')), + (1, 'rm ', 3, _('remove packages from current repository')), + (1, 'search ', 2, _('search for privided package dependencies')), + (1, 'show ', 2, _('show matches for privided package dependencies')), (1, 'status []', 2, _('show current repositories status')), None, ] # TODO: -# - selectively add packages to repository ? => add -# - edit package dependencies ? => edit # - reset repository to remote status ? => reset # - branch repository ? => branch # - diff? +# - reagent options? options = sys.argv[1:] @@ -83,6 +87,9 @@ if main_cmd == "status": os.environ['ETP_REPO'] = options.pop(0) _exec_args([REAGENT_EXEC, "status"] + options) +elif main_cmd == "add" and options: + _exec_args([REAGENT_EXEC, "update", "--atoms"] + options) + elif (main_cmd == "checkout") and options and len(options) < 2: repository_id = options.pop(0) _exec_args((REAGENT_EXEC, "repo", "default", repository_id)) @@ -92,11 +99,20 @@ elif main_cmd == "commit": os.environ['ETP_REPO'] = options.pop(0) _exec_args([REAGENT_EXEC, "update"] + options) +elif main_cmd == "fit" and options: + _exec_args([REAGENT_EXEC, "inject"] + options) + elif main_cmd == "push": if options: os.environ['ETP_REPO'] = options.pop(0) _exec_args([ACTIVATOR_EXEC, "sync"] + options) +elif main_cmd == "show" and options: + _exec_args([REAGENT_EXEC, "query", "match"] + options) + +elif main_cmd == "search" and options: + _exec_args([REAGENT_EXEC, "query", "search"] + options) + elif main_cmd == "mv" and len(options) > 2: from_repo = options.pop(0) to_repo = options.pop(0) @@ -107,6 +123,19 @@ elif main_cmd == "cp" and len(options) > 2: to_repo = options.pop(0) _exec_args([REAGENT_EXEC, "repo", "copy", from_repo, to_repo] + options) +elif main_cmd == "deps" and options: + server = None + repository_id = None + try: + server = get_entropy_server(quiet = True) + # get current repository id + repository_id = server.repository() + finally: + if server is not None: + server.shutdown() + + _exec_args([REAGENT_EXEC, "repo", "package-dep", repository_id] + options) + elif main_cmd == "rm" and options: _exec_args([REAGENT_EXEC, "repo", "remove"] + options) @@ -149,4 +178,4 @@ elif main_cmd == "log": else: print_menu(help_opts) - raise SystemExit(1) \ No newline at end of file + raise SystemExit(1)