summaryrefslogtreecommitdiffstats
path: root/scripts/git-integration
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2015-01-07 12:10:53 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2015-01-07 12:21:21 +0100
commitfc23a9bd5012d07cc6ef9d1eba12f320763068d9 (patch)
tree733f53ac3bcc122afaf6e47a6c3b92cb3da5c66f /scripts/git-integration
parentb32458cb8a043422bfc2962c03a70deaee9eaca9 (diff)
downloadaur-fc23a9bd5012d07cc6ef9d1eba12f320763068d9.tar.gz
aur-fc23a9bd5012d07cc6ef9d1eba12f320763068d9.tar.xz
Add support for package base co-maintainers
This allows for having multiple co-maintainers for AUR packages. Co-maintainers have push access to the package base Git repository but are not allowed to change the package base category, disown the package or modify the list of co-maintainers. The primary maintainer of an AUR package can edit the list of co-maintainers from the Package Actions box. Implements FS#17911. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'scripts/git-integration')
-rwxr-xr-xscripts/git-integration/git-serve.py11
-rwxr-xr-xscripts/git-integration/git-update.py8
2 files changed, 12 insertions, 7 deletions
diff --git a/scripts/git-integration/git-serve.py b/scripts/git-integration/git-serve.py
index a1c6e3a1..d551dba4 100755
--- a/scripts/git-integration/git-serve.py
+++ b/scripts/git-integration/git-serve.py
@@ -92,10 +92,13 @@ def check_permissions(pkgbase, user):
unix_socket=aur_db_socket, buffered=True)
cur = db.cursor()
- cur.execute("SELECT COUNT(*) FROM PackageBases INNER JOIN Users " +
- "ON Users.ID = PackageBases.MaintainerUID OR " +
- "PackageBases.MaintainerUID IS NULL WHERE " +
- "Name = %s AND Username = %s", [pkgbase, user])
+ cur.execute("SELECT COUNT(*) FROM PackageBases " +
+ "LEFT JOIN PackageComaintainers " +
+ "ON PackageComaintainers.PackageBaseID = PackageBases.ID " +
+ "INNER JOIN Users ON Users.ID = PackageBases.MaintainerUID " +
+ "OR PackageBases.MaintainerUID IS NULL " +
+ "OR Users.ID = PackageComaintainers.UsersID " +
+ "WHERE Name = %s AND Username = %s", [pkgbase, user])
return cur.fetchone()[0] > 0
def die(msg):
diff --git a/scripts/git-integration/git-update.py b/scripts/git-integration/git-update.py
index 1ff09b86..b20c0a22 100755
--- a/scripts/git-integration/git-update.py
+++ b/scripts/git-integration/git-update.py
@@ -47,9 +47,11 @@ def save_srcinfo(srcinfo, db, cur, user):
# Update package base details and delete current packages.
cur.execute("UPDATE PackageBases SET ModifiedTS = UNIX_TIMESTAMP(), " +
- "MaintainerUID = %s, PackagerUID = %s, " +
- "OutOfDateTS = NULL WHERE ID = %s",
- [user_id, user_id, pkgbase_id])
+ "PackagerUID = %s, OutOfDateTS = NULL WHERE ID = %s",
+ [user_id, pkgbase_id])
+ cur.execute("UPDATE PackageBases SET MaintainerUID = %s " +
+ "WHERE ID = %s AND MaintainerUID IS NULL",
+ [user_id, pkgbase_id])
cur.execute("DELETE FROM Packages WHERE PackageBaseID = %s",
[pkgbase_id])