1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
|
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
# $Id$
#
# Creates an ACE or TAO kit. Intended to be called from the
# ACE or TAO top-level Makefiles.
#
# The first three lines above let this script run without specifying the
# full path to perl, as long as it is in the user's PATH.
# Taken from perlrun man page.
use strict;
require Cwd;
my $usage="usage: $0 [-?] [-i] [-g] [-k <kit>] [-n] [-v <version>] " .
"[-ta <ACE tag>] [-tt <TAO tag>] " .
"[-c <controlled files>] [-r <release files>] [-l <release lib files] " .
"[-u] [-z]\n";
my $long_usage=" -? option prints this message\n" .
" -i to install to public web server directory\n" .
" -g to generate the man pages\n" .
" -k <kit>, where <kit> is ace, tao, or ace+tao\n" .
" -n option prints what would be done, but doesn't do it\n" .
" -v <version>, where <version> is major, minor, or beta (default)\n" .
" -ta <ACE tag>, to specify ACE tag to be use for checkout (export)\n" .
" -tt <TAO tag>, to specify TAO tag to be use for checkout (export)\n" .
" -c <controlled files> lists the CVS-controlled files\n" .
" -r <release files> lists the files to be released\n" .
" -l <release lib files> list the files to put in the lib kit\n" .
" -u to update versions\n" .
" -z to suppress creation of .zip files\n";
########
######## Sanity checks.
########
$ENV{'SIGNATURE'} ||
die "$0: must set your SIGNATURE environment variable\n";
my $which_host = $ENV{'OSTYPE'};
my $release_host = substr ($which_host, 0, 5);
## We are not going to use any Sun boxes for the release anymore..
if (! ($release_host eq 'linux')){
die "$0: You are on the wrong OS, please move to linux box\n";
}
my $perl_path = '/usr/bin/perl';
&can_run($perl_path.' -V') ||
die "$0: perl path is incorrect, please fix the script\n";
my $dot_path = '/usr/bin';
&can_run($dot_path.'/dot -V') ||
die "$0: dot path is incorrect, please fix the script\n";
my $doxy_path = '/project/deuce/doxygen/bin';
my $doxy_version = '1.2.18';
&can_run($doxy_path.'/doxygen --version | grep '.$doxy_version.' >/dev/null') ||
die "$0: doxygen path or version incorrect, please fix the script\n";
$ENV{'PATH'} = $ENV{'PATH'}.':'.$doxy_path;
my $hostname;
chomp ($hostname = $ENV{'HOSTNAME'} || `uname -n`);
unless ("$hostname" eq 'deuce.doc.wustl.edu') {
#### For efficiency sake . . .
die "$0: must run on host deuce.doc.wustl.edu\n";
}
$ENV{'CVSROOT'} ||
die "$0: must set your CVSROOT environment variable\n";
$ENV{'ACE_ROOT'} ||
die "$0: must set your CVSROOT environment variable\n";
########
######## Configuration parameters.
########
my $gnu = '/bin';
####### Add the path to /bin unconditionally..
$ENV{'PATH'} = "$gnu" . ':' . $ENV{'PATH'};
### Any tools in /usr/local/bin can also be added. We dont need that
### for deuce.doc
my $gnu2 = '/usr/bin';
####### Add the path to /usr/bin unconditionally..
$ENV{'PATH'} = "$gnu2" . ':' . $ENV{'PATH'};
my $export_dir = '/project/deuce/ftp/pub/ACE+TAO-distribution';
my $old_versions_dir = '/project/deuce/ftp/pub/previous_versions';
my $diffs_dir = "$export_dir/diffs";
my $exec_prefix = '';
my $generate_man_pages = 0;
my $install = 0;
my $kit = '';
my $release_type = 'beta';
my $ace_tag = my $tao_tag = '';
my $controlled_files = my $release_files = my $release_lib_files = '';
my $release_tag_files = '';
my $release_filter = '\\( -name CVS -o -name build \\) -prune -o ' .
'! -name \'.\#*\' ! -name \'\#*\' ! -name \'*~\' ' .
'! -name \'*.MAK\' -print';
my $update_versions = 0;
my $create_zips = 1;
########
######## Process command line args.
########
while ($#ARGV >= $[ && $ARGV[0] =~ /^-/) {
if ($ARGV[0] eq '-i') {
$install = 1;
} elsif ($ARGV[0] eq '-g') {
$generate_man_pages = 0;
} elsif ($ARGV[0] eq '-k') {
if ($ARGV[1] =~ /^[^-]+/ &&
($ARGV[1] eq 'ace' || $ARGV[1] eq 'tao' || $ARGV[1] eq 'ace+tao')) {
$kit = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -k option\n";
die "$usage$long_usage";
}
} elsif ($ARGV[0] eq '-n') {
$exec_prefix = 'echo ';
} elsif ($ARGV[0] eq '-v') {
if ($ARGV[1] =~ /^[^-]+/ &&
($ARGV[1] eq 'major' || $ARGV[1] eq 'minor' ||
$ARGV[1] eq 'beta')) {
$release_type = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -v option\n";
die "$usage$long_usage";
}
} elsif ($ARGV[0] eq '-ta') {
if ($ARGV[1] =~ /^[^-]+/) {
$ace_tag = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -ta option\n";
die "$usage$long_usage";
}
} elsif ($ARGV[0] eq '-tt') {
if ($ARGV[1] =~ /^[^-]+/) {
$tao_tag = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -tt option\n";
die "$usage$long_usage";
}
} elsif ($ARGV[0] eq '-c') {
if ($ARGV[1] =~ /^[^-]+/) {
$controlled_files = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -c option\n";
die "$usage$long_usage";
}
} elsif ($ARGV[0] eq '-r') {
if ($ARGV[1] =~ /^[^-]+/) {
$release_files = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -r option\n";
die "$usage$long_usage";
}
} elsif ($ARGV[0] eq '-l') {
if ($ARGV[1] =~ /^[^-]+/) {
$release_lib_files = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -l option\n";
die "$usage$long_usage";
}
} elsif ($ARGV[0] eq '-u') {
$update_versions = 1;
} elsif ($ARGV[0] eq '-z') {
$create_zips = 0;
} elsif ($ARGV[0] eq '-?') {
print "$usage$long_usage";
exit;
} else {
print STDERR "$0: unknown option $ARGV[0]\n";
die "$usage$long_usage";
}
shift;
}
die "$0: must specify a -k option\n" unless "$kit";
my $KIT;
if ($kit eq 'ace') {
$KIT = 'ACE';
} elsif ($kit eq 'tao') {
$KIT = 'TAO';
} else {
#### Creating combined ACE+TAO kit. Don't use $KIT.
};
my $chmod = 'chmod';
# All of them had gnu suffixes. Removed them..
my $chgrp = 'chgrp';
my $cpio = 'cpio';
my $cvs = 'cvs';
my $date = 'date';
my $egrep = 'egrep';
my $find = 'find';
my $gzip = 'gzip';
my $bzip2 = 'bzip2';
my $make = 'make -s';
my $mv = 'mv -f';
my $rm = 'rm -f';
my $cp = 'cp -f';
my $md5sum = 'md5sum';
chop (my $now = `$date +"%a %b %d %T %Y"`);
unless ("$controlled_files") {
chomp ($controlled_files = `$make show_controlled_files`);
}
unless ("$release_files") {
chomp ($release_files = `$make show_release_files`);
}
unless ("$release_lib_files") {
chomp ($release_lib_files = `$make show_release_lib_files`);
}
unless ("$release_tag_files") {
chomp ($release_tag_files = `$make show_release_tag_files`);
}
########
######## Setup signal handlers.
########
my $status = 1; #### Must get set to 0 explicitly to indicate success.
$SIG{'HUP'} = $SIG{'INT'} = $SIG{'QUIT'} = $SIG{'TERM'} = 'cleanup';
########
######## Defend against fascist umasks.
########
umask 022;
my $major_version = my $minor_version = my $beta_version = 0;
my $previous_version = my $version = '';
my $ace_version = '';
########
######## Main execution thread.
########
if ($update_versions && "$kit" ne 'ace+tao') {
#### Update versions and tag, but don't create the kit.
$status =
&check_workspace () ||
&get_versions () ||
&update_version_files () ||
&update_changelog () ||
&tag ();
} else {
#### Create the kit.
#### If a tag was specified, export using the tag from a staging area.
#### If not, create a kit from the current directory.
my $stage_dir = '..';
if ("$ace_tag" || "$tao_tag") {
$stage_dir = "/tmp/ACE_wrappers_stage-$$/";
unless ("$exec_prefix") {
mkdir "$stage_dir", 0755 ||
die "$0: unable to mkdir $stage_dir\n";
}
}
if ("$exec_prefix") {
print "chdir $stage_dir\n";
} else {
chdir $stage_dir || die "$0: unable to chdir $stage_dir\n";
}
if ("$ace_tag") {
&ex ("$cvs -q export -r$ace_tag -kv ACE_wrappers > /dev/null") &&
die "$0: failed cvs export of $ace_tag in $stage_dir\n";
unless ("$exec_prefix") {
mkdir "ACE_wrappers/man", 0755 ||
die "$0: unable to mkdir $stage_dir/ACE_wrappers/man\n";
mkdir "ACE_wrappers/man/man3", 0755 ||
die "$0: unable to mkdir $stage_dir/ACE_wrappers/man/man3\n";
}
if ($generate_man_pages) {
&ex ("cd ACE_wrappers && bin/generate_doxygen.pl -is_release -exclude_tao -perl_path $perl_path -dot_path $dot_path")
&& die "$0: failed to generate ACE man pages in $stage_dir\n";
## DONT generate the windex database on Linux. Things get screwed.
## &ex ("cd ACE_wrappers/man && catman -w -M .")
## && die "$0: failed to generate man page index in $stage_dir\n";
}
&ex ("cd ACE_wrappers && $make ACE-INSTALL") &&
die "$0: failed make ACE-INSTALL in $stage_dir/ACE_wrappers\n";
}
if ("$tao_tag") {
&ex ("$cvs -q export -r$tao_tag -kv ACE_wrappers/TAO > /dev/null") &&
die "$0: failed cvs export of $tao_tag in $stage_dir\n";
&ex ("cd ACE_wrappers/TAO && $make INSTALL orbsvcs/README") &&
die "$0: failed make INSTALL TAO/orbsvcs/README in " .
"$stage_dir/ACE_wrappers/TAO\n";
if ($generate_man_pages) {
&ex ("cd ACE_wrappers && bin/generate_doxygen.pl -is_release -exclude_ace -perl_path $perl_path -dot_path $dot_path")
&& die "$0: failed to generate TAO man pages in $stage_dir\n";
}
}
$status = &generate_makefiles ();
if ($status != 0) {
die "$0: failed to generate makefiles\n";
}
$status = &create_kit ();
if (! $status && $install) {
if ("$ace_tag") {
my $major_v = 0;
my $minor_v = 0;
my $beta_v = 0;
if ($ace_tag =~ /(\d+)_(\d+)_(\d+)/o) {
my $major_v = $1;
my $minor_v = $2;
my $beta_v = $3;
## There is a small problem here and was reported by Don
## Hinton<don@gmx.net> . The problem is that
## $previous_version = "$major_v.$minor_v.$previous_beta";
## // and hence if $previous_beta == 0 then the current beta
## == 1 and so $previous_version == "X.Y.0"
## &diff ('ACE_wrappers', "ACE-$previous_version", "$ace_tag");
## // so "ACE-$previous_version" == "ACE-X.Y.0"
## Which gets sent to cvs as "ACE-X_Y_0" but since the real
## tag is "ACE-X_Y", rdiff doesn't find anything. This problem
## needs fixing. Will fix this when we get time.
#### $previous_version is used by diff ().
if ($beta_v > 0) {
my $previous_beta = $beta_v - 1;
$previous_version = "$major_v.$minor_v.$previous_beta";
&diff ('ACE_wrappers', "ACE-$previous_version", "$ace_tag");
}
}
}
if ("$tao_tag") {
my $major_v = 0;
my $minor_v = 0;
my $beta_v = 0;
if ($tao_tag =~ /(\d+)_(\d+)_(\d+)/o) {
my $major_v = $1;
my $minor_v = $2;
my $beta_v = $3;
#### $previous_version is used by diff ().
if ($beta_v > 0) {
my $previous_beta = $beta_v - 1;
$previous_version = "$major_v.$minor_v.$previous_beta";
&diff ('ACE_wrappers/TAO', "TAO-$previous_version", "$tao_tag");
}
}
}
}
if ("$ace_tag" || "$tao_tag") {
if ($install) {
chdir "..";
&ex ("$rm -r $stage_dir") &&
warn "$0: failed to remove $stage_dir\n";
} else {
warn "$0: kits are in $stage_dir\n";
}
}
}
&cleanup;
########
######## Clean up when done or on signal.
########
sub cleanup {
exit $status;
}
########
######## Check that the workspace is up-to-date, if releasing from
######## the official release directory.
########
sub check_workspace () {
my $module;
if ($kit =~ /^ace/) {
chdir '..' || die "$0: unable to chdir ..\n";
$module = 'ACE_wrappers';
} elsif ($kit =~ /tao/) {
chdir '../..' || die "$0: unable to chdir ../..\n";
$module = 'ACE_wrappers/TAO';
}
my @out_of_date = ();
open (CVS, "$cvs -nq checkout -P $module 2>&1 |") ||
die "$0: unable to open $cvs\n";
while (<CVS>) {
next if m%^U %; #### Allow others to update the repository.
next if m%^cvs server: New directory `.*' -- ignored$%; #### empty dirs.
next if m%^\? ACE_wrappers/include/makeinclude/platform_macros.GNU$%;
next if m%^\? ACE_wrappers/ace/config.h$%;
push (@out_of_date, $_) if "$_";
}
close CVS;
if ($kit =~ /^ace/) {
chdir 'ACE_wrappers' || die "$0: unable to chdir ACE_wrappers\n";
} elsif ($kit =~ /tao/) {
chdir 'ACE_wrappers/TAO' || die "$0: unable to chdir ACE_wrappers/TAO\n";
}
if (@out_of_date) {
warn "ERROR: workspace must be updated (with cvs -q up -d) or " .
"cleaned:\n " .
join ("\n ", @out_of_date) . "\n";
return 1;
}
0;
}
########
######## Retrieve version information from VERSION file(s).
########
sub get_versions () {
open (VERSION, '< VERSION') ||
die "$0: unable to open VERSION\n";
while (<VERSION>) {
if (/$KIT version (\d+)\.(\d+)\.(\d+)/o) {
$major_version = $1;
$minor_version = $2;
$beta_version = $3;
last;
} elsif (/$KIT version (\d+)\.(\d+)[^\.]/o) {
#### Previous release was a minor.
$major_version = $1;
$minor_version = $2;
last;
} elsif (/$KIT version (\d+)[^\.]/o) {
#### Previous release was a major.
$major_version = $1;
last;
}
}
close VERSION;
if ($release_type eq 'beta') {
++$beta_version;
} elsif ($release_type eq 'minor' ) {
$beta_version = 0;
++$minor_version;
} elsif ($release_type eq 'major' ) {
$minor_version = $beta_version = 0;
++$major_version;
}
# How much of redundancy in code thinking that we will do ACE+TAO
# releases seperately!
if ($release_type eq 'beta') {
$version = "$major_version.$minor_version.$beta_version";
} elsif ($release_type eq 'minor' ) {
$version = "$major_version.$minor_version";
}
print "new $KIT version: $version\n";
if ($kit =~ /tao/) {
my $ace_major_version = my $ace_minor_version = my $ace_beta_version = 0;
open (ACE_VERSION, '< ../VERSION') ||
die "$0: unable to open ../VERSION\n";
while (<ACE_VERSION>) {
if (/ACE version (\d+)\.(\d+)\.(\d+)/o) {
$ace_major_version = $1;
$ace_minor_version = $2;
$ace_beta_version = $3;
last;
} elsif (/ACE version (\d+)\.(\d+)[^\.]/o) {
#### ACE release was a minor.
$ace_major_version = $1;
$ace_minor_version = $2;
last;
} elsif (/ACE version (\d+)[^\.]/o) {
#### ACE release was a major.
$ace_major_version = $1;
last;
}
}
close ACE_VERSION;
if ($release_type eq 'beta') {
$ace_version = "$ace_major_version.$ace_minor_version.$ace_beta_version";
} elsif ($release_type eq 'minor' ) {
$ace_version = "$ace_major_version.$ace_minor_version";
}
}
0;
}
########
######## Update VERSION file(s).
########
sub update_version_files () {
&ex ("perl -pi -e " .
"'s/$KIT version .*/$KIT version $version, released $now./' VERSION");
return 1 if $? >> 8;
&ex ("perl -pi -e 's/$KIT VERSION:.*/$KIT VERSION: $version/' " .
"PROBLEM-REPORT-FORM");
return 1 if $? >> 8;
if ($kit =~ /^tao/) {
&ex ("perl -pi -e 's/ACE VERSION:.*/ACE VERSION: $ace_version/' " .
"PROBLEM-REPORT-FORM");
return 1 if $? >> 8;
if ("$exec_prefix") {
print "TAO version ${major_version}.${minor_version}.${beta_version}\n";
} else {
&ex ("perl -pi -e 's/version =.*/version = $version/' " .
"../bin/MakeProjectCreator/config/taoversion.mpb");
return 1 if $? >> 8;
open (TAO_VERSION_H, "> tao/Version.h") ||
die "$0: unable to open tao/Version.h\n";
print TAO_VERSION_H
"// \$Id\$\n" .
"// This is an automatically generated file.\n\n" .
"\#define TAO_MAJOR_VERSION ${major_version}\n" .
"\#define TAO_MINOR_VERSION ${minor_version}\n" .
"\#define TAO_BETA_VERSION ${beta_version}\n" .
"\#define TAO_VERSION \"${version}\"\n";
close TAO_VERSION_H;
}
}
if ($kit =~ /^ace/) {
if ("$exec_prefix") {
print "ACE version ${major_version}.${minor_version}.${beta_version}\n";
} else {
&ex ("perl -pi -e 's/version =.*/version = $version/' " .
"bin/MakeProjectCreator/config/aceversion.mpb");
return 1 if $? >> 8;
open (ACE_VERSION_H, "> ace/Version.h") ||
die "$0: unable to open ace/Version.h\n";
print ACE_VERSION_H
"// \$Id\$\n" .
"// This is an automatically generated file.\n\n" .
"\#define ACE_MAJOR_VERSION ${major_version}\n" .
"\#define ACE_MINOR_VERSION ${minor_version}\n" .
"\#define ACE_BETA_VERSION ${beta_version}\n" .
"\#define ACE_VERSION \"${version}\"\n";
close ACE_VERSION_H;
}
}
0;
}
########
######## Add ChangeLog entries, and make sure that they have proper
######## permissions.
########
sub update_changelog () {
my $logname = $ENV{'LOGNAME'};
if (! "$logname") {
chop ($logname = `/usr/ucb/whoami`);
}
my $signature = $ENV{'SIGNATURE'} || $logname;
my $message = "$now $signature <$logname\@cs.wustl.edu>\n\n" .
" * $KIT version $version released.\n\n";
if ("$exec_prefix") {
print "Adding to ChangeLog: \n", $message, "\n";
return 0;
}
open (NEW_CHANGELOG, ">ChangeLog.bak")
|| return 1;
open (CHANGELOG, "ChangeLog")
|| return 1;
print NEW_CHANGELOG $message;
while (<CHANGELOG>) {
print NEW_CHANGELOG $_;
}
close (CHANGELOG)
|| return 1;
close (NEW_CHANGELOG)
|| return 1;
rename "ChangeLog.bak", "ChangeLog"
|| return 1;
my $version_h = $kit =~ /^ace/ ? 'ace/Version.h' : 'TAO/tao/Version.h';
my $version_mpb = $kit =~ /^ace/ ? 'bin/MakeProjectCreator/config/aceversion.mpb' : 'bin/MakeProjectCreator/config/taoversion.mpb';
# Incase you are wondering what is all this about. We are trying to
# commit from ACE_wrappers and hence the mess. Why not commit from TAO
# and make lives simpler. Sorry it wouldnt work for taoversion.mpb!
# Using "cvs commit ../file" is not acceptable to CVS and is known bug
# from 1.10.X versions. Hence this maze of things.
my $ch_pos = $kit=~ /^tao/ ? 1 : 0;
if ("$ch_pos") {
&ex ("cd ..; $cvs commit -m'$version' " .
"TAO/VERSION TAO/PROBLEM-REPORT-FORM TAO/ChangeLog $version_h $version_mpb && " .
"chmod 0644 VERSION PROBLEM-REPORT-FORM ChangeLog $version_h $version_mpb; " .
"chgrp doc VERSION PROBLEM-REPORT-FORM ChangeLog $version_h $version_mpb");
} else {
&ex ("$cvs commit -m'$version' " .
"VERSION PROBLEM-REPORT-FORM ChangeLog $version_h $version_mpb &&" .
"chmod 0644 VERSION PROBLEM-REPORT-FORM ChangeLog $version_h $version_mpb; " .
"chgrp doc VERSION PROBLEM-REPORT-FORM ChangeLog $version_h $version_mpb");
}
return 1 if $? >> 8;
0;
}
########
######## Tag the release.
########
sub tag () {
my $tag = "$KIT-$version";
#### cvs tag does not allow dots.
$tag =~ tr/./_/;
print "start tagging $tag\n";
if ($KIT eq "TAO") {
chdir "..";
}
&ex ("$cvs -q tag $tag $controlled_files $release_tag_files > /dev/null");
if ($KIT eq "TAO") {
chdir "TAO";
}
return 1 if $? >> 8;
print "finished tagging $tag\n";
0;
}
########
######## If building a beta, create a diff from the previous version.
########
sub diff () {
my ($module, $previous_tag, $tag) = @_;
if ("$previous_version") {
#### Only create a diff for a beta version.
#### cvs tag does not allow dots.
$previous_tag =~ tr/./_/;
$tag =~ tr/./_/;
&ex ("nice -15 $cvs -q rdiff -u -r $previous_tag -r $tag " .
"$module 2>/dev/null | " .
"nice -15 sed 's%ACE_wrappers-repository/%ACE_wrappers/%g' | " .
"nice -15 $gzip -9 > $diffs_dir/$previous_tag-$tag.diff.gz")
if -d "$diffs_dir";
}
#### Ignore return value. No promises on diffs.
0;
}
########
######## Generate Makefiles and workspace/project files.
########
sub generate_makefiles () {
if ($kit =~ /^ace/) {
# At this point, the only mwc/mpc files are in ace and tests. When more
# are available, this needs to be updated, maybe by cycling through
# all non-TAO directories looking for mwc (or mpc?) files.
#
# The current ACE_ROOT setting is where this script started from, not
# the staging area we want to generate files in. So, we need to
# specifically set the -relative option on mwc to replace ACE_ROOT
# correctly in generated files.
#
# Need todo a common chmod on the file lists!
my $here = Cwd::getcwd();
&ex ("cd ACE_wrappers/ace; \
../bin/mwc.pl -type vc7 -relative ACE_ROOT=$here/ACE_wrappers ace.mwc;\
../bin/mwc.pl -type em3 -relative ACE_ROOT=$here/ACE_wrappers ace.mwc;\
chmod 0644 *.vcproj *.vcp *.sln *.vcw");
&ex ("cd ACE_wrappers/tests; \
../bin/mwc.pl -type vc7 -relative ACE_ROOT=$here/ACE_wrappers tests.mwc;\
../bin/mwc.pl -type em3 -relative ACE_ROOT=$here/ACE_wrappers tests.mwc;\
chmod 0644 *.vcproj *.vcp *.sln *.vcw");
}
if ($kit =~ /^tao/) {
# A TAO-knowledgable person needs to decide what, if anything, is to be
# done here.
0;
}
}
########
######## Create the tar file(s) and move to their proper location.
########
sub create_kit () {
#### Create kits with group write permission.
umask 002;
my $dest = $install ? "$export_dir" : 'created';
my $dispose = $install ? "$mv" : 'echo';
my $checksum = $install ? "$md5sum" : 'echo';
my $cksum_ext = 'md5';
my $redirect = $install ? '>' : '\>';
my $shell_cd = $install ? 'cd' : 'echo cd';
(my $local_ace_tag = $ace_tag) =~ s|_|.|g;
(my $local_tao_tag = $tao_tag) =~ s|_|.|g;
# These files don't get LF->CRLF conversions done when making the zip.
my $bin_files =
"\"\\.dsp|\\.dsw|\\.mak|\\.mdp|\\.ide|\\.exe\|\\.ico\|\\.gz\|\\.zip\|" .
"\\.gif|\\.vcp|\\.vcproj|\\.vcw|\\.sln\"";
my $build_command;
my $archives;
##### @@ DISABLED UNTIL READY FOR GENERAL USE -- Ossama
## Temporary ACE+autoconf hack to bootstrap autoconf support into
## ACE distribution.
#&ex("cd ACE_wrappers && bin/bootstrap");
if ($kit eq 'ace' || $kit eq 'ace+tao') {
if ($create_zips) {
$build_command =
"$rm ACE.zip ACE-lib.zip; " .
"$find $release_files $release_filter | $egrep $bin_files | " .
"zip ACE.zip -q9@ &&" .
"$find $release_files $release_filter | $egrep -v $bin_files | " .
"zip ACE.zip -qlg9@ &&" .
"$find $release_lib_files $release_filter | $egrep $bin_files | " .
"zip ACE-lib.zip -q9@ &&" .
"$find $release_lib_files $release_filter | $egrep -v $bin_files | " .
"zip ACE-lib.zip -qlg9@ &&" .
"$find $release_files $release_filter | $cpio -o -H ustar | " .
"$gzip -9 > ACE.tar.gz && " .
"$find $release_files $release_filter | $cpio -o -H ustar | " .
"$bzip2 > ACE.tar.bz2 && " .
"$find $release_lib_files $release_filter | $cpio -o -H ustar | " .
"$gzip -9 > ACE-lib.tar.gz && " .
"$find $release_lib_files $release_filter | $cpio -o -H ustar | " .
"$bzip2 > ACE-lib.tar.bz2 && " .
"$chmod 664 ACE.tar.gz ACE-lib.tar.gz ACE.tar.bz2 ACE-lib.tar.bz2 ".
"ACE.zip ACE-lib.zip && " .
"$chgrp doc ACE.tar.gz ACE-lib.tar.gz ACE.tar.bz2 ACE-lib.tar.bz2 ".
"ACE.zip ACE-lib.zip && " .
"$dispose ACE.zip ACE-lib.zip $dest && " .
"$dispose ACE.tar.gz ACE-lib.tar.gz ACE.tar.bz2 ACE-lib.tar.bz2 $dest && " .
"$cp $dest/ACE.zip $old_versions_dir/$local_ace_tag.zip &&".
"$cp $dest/ACE-lib.zip $old_versions_dir/$local_ace_tag-lib.zip &&".
"$cp $dest/ACE.tar.gz $old_versions_dir/$local_ace_tag.tar.gz &&".
"$cp $dest/ACE-lib.tar.gz $old_versions_dir/$local_ace_tag-lib.tar.gz &&".
"$cp $dest/ACE.tar.bz2 $old_versions_dir/$local_ace_tag.tar.bz2 &&".
"$cp $dest/ACE-lib.tar.bz2 $old_versions_dir/$local_ace_tag-lib.tar.bz2;";
$archives = " ACE.tar.gz ACE-lib.tar.gz ".
"ACE.zip ACE-lib.zip ACE.tar.bz2 ACE-lib.tar.bz2 ";
} else {
$build_command =
"$find $release_files $release_filter | $cpio -o -H ustar | " .
"$gzip -9 > ACE.tar.gz && " .
"$find $release_lib_files $release_filter | $cpio -o -H ustar | " .
"$gzip -9 > ACE-lib.tar.gz && " .
"$find ACE_wrappers/html $release_filter | $cpio -o -H tar | " .
"$gzip -9 > ACE-html.tar.gz && ".
"$chmod 664 ACE.tar.gz ACE-lib.tar.gz ACE-html.tar.gz && " .
"$chgrp doc ACE.tar.gz ACE-lib.tar.gz ACE-html.tar.gz && " .
"$dispose ACE.tar.gz ACE-lib.tar.gz ACE-html.tar.gz $dest && ".
"$cp $dest/ACE.tar.gz $old_versions_dir/$local_ace_tag.tar.gz &&".
"$cp $dest/ACE-lib.tar.gz $old_versions_dir/$local_ace_tag-lib.tar.gz &&".
"$cp $dest/ACE-html.tar.gz $old_versions_dir/ACE-$local_ace_tag-html.tar.gz &&".
"$cp $dest/ACE.tar.bz2 $old_versions_dir/ACE-$local_ace_tag.tar.bz2 &&".
"$cp $dest/ACE-lib.tar.bz2 $old_versions_dir/ACE-$local_ace_tag-lib.tar.bz2 &&".
"$cp $dest/ACE-html.tar.bz2 $old_versions_dir/ACE-$local_ace_tag-html.tar.bz2; ";
$archives = " ACE.tar.gz ACE.tar.bz2 ACE-lib.tar.gz ACE-html.tar.gz ACE-html.bz2";
}
}
if ($kit eq 'ace+tao') {
$release_files .= ' ACE_wrappers/TAO';
if ($create_zips) {
$build_command .=
"$rm ACE+TAO.zip; " .
"$find $release_files $release_filter | $egrep $bin_files | " .
"zip ACE+TAO.zip -q9@ &&" .
"$find $release_files $release_filter | $egrep -v $bin_files | " .
"zip ACE+TAO.zip -qlg9@ &&" .
"$find $release_files $release_filter | $cpio -o -H ustar | " .
"$gzip -9 > ACE+TAO.tar.gz && " .
"$find $release_files $release_filter | $cpio -o -H ustar | " .
"$bzip2 > ACE+TAO.tar.bz2 && " .
"$chmod 664 ACE+TAO.tar.gz ACE+TAO.zip ACE+TAO.tar.bz2 && " .
"$chgrp doc ACE+TAO.tar.gz ACE+TAO.zip ACE+TAO.tar.bz2 && " .
"$dispose ACE+TAO.tar.gz ACE+TAO.zip ACE+TAO.tar.bz2 $dest &&" .
"$cp $dest/ACE+TAO.zip $old_versions_dir/$local_ace_tag+$local_tao_tag.zip &&".
"$cp $dest/ACE+TAO.tar.gz $old_versions_dir/$local_ace_tag+$local_tao_tag.tar.gz &&".
"$cp $dest/ACE+TAO.tar.bz2 $old_versions_dir/$local_ace_tag+$local_tao_tag.tar.bz2; ";
$archives .= " ACE+TAO.tar.gz ACE+TAO.zip ACE+TAO.tar.bz2 ";
} else {
$build_command .=
"$find $release_files $release_filter | $cpio -o -H ustar | " .
"$gzip -9 > ACE+TAO.tar.gz && " .
"$find $release_files $release_filter | $cpio -o -H ustar | " .
"$bzip2 > ACE+TAO.tar.bz2 && " .
"$chmod 664 ACE+TAO.tar.gz && " .
"$chmod 664 ACE+TAO.tar.bz2 && " .
"$chgrp doc ACE+TAO.tar.gz && " .
"$chgrp doc ACE+TAO.tar.bz2 && " .
"$dispose ACE+TAO.tar.gz ACE+TAO.tar.bz2 $dest &&" .
"$cp $dest/ACE+TAO.tar.gz $old_versions_dir/$local_ace_tag+$local_tao_tag.tar.gz &&" .
"$cp $dest/ACE+TAO.tar.bz2 $old_versions_dir/$local_ace_tag+$local_tao_tag.tar.bz2; ";
$archives .= " ACE+TAO.tar.gz ACE+TAO.tar.bz2 ";
}
}
# The "$dest/\$p" is going to look a bit funny if the release isn't
# being installed in the FTP directory since it will expand to
# `created/ACE.tar.gz', for example. No big deal, I guess.
my $checksum_command =
"$shell_cd $dest; " .
"for p in $archives; do " .
"$rm \${p}.${cksum_ext}; " .
"$checksum \$p $redirect \${p}.${cksum_ext}; " .
"done";
&ex ($build_command);
&ex ($checksum_command);
}
########
######## Execute a command, unless -n had been specified. Return value
######## of 0 indicates success.
########
sub ex ()
{
my ($command) = @_;
if ("$exec_prefix") {
print $command . "\n";
0;
} else {
system ("$command");
}
}
########
######## Verify that a command can be executed, return 1 on sucess
########
sub can_run {
my $command = shift;
open (RUN, "$command 2>&1 |")
|| return 0;
while (<RUN>) {}
close(RUN)
|| return 0;
return 1;
}
|