Comments.py revision cdf0c1d55d9b3b6beaf994835440dfb01aef5cf0
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
#
# Check delta comments:
# - Have the correct form.
# - Have a synopsis matching that of the CR or ARC case.
# - Appear only once.
#
#
# Translate any acceptable case number format into "<ARC> <YEAR>/<NUM>"
# format.
#
def normalize_arc(caseid):
errors = { 'bugnospc': [],
'mutant': [],
'dup': [],
'nomatch': [],
'nonexistent': [] }
bugs = {}
arcs = {}
# Ignore valid comments we can't check
continue
blanks += 1
continue
if match:
continue
#
# Bugs missing a space after the ID are still bugs
# for the purposes of the duplicate ID and synopsis
# checks.
#
if match:
continue
# ARC case
if match:
continue
# Anything else is bogus
if not check_db:
continue
continue
r'( \([^)]+\))?$', entered):
entered])
if not check_db:
continue
continue
#
# The opensolaris.org ARC interfaces only give us the
# first 40 characters of the case name, so we must limit
# our checking similarly.
#
# We first try a direct match between the actual case name
# and the entered comment. If that fails we remove a possible
# trailing (fix nit)-type comment, and re-try.
#
continue
else:
entered])
if blanks:
ret = 1
if errors['dup']:
ret = 1
"comments:\n")
if errors['bugnospc']:
ret = 1
"the ID:\n")
if errors['mutant']:
ret = 1
if errors['nonexistent']:
ret = 1
"databases:\n")
if errors['nomatch']:
ret = 1
"the database entries:\n")
return ret