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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2