To: SMGR Users From: Neal Rhodes /MNOP Ltd Subject: How to easily incorporate different versions of software. [#2] Below we have enclosed the text of a new help file describing a situation which some of you might be going through. "Playing Catchup: I just installed SMGR and I have three different versions" "of my application software! " "" "This section contains some general advice regarding how you can incorporate " "different versions into SMGR. It supposes that at the point you started " "using SMGR, you had two different source directories:" "" " /usr/basesrc - Some application as purchased." "" " /usr/oursrc - Local changes to the system above." "" "We can also suppose that some of the files changed may not in fact contain " "changes of any substance." "" "Here are the steps we suggest you follow:" "" "A. Go through the list of files in /usr/oursrc, and compare them to " " /usr/basesrc. Decide which ones you really want to record. Here is a " " script that might help:" " cd /usr/oursrc" " for PATHFILE in *" " do" " FILE=`basename $PATHFILE`" " diff /usr/oursrc/$FILE $PATHFILE" " echo Worth Recording?" " read ANS" " case $ANS in" " y|Y|YES|yes) echo $FILE >> /tmp/record.list" " ;;" " esac" " done" "" "This will leave you with a list of filenames in /tmp/record.list. You " "might think about using the -b option with diff. This will suppress any " "differences which are solely "white space", which means spaces and tabs. " "" "B. Create a script which will juggle the revision header data in the source " " files. As a byproduct of performing the original source load, you added " " certain revision lines to the source file. These lines also need to be " " in any revision you perform. We suggest you create the following script " " named jugglesrc:" " mv /usr/tmp/$1 /tmp # Move checked out src to /tmp" " head -2 /tmp/$1 > /usr/tmp/$1 # bring back header portion" " cat /usr/oursrc/$1 >> /usr/tmp/$1 # Tack new src on the end" " diff /tmp/$1 /usr/tmp/$1 # Show us change to confirm." "" "The head -2 command assumes that your revision string is two lines long. " "Your mileage may vary." "" "C. Actually perform the Checkout and Checkin. We will show two different " " ways to approach this:" " 1. Simple way involving no enhancements to SMGR but which takes more " " developer time; " " 2. Method involving calling SMGR routines to make this easier to " " accomplish, but involves some Progress programming." "" "If you only have a handful of files, perhaps method 1 is best. If you have " "lots of files, going through the effort of method 2 will pay off." "" " want to record, and perform the following steps: " 1. DOING IT ESSENTIALLY BY HAND - you will want to enter SMGR and" " For each file in the list you now want to record:" " a. Checkout the file to the /usr/tmp directory;" " b. Run jugglesrc with the file name as an argument;" " c. Checkin the file." "" " 2. MORE PROGRAMMING, LESS TEDIOUS TO RUN - Automate the process with " " the following program:" "" "def new global shared var scat like stsadm.cat no-undo." "def new global shared var sfile like stsadm.file no-undo." "def stream filenames." "input stream filenames from /tmp/record.list no-echo." "" "repeat:" " import stream filenames sfile." " scat = \""\"". /* <== You will have to figure this one out based " " on your conventions */" " run stchkoui.p." " unix value ( \""jugglesrc \"" + sfile )." " run stchkiui.p." " end." "" "GENERAL NOTES ON THE ABOVE PROCEDURES:" "" "1. All the fields on the Checkout and Checkin dialogs are global shared " " varables, and should retain values between runs, or can have values " " stuffed into them. " "" "2. You might want to think about how you set the Revision status field. " " This is a comment field and has no effect on the working of SMGR, but " " it makes it easy for you to do later retrievals such as:" " for each stsadm:" " find last stsrev of stsadm where rev-status = "base"." " display blah blah blah" " end." "" "3. Trying this all out on a small subset of your files, perhaps even a" "few test sources, would be a great idea."