5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
23 #pragma ident "%Z%%M% %I% %E% SMI"
25 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 # Use is subject to license terms.
28 # Simple script which builds the awk_pkginfo awk script. This awk script
29 # is used to convert the pkginfo.tmpl files into pkginfo files
36 echo "usage: bld_awk_pkginfo -R <revision> -r <release> -m <mach> -o <awk_script>"
42 PRODVERS
="^PRODVERS\="
54 while getopts DR
:o
:r
:m
: c
76 if [[ ( -z $release ) ||
( -z $mach ) ||
( -z $awk_script ) \
83 if [[ -f $awk_script ]]
89 # Build REV= field based on date
91 rev=$
(date "+%y.%m.%d.%H.%M")
94 # Build PRODVERS string - same as in libconv/common/bld_vernote.ksh
96 prodver
="${release}-${revision}"
99 # Build awk script which will process all the
100 # pkginfo.tmpl files.
103 cat << EOF > $awk_script
105 sub(/\=[^=]*$/,"=$rev\"")
110 printf "PRODVERS=\"%s\"\n", "$prodver"
114 printf "ARCH=\"%s\"\n", "$mach"