Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2023-01-19 14:50:43 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2023-01-19 19:22:39 +0300
commitad6b47c27b1113abacdfebf7234d38b6524606cd (patch)
treed1d3a13d36140e4af0e848e1b6b9984921c92196 /calm/tool_util.py
parent0939d5bd86f4ad757dc230256e39246d35db1743 (diff)
Relax trusted maintainer restrictions
Rename orphanmaint -> trustedmaint Also revise and relax logic so it's more consistent: trusted maintainers can do these things via a shell, so don't stop doing them more easily via calm. Drop convulted "add trusted maintainers as maintainers of orphaned packages so they can upload them", and just check directly against trusted maintainer list to determine if an upload is permitted.
Diffstat (limited to 'calm/tool_util.py')
-rw-r--r--calm/tool_util.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/calm/tool_util.py b/calm/tool_util.py
index 09e40e8..43fe3ea 100644
--- a/calm/tool_util.py
+++ b/calm/tool_util.py
@@ -47,14 +47,19 @@ def permitted(p):
cygname = os.environ.get('CYGNAME', None)
mlist = {}
- mlist = maintainers.add_packages(mlist, common_constants.PKGMAINT, orphanMaint=common_constants.ORPHANMAINT)
+ mlist = maintainers.add_packages(mlist, common_constants.PKGMAINT, trustedMaint=common_constants.TRUSTEDMAINT)
+
+ # CYGNAME is a maintainer for package
+ if p in mlist[cygname].pkgs:
+ return True
+
+ # CYGNAME is a trusted maintainer
+ if cygname in common_constants.TRUSTEDMAINT.split('/'):
+ return True
if cygname not in mlist:
logging.error("'%s' is not a package maintainer" % (cygname))
return False
- if p not in mlist[cygname].pkgs:
- logging.error("package '%s' is not in the package list for maintainer '%s'" % (p, cygname))
- return False
-
- return True
+ logging.error("package '%s' is not in the package list for maintainer '%s'" % (p, cygname))
+ return False