3edf445cce90224c4218c6987d6709e8481cae58ab# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3edf445cce90224c4218c6987d6709e8481cae58ab# Use is subject to license terms.
3edf445cce90224c4218c6987d6709e8481cae58ab# CDDL HEADER START
3edf445cce90224c4218c6987d6709e8481cae58ab# The contents of this file are subject to the terms of the
3edf445cce90224c4218c6987d6709e8481cae58ab# Common Development and Distribution License (the "License").
3edf445cce90224c4218c6987d6709e8481cae58ab# You may not use this file except in compliance with the License.
3edf445cce90224c4218c6987d6709e8481cae58ab# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3edf445cce90224c4218c6987d6709e8481cae58ab# See the License for the specific language governing permissions
3edf445cce90224c4218c6987d6709e8481cae58ab# and limitations under the License.
3edf445cce90224c4218c6987d6709e8481cae58ab# When distributing Covered Code, include this CDDL HEADER in each
3edf445cce90224c4218c6987d6709e8481cae58ab# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3edf445cce90224c4218c6987d6709e8481cae58ab# If applicable, add the following below this CDDL HEADER, with the
3edf445cce90224c4218c6987d6709e8481cae58ab# fields enclosed by brackets "[]" replaced with your own identifying
3edf445cce90224c4218c6987d6709e8481cae58ab# information: Portions Copyright [yyyy] [name of copyright owner]
3edf445cce90224c4218c6987d6709e8481cae58ab# CDDL HEADER END
3edf445cce90224c4218c6987d6709e8481cae58ab#pragma ident "%Z%%M% %I% %E% SMI"
3edf445cce90224c4218c6987d6709e8481cae58ab# Generate a revision number for the sgs linker components, based
3edf445cce90224c4218c6987d6709e8481cae58ab# usage: readme_revision [-d] [readme-file]
3edf445cce90224c4218c6987d6709e8481cae58ab# This revision number used to be the SCCS revision id for that file,
3edf445cce90224c4218c6987d6709e8481cae58ab# in the form 1.xxx (where xxx was the revision). There were two benefits:
3edf445cce90224c4218c6987d6709e8481cae58ab# (1) You could examine the sccs revision log to determine the CR
3edf445cce90224c4218c6987d6709e8481cae58ab# of the putback that created the revision.
3edf445cce90224c4218c6987d6709e8481cae58ab# (2) The revisions were monotonically increasing.
3edf445cce90224c4218c6987d6709e8481cae58ab# In order to remove the hard wired dependence on sccs, this script generates
3edf445cce90224c4218c6987d6709e8481cae58ab# a replacement revision number, by returning the string '1.xxx', where
3edf445cce90224c4218c6987d6709e8481cae58ab# xxx is an integer giving the number of unique CR lines found in the file.
3edf445cce90224c4218c6987d6709e8481cae58ab# This means that the revision goes up by one for each CR we fix, which
3edf445cce90224c4218c6987d6709e8481cae58ab# makes intutive sense, and is similar to the way the SCCS revision worked.
3edf445cce90224c4218c6987d6709e8481cae58ab# If this is a debug/development build (-d option), then we include
3edf445cce90224c4218c6987d6709e8481cae58ab# additional information at the end of the revision:
3edf445cce90224c4218c6987d6709e8481cae58ab# - Workspace name
3edf445cce90224c4218c6987d6709e8481cae58ab# - CR # of last item in the readme file
3edf445cce90224c4218c6987d6709e8481cae58ab# This extra information is useful when we need to identify SUNWonld
3edf445cce90224c4218c6987d6709e8481cae58ab# linker packages in the field, and provides the information previously
3edf445cce90224c4218c6987d6709e8481cae58ab# supplied by (1) above.
3edf445cce90224c4218c6987d6709e8481cae58ab# Use the basename of the name we're invoked under as the script name
3edf445cce90224c4218c6987d6709e8481cae58ab# Process the options
3edf445cce90224c4218c6987d6709e8481cae58ab# Plain argument
3edf445cce90224c4218c6987d6709e8481cae58abopen(FILE, $readme) || die "$script: Unable to open $readme\n";
3edf445cce90224c4218c6987d6709e8481cae58ab# At the date this script was put into service, the SCCS revision
3edf445cce90224c4218c6987d6709e8481cae58ab# of SUNWonld-README was 1.627, and SUNWonld-README had 588 unique
3edf445cce90224c4218c6987d6709e8481cae58ab# CRs. Revisions are supposed to always increase monotonically, so
3edf445cce90224c4218c6987d6709e8481cae58ab# we add 1000 to the number of unique CRs.
3edf445cce90224c4218c6987d6709e8481cae58ab# This means that any linker with a version <1000 was built using
3edf445cce90224c4218c6987d6709e8481cae58ab# the SCCS revision, and any linker with version >=1000 was built
3edf445cce90224c4218c6987d6709e8481cae58ab# with this script.
3edf445cce90224c4218c6987d6709e8481cae58ab# If this is a standard build, the revision # is all we want
3edf445cce90224c4218c6987d6709e8481cae58ab# For debug mode, add diagnostic data