Move the sources to trunk
[opencv] / apps / Hawk / CVEiCL / EiC / Maintenance
1 Contents:\r
2 \r
3         MAINTAINING A VARIANT OF EiC via CVS\r
4         BUILDING A BINARY DISTRIBUTION\r
5         COMMITTING EiC to CVS\r
6 \r
7 --------------------------------------------------------------------\r
8 MAINTAINING A VARIANT OF EiC via CVS\r
9 \r
10 If you have or intend to be modifying EiC's source distribution for\r
11 your own personal needs, but also want your distribution to be kept up\r
12 to date with EiC's public distribution, then one way to do this is to\r
13 use CVS. With CVS you can keep track of several versions of EiC\r
14 simultaneously and it will allow you to merge different versions\r
15 together. Thereby, incorporating changes from one version into\r
16 another.\r
17 \r
18 For details on using CVS please refer to:\r
19 \r
20         Version Management with CVS by Per Cederqvist\r
21 \r
22         http://www.loria.fr/~molli/cvs/doc/cvs_toc.html\r
23 \r
24 Most Linux distribution come with CVS, but if you need to install CVS,\r
25 it can be obtained from:\r
26 \r
27         http://www.cyclic.com/cyclic-pages/cvsdev.html\r
28 \r
29 \r
30 The following will show you how to maintain your personal distribution\r
31 of EiC so that you can easily incorporate new features or bug fixes\r
32 from the latest official release of EiC into your own version. Also,\r
33 you are advised to read all of the this section prior to starting.\r
34 \r
35 In the following it will be assumed that your EiC source directory\r
36 contains only EiC source files. Therefore, before starting make sure\r
37 your EiC directory has been clobbered:\r
38 \r
39 \r
40         % cd  $HOMEofEiC       // PATH_TO_THE_EiC_DIRECTORY \r
41         % cd doc; make clobber; cd .. ; make clobber\r
42 \r
43         The clobber directive is more severe than a clean, as it\r
44         removes everything that clean does plus targets and installed\r
45         files.\r
46 \r
47 First place a copy of the public version of EiC under CVS control\r
48 using the following cvs command:\r
49 \r
50         cvs import -m"Message" <Dir> <Vendor-Tag> <Release-Tag>\r
51 \r
52 \r
53 Message     A string that specifies some information about the current\r
54             operation. If you do not give it, CVS will prompt you by\r
55             opening up an editor according to $CVSEDITOR or $EDITOR\r
56             and which can be quite slow and annoying at times.\r
57 \r
58 Dir         The directory where the current source will be stored in\r
59             the CVS repository. \r
60 \r
61 Vendor-Tag  The tag for the entire branch. This tag will be used\r
62             to identify the Vendor's copy of the source (the public version\r
63             of EiC), rather than your personal version.\r
64           \r
65 Release-Tag The Release-Tag is  used to identify the files at the\r
66             leaves, of the Vendor's branch, created each time you execute \r
67             an import.\r
68 \r
69 \r
70 For example, lets say you are starting from EiC version 3.7:\r
71 \r
72         % cvs import -m"import of EiC 3.7"  EiC EiC_dist V_3_7\r
73 \r
74 This command will create a branch with number 1.1.1, and which is the\r
75 CVS branch number for the Vendor's branch. The above command will also\r
76 place a copy of EiC's source distribution in the directory\r
77 $CVSROOT/EiC.  It will label the Vendor's branch as `EiC_dist' and\r
78 assign it the release tag `V_3_7'.\r
79 \r
80 \r
81 Before you start working with any code in the repository you must\r
82 first check out a working copy from the repository.  To make sure\r
83 everything worked and to check out the latest version from the\r
84 repository do the following:\r
85 \r
86         % cd ..\r
87         % mv EiC EiC.orig\r
88         % cvs checkout EiC\r
89         % ls -R EiC\r
90                 \r
91 Note: you have checked out the latest revision on the `main trunk' of\r
92 the EiC repository and not the code on the Vendor's branch `EiC_dist', although\r
93 at this stage they are identical. This means you should have a copy of\r
94 the main trunk of the EiC repository, and all commits will be\r
95 committed to the main trunk and not to the Vendor's branch.\r
96 \r
97 Now, examine the status of a file, such as the starteic.c file, by\r
98 using the CVS status subcommand:\r
99         \r
100         % cd EiC/src\r
101         % cvs status -v starteic.c\r
102 \r
103 ===================================================================\r
104 File: starteic.c        Status: Up-to-date\r
105 \r
106    Working revision:    1.1.1.1 Sat Jun 20 07:37:46 1998\r
107    Repository revision: 1.1.1.1 /usr/local/cvsroot/EiC/src/starteic.c,v\r
108    Sticky Tag:          (none)\r
109    Sticky Date:         (none)\r
110    Sticky Options:      (none)\r
111 \r
112    Existing Tags:\r
113         V_3_7                           (revision: 1.1.1.1)\r
114         EiC_dist                        (branch: 1.1.1)\r
115 \r
116 \r
117 This tells us that we are working with revision 1.1.1.1, which also\r
118 coincides with the revision version 1.1.1.1 with tag V_3_7. While it\r
119 it is not clear from the above information, but this is also revision\r
120 1.1 on the main trunk.\r
121 \r
122 If you already have a modified copy of EiC then just copy your files\r
123 over the top of the files in this EiC directory. However, to simulate\r
124 changes that you may make to the EiC source files, and for this\r
125 example, I will just edit `starteic.c' and change:\r
126 \r
127         "EiC V3.7 - Copyright (c) 1995 to 1998,"\r
128 to \r
129         "myEiC V3.7 - Copyright (c) 1995 to 1998,"\r
130 \r
131 \r
132 Next, commit the changes via:\r
133 \r
134         % cvs commit -m"update of EiC" starteic.c\r
135         Checking in starteic.c;\r
136         /usr/local/cvsroot/EiC/src/starteic.c,v  <--  starteic.c\r
137         new revision: 1.2; previous revision: 1.1\r
138         done                    \r
139 \r
140 If I had not specified the file `starteic.c', then the commit command\r
141 would have worked recursively on all files within this directory and\r
142 its subdirectories. It is also a good idea to use `cvs -n update'\r
143 before making a commit, as this will inform you, without making any\r
144 changes, what changes will occur, and will give you the opportunity to\r
145 make appropriate changes as needed; such as adding any new files and\r
146 directories.\r
147 \r
148 Now the CVS repository for EiC will look something like this:\r
149 \r
150 \r
151                 +-----+    +-----+\r
152  main trunk --> | 1.1 |--->| 1.2 |            \r
153     (1)         +-----+    +-----+\r
154                     \\r
155                      \+---------+\r
156   Vendor's branch --> | 1.1.1.1 |\r
157         (1.1.1)       +---------+\r
158         EiC_dist                .\r
159                                / \\r
160                                 |\r
161                              tag V_3_7  \r
162 \r
163 \r
164 Note, only file starteic.c will have the revision number 1.2, all the\r
165 rest will have revision number 1.1.1.1, which is also  1.1. \r
166 \r
167 When a new version of EiC is released, and for this example I will use\r
168 version 3.7.1, the first thing to do is to make sure you have\r
169 committed your working revision of EiC to CVS (see examples\r
170 above). Then untar the new release of EiC into some temporary\r
171 directory:\r
172 \r
173         % cd /tmp   \r
174         % tar xvzf EiCsrc_3_7_1.tgz  \r
175         % cd EiC\r
176         % cvs import -m"update EiC V3.7.1" EiC EiC_dist V_3_7_1\r
177 \r
178 The above import command is almost identical to the previous import\r
179 command, with the only difference being that a new release tag is\r
180 being specified, V_3_7_1.\r
181 \r
182 After the above, the repository will look like:\r
183 \r
184 \r
185                 +-----+    +-----+\r
186  main trunk --> | 1.1 |--->| 1.2 |            \r
187     (1)         +-----+    +-----+\r
188                     \\r
189                      \+---------+     +---------+\r
190   Vendor's branch --> | 1.1.1.1 | --->| 1.1.1.2 |\r
191         (1.1.1)       +---------+     +---------+\r
192         EiC_dist                .               . \r
193                                / \             / \\r
194                                 |               |\r
195                              tag V_3_7      tag V_3_7_1\r
196 \r
197 \r
198 Any files in the Vendor's branch that have changed between version 3.7\r
199 and 3.7.1 will have the revision number 1.1.1.2 else their revision\r
200 number will remain at 1.1.1.1. If there are any files in the main\r
201 trunk that have local changes then CVS will warn that you must merge\r
202 the changes into the main trunk, and for this example, CVS reports:\r
203 \r
204 \r
205         1 conflicts created by this import.\r
206         Use the following command to help the merge:\r
207 \r
208                 cvs checkout -jEiC_dist:yesterday -jEiC_dist EiC\r
209  \r
210 \r
211 The above report is warning that not only are changes detected between\r
212 the main trunk and the Vendor's branch, but some of these changes also\r
213 conflict. This means that the same lines of code have been altered\r
214 between the Vendor's source and the main trunk source. To resolve\r
215 these difference first change to your local working EiC directory:\r
216 \r
217         % cd $HOMEofEiC\r
218 \r
219 After you have commited your working version to the main trunk of\r
220 the repository for EiC, you may also want to tag your current revision:\r
221 \r
222         % cvs tag TAGNAME\r
223 \r
224 This will allow you to retrieve this revision via: \r
225 \r
226         % cvs checkout -r TAGNAME EiC\r
227 \r
228 Next, you must merge all changes on the Vendor's branch into your\r
229 local working copy of EiC (this command only affects the working\r
230 copy):\r
231 \r
232         % cvs update -d -j EiC_dist\r
233 \r
234 Any conflicts that result from the merge must now be resolved. To find\r
235 all the files with conflicts use the command:\r
236 \r
237         % cvs -n commit\r
238 \r
239 The only conflict in this example is with file starteic.c (note, the\r
240 original working copy will be saved in file `.#starteic.c.1.2') and\r
241 within starteic.c the conflict is revealed as:\r
242 \r
243         <<<<<<< starteic.c\r
244         "myEiC V3.7 - Copyright (c) 1995 to 1998,"\r
245         =======\r
246         "EiC V3.7.1 - Copyright (c) 1995 to 1998,"\r
247         >>>>>>> 1.1.1.2\r
248 \r
249 CVS delimits conflicting sections with <<<<<<<<, ===== and\r
250 >>>>>>. Thus, preventing code with conflicts from being compiled. To\r
251 resolve this conflict, change the above 5 lines into:\r
252 \r
253         "my"\r
254         "EiC V3.7.1 - Copyright (c) 1995 to 1998,"\r
255 \r
256 This will also prevent future conflicts with this section of code.\r
257 \r
258 Now, from the EiC home directory commit the whole source tree:\r
259 \r
260         % cvs commit -m"merged with EiC V3.7.1" \r
261 \r
262 \r
263 The EiC repository will now look like:\r
264 \r
265 \r
266                 +-----+    +-----+    +-----+\r
267  main trunk --> | 1.1 |--->| 1.2 |--->| 1.3 |           \r
268     (1)         +-----+    +-----+    +-----+\r
269                     \\r
270                      \+---------+     +---------+\r
271   Vendor's branch --> | 1.1.1.1 | --->| 1.1.1.2 |\r
272         (1.1.1)       +---------+     +---------+\r
273         EiC_dist                .               . \r
274                                / \             / \\r
275                                 |               |\r
276                              tag V_3_7      tag V_3_7_1\r
277 \r
278 \r
279 At this stage you should have the latest changes of EiC incorporated\r
280 into your local version of EiC.\r
281 \r
282 \r
283 TIPS:\r
284         Keep a backup of your CVS repository.\r
285         This way, if you get confused and stuff up your\r
286         CVS repository you can always replace it with\r
287         the backed up version. \r
288 \r
289         Use CVS tags to keep track of various revisions \r
290         of your local source.\r
291 \r
292         Work methodically with CVS. If need be,\r
293         create a check list that you work through.\r
294         Below in section `COMMITTING EiC to CVS' are the\r
295         steps that I go through each time I make \r
296         a new commit of EiC.\r
297 \r
298         More CVS information can be found at:\r
299         \r
300                 http://www.loria.fr/~molli/cvs-index.html\r
301 \r
302 --------------------------------------------------------------------\r
303 BUILDING THE BINARY DISTRIBUTION\r
304 \r
305         (*) Change to EiC's top directory and run \r
306 \r
307                 % config/makeconfig\r
308 \r
309             This ensures that the appropriate platform\r
310             information has been set.\r
311 \r
312         (*) Edit the main Makefile to set EiC's\r
313             version number, EiC_NUM, to that obtained from\r
314 \r
315                 % eic -v\r
316 \r
317             If adding a new module to the binary source \r
318             distribution update the variables MODULES \r
319             BINTREE and possibly PUB_DIRS in the top \r
320             Makefile.\r
321 \r
322         (*)  Edit the README.BIN file to reflect\r
323              the appropriate version and any new\r
324              platforms.\r
325 \r
326         (*)  Change to the documentation directory\r
327              and make install\r
328              \r
329              % cd doc\r
330              % make install     \r
331              % cd ..\r
332 \r
333         (*) To construct the binary distribution: \r
334                 \r
335                 % make binary\r
336 \r
337 \r
338         (*) Now test the binary distribution:\r
339 \r
340                  % tar xvzf  EiC_PLATFORM.#.#.tgz\r
341 \r
342              Inspect the README file\r
343                 \r
344                  % more EiC/README\r
345 \r
346              Follow the instruction for installing EiC.\r
347              If needed repeat previous steps until\r
348              all is okay. Then \r
349 \r
350                 % cd EiC/main\r
351                 % make -n installBinary\r
352                 % make installBinary\r
353                 % cd ../..\r
354                 \r
355                 \r
356              Test it:\r
357         \r
358                 % cd test/EiCtests\r
359                 % eictester t*.c\r
360 \r
361              Clean up:\r
362 \r
363                 % cd ../../EiC/main\r
364                 % make clobber\r
365                 % cd ../..\r
366                 % rm -rf EiC\r
367                 \r
368 \r
369         (*)  % make install\r
370 \r
371         (*) Also, up date EiC's web page to reflect the\r
372             new distributions.\r
373 \r
374 \r
375 ------------------------------------------------------------------\r
376 COMMITTING EIC to CVS\r
377 \r
378 (1) Change directory to EiC's home directory\r
379 \r
380 (2) make clobber\r
381 \r
382 (3) make install      // Fix code, so that gcc\r
383                       // does not give any warnings\r
384 \r
385 (4) cd test           // run test procedures \r
386 \r
387 (5) test.sh           // make sure all tests modules pass\r
388                       // if not understand why\r
389 (5a) cd EiCtests\r
390 (6) ../runsent *.c    // check manually all the *.snt files\r
391                       // and that they are correct\r
392 (7) rm *.snt\r
393 \r
394 (8) cd ..\r
395 \r
396 (9) make clobber     // check that Lib and include directories\r
397                      //  are empty. If not, find out why.\r
398 \r
399 (10) cvs -n update > /tmp/list\r
400 \r
401         * from the information that goes to screen \r
402           check for errors\r
403         * now check the contents of the file /tmp/list \r
404           and if needed, take the appropriate actions\r
405         * repeat step 10 until no warnings exist etc\r
406         \r
407 (11) cvs commit -m"UPDATE of EiC " \r
408        \r
409 (12) If needed now add a tag:\r
410 \r
411         * cvs tag V3_0\r
412 \r
413 \r
414 \r
415 \r
416 \r
417 \r