mirror of https://github.com/CGAL/cgal
112 lines
2.7 KiB
Perl
Executable File
112 lines
2.7 KiB
Perl
Executable File
#!/sw/bin/perl -w
|
|
|
|
use strict;
|
|
my (
|
|
$last_version_file,
|
|
$Version_A,
|
|
$Version_B,
|
|
$Version_C,
|
|
$New_C,
|
|
$Version,
|
|
$VersionsDir,
|
|
$ReleasesDir,
|
|
$TestresultDir,
|
|
@versions,
|
|
$creation_succ,
|
|
);
|
|
|
|
sub make_version($$$)
|
|
{
|
|
return "CGAL-$_[0].$_[1]-I-$_[2]";
|
|
}
|
|
|
|
sub start_local_testsuite($)
|
|
{
|
|
my $host = shift;
|
|
open (START_LOCAL_TEST,">/users/geert/tmp/start_cgal_testsuite_${host}");
|
|
print START_LOCAL_TEST "${Version}\n";
|
|
close(START_LOCAL_TEST);
|
|
}
|
|
|
|
sub remove_old_releases(@)
|
|
{
|
|
my $c = $#_ + 1;
|
|
chdir $ReleasesDir;
|
|
my $old_versions;
|
|
while ($c > 6) {
|
|
$c -= 3;
|
|
$old_versions = make_version($_[$c],$_[$c+1],$_[$c+2]);
|
|
unlink("${old_versions}.tar.gz");
|
|
}
|
|
}
|
|
|
|
sub remove_old_testresults(@)
|
|
{
|
|
chdir $TestresultDir;
|
|
my @old_versions;
|
|
while ((${Version_A},${Version_B},${Version_C}) = splice(@_,0,3)) {
|
|
push(@old_versions, make_version(${Version_A},${Version_B},${Version_C}));
|
|
}
|
|
if (@old_versions) {
|
|
system("./empty_dir",@old_versions);
|
|
}
|
|
}
|
|
|
|
|
|
$ENV{PATH} = '/projects/CGAL/admin_scripts:/projects/CGAL/bin:/users/geert/bin:/sw/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/usr/openwin/bin:/ust/dt/bin:/users/geert/PUBLIC/bin';
|
|
|
|
$last_version_file = '/projects/CGAL/lib/last_internal_release';
|
|
$VersionsDir = '/projects/CGAL/Releases/Versions';
|
|
$ReleasesDir = '/users/www/CGAL/Members/Develop/updates';
|
|
$TestresultDir = '/users/www/CGAL/Members/Develop/testsuite';
|
|
|
|
|
|
# get current version
|
|
|
|
open (VERSIONS, "$last_version_file") || die;
|
|
while($_ = <VERSIONS>) {
|
|
if ( ($Version_A,$Version_B,$Version_C)=
|
|
($_ =~ /^\s*(\d+)\s+(\d+)\s+(\d+)\s*$/) ) {
|
|
push(@versions,$Version_A,$Version_B,$Version_C);
|
|
}
|
|
}
|
|
close VERSIONS;
|
|
($Version_A,$Version_B,$Version_C)= @versions;
|
|
|
|
|
|
if (! -d '/tmp/CGAL') {
|
|
mkdir('/tmp/CGAL',0775);
|
|
}
|
|
|
|
chdir '/tmp/CGAL';
|
|
|
|
$New_C = $Version_C +1;
|
|
$Version = make_version(${Version_A},${Version_B},${New_C});
|
|
|
|
if (system('create_release',"${Version_A}-${Version_B}-${New_C}")==0) {
|
|
unshift(@versions,${Version_A},${Version_B},${New_C});
|
|
|
|
chdir $VersionsDir;
|
|
system('finish_release',
|
|
"versions_CGAL-${Version_A}.${Version_B}-I-${Version_C}",
|
|
"versions_${Version}");
|
|
|
|
start_local_testsuite("denebola");
|
|
start_local_testsuite("liguria");
|
|
|
|
remove_old_releases(@versions);
|
|
remove_old_testresults(splice(@versions, 4*3));
|
|
} else {
|
|
# rollback_release(${Version_A},${Version_B},${New_C});
|
|
}
|
|
|
|
# recreate last_release_file
|
|
|
|
|
|
open(OUTVERSIONS, ">$last_version_file") or die "Could not write versions ";
|
|
while ((${Version_A},${Version_B},${Version_C}) = splice(@versions,0,3)) {
|
|
print OUTVERSIONS "${Version_A} ${Version_B} ${Version_C}\n";
|
|
}
|
|
close OUTVERSIONS;
|
|
|