Copyright.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"
#
#
# Make sure there is a correctly formed copyright message containing
# the current year.
#
# We treat extant but incorrect copyrights of known format as present
# for the purposes of the "no copyright found" messages to avoid
# treating every otherwise incorrect copyright as also not present
#
if line:
else:
# pre-2002 copyright with '(c)'
# pre-2002 copyright with 'by'
# Valid, current copyright
r'(\s+)(All rights reserved\.)?')
licterms = 'Use is subject to license terms.'
# Are we expecting the license terms message on this line?
if not filename:
lineno += 1
ret = 1
continue
return 0
continue
rights += 1
ret = 1
rights += 1
ret = 1
#
# group 1 = year
# group 2 = spacing
# group 3 = All rights reserved message.
#
if match:
rights += 1
"be %s" %
ret = 1
"missing",
ret = 1
"and all rights reserved phrases",
ret = 1
#
# If the last line left us expecting the license message,
# we're pretty sure it isn't going to be there.
#
ret = 1
if rights == 0:
ret = 1
return ret