1 kumpf 1.1 #//%2006////////////////////////////////////////////////////////////////////////
2 #//
3 #// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 #// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 #// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 #// IBM Corp.; EMC Corporation, The Open Group.
7 #// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 #// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 #// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 #// EMC Corporation; VERITAS Software Corporation; The Open Group.
11 #// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 #// EMC Corporation; Symantec Corporation; The Open Group.
13 #//
14 #// Permission is hereby granted, free of charge, to any person obtaining a copy
15 #// of this software and associated documentation files (the "Software"), to
16 #// deal in the Software without restriction, including without limitation the
17 #// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 #// sell copies of the Software, and to permit persons to whom the Software is
19 #// furnished to do so, subject to the following conditions:
20 #//
21 #// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 kumpf 1.1 #// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 #// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 #// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 #// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 #// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 #// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #//
30 #//=============================================================================
31
32 # This Makefile is used to perform CVS operations such as committing changes.
33 # It is intended to improve predictability by allowing an operation to be
34 # previewed using the -n option before actually being invoked.
35
36 # NOTE: The definitions contained in this file are intended for Unix type
37 # platforms and may not operate successfully on other platforms.
38
39 # NOTE: The PEGASUS_BUILD_BRANCH environment variable must be set to the
40 # name of the branch to which changes are to be committed.
41
42 # SUGGESTED USAGE:
43 kumpf 1.1 #
44 # 1. Fill in the data fields below up to the '#' line.
45 # 2. Ensure the PEGASUS_BUILD_BRANCH environment variable is defined.
46 # 3. Run "make -f CommitMakefile chksrc" to check for formatting errors in
47 # the files to be committed.
48 # 4. Run "make -f CommitMakefile diff | more" to inspect and verify the
49 # changes to be committed.
50 # 5. Run "make -f CommitMakefile displayMessage" to preview the CVS commit
51 # message
52 # 6. Run "make -f CommitMakefile login" to log into CVS with a write account.
53 # 7. Run "make -f CommitMakefile add" to add new directories and files to the
54 # local CVS source tree. (It may be necessary to copy this CommitMakefile
55 # into the pegasus directory and remove the "pegasus/" prefix from the
56 # directory paths) for this operation to complete successfully.)
57 # 8. Run "make -f CommitMakefile remove" to remove files from the local CVS
58 # source tree.
59 # 9. Run "make -f CommitMakefile -n commit" to preview and verify the CVS
60 # commit command.
61 # 10. Run "make -f CommitMakefile commit" to commit the added, removed, and
62 # updated files to the CVS repository.
63 # 11. Run "make -f CommitMakefile logout" to log out of CVS from the write
64 kumpf 1.1 # account.
65
66 # Fill in the correct username here.
67 CVSUSER = -d:pserver:username@cvs.opengroup.org:/cvs/MSB
68
69 #
70 # Specify the files to be added, removed, and updated with full pegasus
71 # directory paths.
72 #
73
74 ADDEDDIRS = \
75
76 ADDEDFILES = \
77
78 ADDEDBINARYFILES = \
79
80 REMOVEDFILES = \
81
82 UPDATEDFILES = \
83
84 #
85 kumpf 1.1 # Describe the change being made, including the bug (or PEP) number, title,
86 # and description. This data will be used to format a commit message.
87 #
88
89 APPROVAL = BUG\#: <Fill in Bug number. Specify PEP at left if appropriate.>
90
91 TITLE = TITLE: <Fill in Bug or PEP title>
92 DESCRIPTION = DESCRIPTION: <Fill in a description of the change to be used in the commit message.>
93
94
95 ###############################################################################
96 #
97 # No per-operation changes are required for the remaining definitions below.
98 #
99
100 ifndef PEGASUS_BUILD_BRANCH
101 $(error PEGASUS_BUILD_BRANCH environment variable is undefined.)
102 endif
103
104 ifeq ($(PEGASUS_BUILD_BRANCH), HEAD)
105 PEGASUS_CVS_REVISION_OPTION=
106 kumpf 1.1 else
107 ifeq ($(PEGASUS_BUILD_BRANCH), MAIN)
108 PEGASUS_CVS_REVISION_OPTION=
109 else
110 PEGASUS_CVS_REVISION_OPTION = -r $(PEGASUS_BUILD_BRANCH)
111 endif
112 endif
113
114 MESSAGEQUOTE = "
115 CR = \n
116
117 MESSAGE = $(MESSAGEQUOTE)$(APPROVAL)$(CR)$(TITLE)$(CR)$(DESCRIPTION)$(CR)$(MESSAGEQUOTE)
118
119 TODAY = $(shell date +"%m%d%y")
120
121 FORCE:
122
123
124 error:
125 @echo "Please specify a target (e.g., diff, add, remove, or commit)"
126
127 kumpf 1.1 # Log in to CVS using the specified user account.
128 login:
129 cvs $(CVSUSER) login
130
131 # Log out of CVS from the specified user account.
132 logout:
133 cvs $(CVSUSER) logout
134
135 # Preview the commit message.
136 displayMessage:
137 @echo $(MESSAGE) > tempCommitMessage
138 @cat tempCommitMessage
139 @rm -f tempCommitMessage
140
141 # List the added, removed, and updated files to confirm the specified files
142 # actually exist.
143 list:
144 @ls $(UPDATEDFILES) $(ADDEDFILES) $(ADDEDDIRS) $(REMOVEDFILES)
145
146 # Show the differences between the updated files and the versions that were
147 # checked out from the CVS repository.
148 kumpf 1.1 diff:
149 @cvs diff $(UPDATEDFILES); cd .;
150
151 # Run chksrc against the added and updated files.
152 chksrc:
153 ifeq ($(ADDEDFILES), )
154 ifeq ($(UPDATEDFILES), )
155 NO_CHKSRC=1
156 endif
157 endif
158 ifndef NO_CHKSRC
159 @echo "Running chksrc to detect source code formatting errors."
160 @echo "Include NO_CHKSRC=1 on the command line to bypass this check."
161 chksrc $(ADDEDFILES) $(UPDATEDFILES)
162 endif
163
164 # Add the specified directories and files to the local CVS source tree.
165 # It may be necessary to copy this CommitMakefile into the pegasus directory
166 # (and remove the "pegasus/" prefix from the directory paths) for this
167 # operation to complete successfully.
168 add:
169 kumpf 1.1 ifneq ($(ADDEDDIRS), )
170 cvs $(CVSUSER) add -m $(MESSAGE) $(ADDEDDIRS) >> commitout
171 endif
172 ifneq ($(ADDEDFILES), )
173 cvs $(CVSUSER) add -m $(MESSAGE) $(ADDEDFILES) >> commitout
174 endif
175 ifneq ($(ADDEDBINARYFILES), )
176 cvs $(CVSUSER) add -kb -m $(MESSAGE) $(ADDEDBINARYFILES) >> commitout
177 endif
178
179 # Remove the specified files from the local CVS source tree.
180 remove:
181 cvs $(CVSUSER) remove -f $(REMOVEDFILES) >> commitout
182
183 # Commit changes to the CVS repository, including added, removed, and updated
184 # files.
185 commit: chksrc
186 rm -f tempCommitMessage
187 echo $(MESSAGE) > tempCommitMessage
188 cvs $(CVSUSER) commit $(PEGASUS_CVS_REVISION_OPTION) -F tempCommitMessage $(ADDEDFILES) $(UPDATEDFILES) $(REMOVEDFILES) >> commitout
189 rm -f tempCommitMessage
190 kumpf 1.1
191 printdiff: FORCE
192 @rm -rf printdifftmp
193 @mkdir printdifftmp
194 tar -cf printdifftmp/Update.tar $(UPDATEDFILES)
195 $(MAKE) --directory=printdifftmp -f ../CommitMakefile printdiff_internal
196
197 printdiff_internal:
198 $(foreach i, $(UPDATEDFILES), cvs export -rHEAD $(i); mv $(i) $(i)-cvs; cd .;)
199 tar -xf Update.tar
200 $(foreach i, $(UPDATEDFILES), printdiff $(i) $(i)-cvs; cd .;)
201
202 # Create a tar file containing the added and updated files.
203 archive:
204 tar -cvf Changes$(TODAY).tar $(ADDEDFILES) $(UPDATEDFILES)
|