mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-serve: Change syntax for setting keywords
Instead of `config <pkgbase> keywords <keyword1> <keyword2>...`, the new syntax is `set-keywords <pkgbase> <keyword1> <keyword2>...`. The `config` keyword was rather general and it was not obvious that it could be used to change package base settings. Instead of replacing it with an even more verbose expression, remove that unnecessary level of indirection. Since we do not (and probably never will) support keywords anywhere else, the chance of name conflicts is small. Suggested-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
64072461df
commit
dc41a5afa5
1 changed files with 10 additions and 17 deletions
|
@ -88,7 +88,7 @@ def create_pkgbase(pkgbase, user):
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
|
||||||
def pkgbase_config_keywords(pkgbase, keywords):
|
def pkgbase_set_keywords(pkgbase, keywords):
|
||||||
pkgbase_id = pkgbase_from_name(pkgbase)
|
pkgbase_id = pkgbase_from_name(pkgbase)
|
||||||
if not pkgbase_id:
|
if not pkgbase_id:
|
||||||
die('{:s}: package base not found: {:s}'.format(action, pkgbase))
|
die('{:s}: package base not found: {:s}'.format(action, pkgbase))
|
||||||
|
@ -173,17 +173,10 @@ if action == 'git-upload-pack' or action == 'git-receive-pack':
|
||||||
os.environ["GIT_NAMESPACE"] = pkgbase
|
os.environ["GIT_NAMESPACE"] = pkgbase
|
||||||
cmd = action + " '" + repo_path + "'"
|
cmd = action + " '" + repo_path + "'"
|
||||||
os.execl(git_shell_cmd, git_shell_cmd, '-c', cmd)
|
os.execl(git_shell_cmd, git_shell_cmd, '-c', cmd)
|
||||||
elif action == 'config':
|
elif action == 'set-keywords':
|
||||||
if len(cmdargv) < 2:
|
if len(cmdargv) < 2:
|
||||||
die_with_help("{:s}: missing repository name".format(action))
|
die_with_help("{:s}: missing repository name".format(action))
|
||||||
if len(cmdargv) < 3:
|
pkgbase_set_keywords(cmdargv[1], cmdargv[2:])
|
||||||
die_with_help("{:s}: missing option name".format(action))
|
|
||||||
pkgbase = cmdargv[1]
|
|
||||||
option = cmdargv[2]
|
|
||||||
|
|
||||||
if option == 'keywords':
|
|
||||||
pkgbase_config_keywords(pkgbase, cmdargv[3:])
|
|
||||||
|
|
||||||
elif action == 'list-repos':
|
elif action == 'list-repos':
|
||||||
if len(cmdargv) > 1:
|
if len(cmdargv) > 1:
|
||||||
die_with_help("{:s}: too many arguments".format(action))
|
die_with_help("{:s}: too many arguments".format(action))
|
||||||
|
@ -213,12 +206,12 @@ elif action == 'restore':
|
||||||
os.execl(git_update_cmd, git_update_cmd, 'restore')
|
os.execl(git_update_cmd, git_update_cmd, 'restore')
|
||||||
elif action == 'help':
|
elif action == 'help':
|
||||||
die("Commands:\n" +
|
die("Commands:\n" +
|
||||||
" config <name> <param>... Change package base settings.\n" +
|
" help Show this help message and exit.\n" +
|
||||||
" help Show this help message and exit.\n" +
|
" list-repos List all your repositories.\n" +
|
||||||
" list-repos List all your repositories.\n" +
|
" restore <name> Restore a deleted package base.\n" +
|
||||||
" restore <name> Restore a deleted package base.\n" +
|
" set-keywords <name> [...] Change package base keywords.\n" +
|
||||||
" setup-repo <name> Create an empty repository.\n" +
|
" setup-repo <name> Create an empty repository.\n" +
|
||||||
" git-receive-pack Internal command used with Git.\n" +
|
" git-receive-pack Internal command used with Git.\n" +
|
||||||
" git-upload-pack Internal command used with Git.")
|
" git-upload-pack Internal command used with Git.")
|
||||||
else:
|
else:
|
||||||
die_with_help("invalid command: {:s}".format(action))
|
die_with_help("invalid command: {:s}".format(action))
|
||||||
|
|
Loading…
Add table
Reference in a new issue