Print this page
11461 should use a native link-editor during the build
11463 SUNWonld has passed its use-by date
11464 cmd/sgs/tools should contain tools, not common code
11465 sgsmsg should be built with the rest of the build tools
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/sgs/packages/common/readme_revision
+++ new/usr/src/cmd/sgs/tools/readme_revision
1 1 #!/usr/bin/perl -w
2 2 #
3 3 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4 4 # Use is subject to license terms.
5 5 #
6 6 # CDDL HEADER START
7 7 #
8 8 # The contents of this file are subject to the terms of the
9 9 # Common Development and Distribution License (the "License").
10 10 # You may not use this file except in compliance with the License.
11 11 #
12 12 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13 13 # or http://www.opensolaris.org/os/licensing.
14 14 # See the License for the specific language governing permissions
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # and limitations under the License.
16 16 #
17 17 # When distributing Covered Code, include this CDDL HEADER in each
18 18 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19 19 # If applicable, add the following below this CDDL HEADER, with the
20 20 # fields enclosed by brackets "[]" replaced with your own identifying
21 21 # information: Portions Copyright [yyyy] [name of copyright owner]
22 22 #
23 23 # CDDL HEADER END
24 24 #
25 -#pragma ident "%Z%%M% %I% %E% SMI"
26 -
27 -
28 25 #
29 26 # Generate a revision number for the sgs linker components, based
30 -# on usr/src/cmd/sgs/packages/common/SUNWonld-README.
27 +# on usr/src/cmd/sgs/tools/SUNWonld-README.
31 28 #
32 29 # usage: readme_revision [-d] [readme-file]
33 30 #
34 31 # This revision number used to be the SCCS revision id for that file,
35 32 # in the form 1.xxx (where xxx was the revision). There were two benefits:
36 33 #
37 34 # (1) You could examine the sccs revision log to determine the CR
38 35 # of the putback that created the revision.
39 36 # (2) The revisions were monotonically increasing.
40 37 #
41 38 # In order to remove the hard wired dependence on sccs, this script generates
42 39 # a replacement revision number, by returning the string '1.xxx', where
43 40 # xxx is an integer giving the number of unique CR lines found in the file.
44 41 # This means that the revision goes up by one for each CR we fix, which
45 42 # makes intutive sense, and is similar to the way the SCCS revision worked.
46 43 #
47 44 # If this is a debug/development build (-d option), then we include
48 45 # additional information at the end of the revision:
49 46 #
50 47 # - Workspace name
51 48 # - user
52 49 # - CR # of last item in the readme file
53 50 # - date,
54 51 #
55 52 # This extra information is useful when we need to identify SUNWonld
56 53 # linker packages in the field, and provides the information previously
57 54 # supplied by (1) above.
58 55 #
59 56
60 57 use vars qw($script $usage $readme $cnt);
61 58 use vars qw($debug $last_cr $wsname $date);
62 59
63 60 # Use the basename of the name we're invoked under as the script name
64 61 @_ = split /\//, $0;
65 62 $script = $_[$#_];
66 63 $usage = "usage: $script [-d] [readme-file]\n";
67 64
68 65 $debug = 0;
69 66 # Process the options
70 67 while ((scalar(@ARGV) > 0) && ($_ = $ARGV[0],/^-/)) {
71 68 ARG: {
72 69 if (/^-d$/) {
73 70 $debug = 1;
74 71 last ARG;
75 72 }
76 73
77 74
78 75 # If it gets here, the option is unknown.
79 76 die $usage;
80 77 }
81 78 shift;
82 79 }
83 80
84 81 # Plain argument
85 82 $cnt = scalar @ARGV;
86 83 {
87 84 if ($cnt == 0) {
88 85 $readme = 'SUNWonld-README';
89 86 next;
90 87 }
91 88
92 89 if ($cnt == 1) {
93 90 $readme = $ARGV[0];
94 91 next;
95 92 }
96 93
97 94 die $usage;
98 95 }
99 96
100 97
101 98 open(FILE, $readme) || die "$script: Unable to open $readme\n";
102 99
103 100 # At the date this script was put into service, the SCCS revision
104 101 # of SUNWonld-README was 1.627, and SUNWonld-README had 588 unique
105 102 # CRs. Revisions are supposed to always increase monotonically, so
106 103 # we add 1000 to the number of unique CRs.
107 104 #
108 105 # This means that any linker with a version <1000 was built using
109 106 # the SCCS revision, and any linker with version >=1000 was built
110 107 # with this script.
111 108 $cnt = 1000;
112 109
113 110 while ($_ = <FILE>) {
114 111 chomp $_;
115 112
116 113 # If the line starts with a number, it is taken as a CR.
117 114 if ($_ =~ /^(\d+)\s/) {
118 115 $cnt++;
119 116 $last_cr = $1;
120 117 }
↓ open down ↓ |
80 lines elided |
↑ open up ↑ |
121 118 }
122 119 close FILE;
123 120
124 121 # If this is a standard build, the revision # is all we want
125 122 if ($debug == 0) {
126 123 print "1.$cnt\n";
127 124 exit 0;
128 125 }
129 126
130 127 # For debug mode, add diagnostic data
131 -#
132 128 ($wsname = $ENV{'CODEMGR_WS'}) ne '' || ($wsname = 'unknown');
133 129 @wsname = split /\//, $wsname;
134 130 $wsname = $wsname[$#wsname];
135 131
136 132 $date = `date +%m/%d/%y`;
137 133
138 134 print "1.$cnt:$wsname-$ENV{USER}-$last_cr-$date\n";
139 135
140 136 exit 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX