diff options
Diffstat (limited to 'calm/untest.py')
-rw-r--r-- | calm/untest.py | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/calm/untest.py b/calm/untest.py index f3995e7..7d6d774 100644 --- a/calm/untest.py +++ b/calm/untest.py @@ -28,31 +28,15 @@ import re import sys from . import common_constants -from . import maintainers +from . import tool_util def untest(pvr): - # split name and vr - match = re.match(r'^(.+?)-(\d.*)', pvr) - if not match: - logging.error("unable to determine package and version-release from '%s'" % (pvr)) + p, vr = tool_util.split(pvr) + if not p: return - p = match.group(1) - vr = match.group(2) - - # check CYGNAME is a maintainer for package - cygname = os.environ['CYGNAME'] - - mlist = {} - mlist = maintainers.add_packages(mlist, common_constants.PKGMAINT, orphanMaint=common_constants.ORPHANMAINT) - - if cygname not in mlist: - logging.error("'%s' is not a package maintainer" % (cygname)) - return - - if p not in mlist[cygname].pkgs: - logging.error("package '%s' is not in the package list for maintainer '%s'" % (p, cygname)) + if not tool_util.permitted(p): return # remove '^test:' lines from any package and subpackage hints @@ -85,7 +69,7 @@ def untest(pvr): def main(): parser = argparse.ArgumentParser(description='remove test: hint') - parser.add_argument('package', nargs='*', metavar='PVR') + parser.add_argument('package', nargs='+', metavar='SPVR') (args) = parser.parse_args() logging.getLogger().setLevel(logging.INFO) |