[aur-dev] [PATCH 1/2] git-serve.py: Automatically create repositories
Create a fresh Git repository when cloning or pushing using a path that does not yet exist. Implements FS#43308. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- scripts/git-integration/git-serve.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/git-integration/git-serve.py b/scripts/git-integration/git-serve.py index c81887b..800eada 100755 --- a/scripts/git-integration/git-serve.py +++ b/scripts/git-integration/git-serve.py @@ -119,6 +119,8 @@ if action == 'git-upload-pack' or action == 'git-receive-pack': if not repo_path_validate(path): die('%s: invalid path: %s' % (action, path)) pkgbase = repo_path_get_pkgbase(path) + if not os.path.exists(path): + setup_repo(pkgbase, user) if action == 'git-receive-pack': if not check_permissions(pkgbase, user): die('%s: permission denied: %s' % (action, user)) -- 2.2.1
Automatically assign ownership when creating a new (empty) repository. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- scripts/git-integration/git-serve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/git-integration/git-serve.py b/scripts/git-integration/git-serve.py index 800eada..a1c6e3a 100755 --- a/scripts/git-integration/git-serve.py +++ b/scripts/git-integration/git-serve.py @@ -76,8 +76,8 @@ def setup_repo(repo, user): die('%s: unknown user: %s' % (action, user)) cur.execute("INSERT INTO PackageBases (Name, SubmittedTS, ModifiedTS, " + - "SubmitterUID) VALUES (%s, UNIX_TIMESTAMP(), " + - "UNIX_TIMESTAMP(), %s)", [repo, userid]) + "SubmitterUID, MaintainerUID) VALUES (%s, UNIX_TIMESTAMP(), " + + "UNIX_TIMESTAMP(), %s, %s)", [repo, userid, userid]) db.commit() db.close() -- 2.2.1
participants (1)
-
Lukas Fleischer