(file) Return to CommitMakefile CVS log (file) (dir) Up to [Pegasus] / pegasus / mak

  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 kumpf 1.2 ifeq ($(findstring LINUX_, $(PEGASUS_PLATFORM)), LINUX_)
122               ECHO-E = echo -e
123           else
124               ECHO-E = echo
125           endif
126 kumpf 1.1 
127           error:
128 kumpf 1.2 	@$(ECHO-E) "Please specify a target (e.g., diff, add, remove, or commit)"
129           
130           FORCE:
131 kumpf 1.1 
132           # Log in to CVS using the specified user account.
133           login:
134           	cvs $(CVSUSER) login
135           
136           # Log out of CVS from the specified user account.
137           logout:
138           	cvs $(CVSUSER) logout
139           
140           # Preview the commit message.
141           displayMessage:
142 kumpf 1.2 	@$(ECHO-E) $(MESSAGE) > tempCommitMessage
143 kumpf 1.1 	@cat tempCommitMessage
144           	@rm -f tempCommitMessage
145           
146           # List the added, removed, and updated files to confirm the specified files
147           # actually exist.
148           list:
149           	@ls $(UPDATEDFILES) $(ADDEDFILES) $(ADDEDDIRS) $(REMOVEDFILES)
150           
151           # Show the differences between the updated files and the versions that were
152           # checked out from the CVS repository.
153           diff:
154           	@cvs diff $(UPDATEDFILES); cd .;
155           
156           # Run chksrc against the added and updated files.
157           chksrc:
158           ifeq ($(ADDEDFILES), )
159               ifeq ($(UPDATEDFILES), )
160                   NO_CHKSRC=1
161               endif
162           endif
163           ifndef NO_CHKSRC
164 kumpf 1.2 	@$(ECHO-E) "Running chksrc to detect source code formatting errors."
165           	@$(ECHO-E) "Include NO_CHKSRC=1 on the command line to bypass this check."
166 kumpf 1.1 	chksrc $(ADDEDFILES) $(UPDATEDFILES)
167           endif
168           
169           # Add the specified directories and files to the local CVS source tree.
170           # It may be necessary to copy this CommitMakefile into the pegasus directory
171           # (and remove the "pegasus/" prefix from the directory paths) for this
172           # operation to complete successfully.
173           add:
174           ifneq ($(ADDEDDIRS), )
175           	cvs $(CVSUSER) add -m $(MESSAGE) $(ADDEDDIRS) >> commitout
176           endif
177           ifneq ($(ADDEDFILES), )
178           	cvs $(CVSUSER) add -m $(MESSAGE) $(ADDEDFILES) >> commitout
179           endif
180           ifneq ($(ADDEDBINARYFILES), )
181           	cvs $(CVSUSER) add -kb -m $(MESSAGE) $(ADDEDBINARYFILES) >> commitout
182           endif
183           
184           # Remove the specified files from the local CVS source tree.
185           remove:
186           	cvs $(CVSUSER) remove -f $(REMOVEDFILES) >> commitout
187 kumpf 1.1 
188           # Commit changes to the CVS repository, including added, removed, and updated
189           # files.
190           commit: chksrc
191           	rm -f tempCommitMessage
192 kumpf 1.2 	$(ECHO-E) $(MESSAGE) > tempCommitMessage
193 kumpf 1.1 	cvs $(CVSUSER) commit $(PEGASUS_CVS_REVISION_OPTION) -F tempCommitMessage $(ADDEDFILES) $(UPDATEDFILES) $(REMOVEDFILES) >> commitout
194           	rm -f tempCommitMessage
195           
196           printdiff: FORCE
197           	@rm -rf printdifftmp
198           	@mkdir printdifftmp
199           	tar -cf printdifftmp/Update.tar $(UPDATEDFILES)
200           	$(MAKE) --directory=printdifftmp -f ../CommitMakefile printdiff_internal
201           
202           printdiff_internal:
203           	$(foreach i, $(UPDATEDFILES), cvs export -rHEAD  $(i); mv $(i) $(i)-cvs; cd .;)
204           	tar -xf Update.tar
205           	$(foreach i, $(UPDATEDFILES), printdiff $(i) $(i)-cvs; cd .;)
206           
207           # Create a tar file containing the added and updated files.
208           archive:
209           	tar -cvf Changes$(TODAY).tar $(ADDEDFILES) $(UPDATEDFILES) 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2