Added a switch for testing.

Added check for which packages are to be in the release (only those explicitly
named in a file, not just all packages).
Made unzipping quieter.
Writing out versions of the packages to a file.
This commit is contained in:
Geert-Jan Giezeman 1998-07-03 15:15:31 +00:00
parent f227df578d
commit aa8df359d8
1 changed files with 59 additions and 29 deletions

View File

@ -13,23 +13,29 @@ use File::Find;
#----------------------------------------------------------------#
$::CURRENT_DIR=cwd();
#$::FTPDIR='/users/ftp/CGAL';
#$::DIRNAME=dirname($0);
$::TEMPFILE="TEMPFILE.$$";
$::PACKAGEDIR='/users/www/CGAL/Members/Develop/updates/packages';
$::MISCPACKAGEDIR='/users/www/CGAL/Members/Develop/updates/packages';
$::SCRIPTDIR='/users/www/CGAL/Members/Develop/scripts';
$::ALL_RESULTS_DIR='/users/www/CGAL/Members/Develop/testsuite';
#$::VERSION="";
#$::VERSION_NR=0;
#$::PACKAGEDIR='/users/geert/CGAL/tmp/packages';
#$::ALL_RESULTS_DIR='/users/geert/CGAL/tmp/results';
$::TESTING = 0;
$::LOCKFILE='/projects/CGAL/submissions/autohandle/data/collect_submission.lock';
$::LOCKCMD='/projects/CGAL/submissions/autohandle/scripts/lockfile';
if ($::TESTING) {
$::PACKAGEDIR='/users/geert/CGAL/tmp/packages';
$::ALL_RESULTS_DIR='/users/geert/CGAL/tmp/results';
$::LOCKFILE='/users/geert/CGAL/tmp/collect_submission.lock';
$::last_version_file = '/users/geert/CGAL/tmp/last_internal_release';
} else {
$::PACKAGEDIR='/users/www/CGAL/Members/Develop/updates/packages';
$::ALL_RESULTS_DIR='/users/www/CGAL/Members/Develop/testsuite';
$::LOCKFILE='/projects/CGAL/submissions/autohandle/data/collect_submission.lock';
$::last_version_file = '/projects/CGAL/lib/last_internal_release';
}
$::SCRIPTDIR=
'/users/www/CGAL/Members/Develop/scripts';
$::MISCPACKAGEDIR=
'/users/www/CGAL/Members/Develop/updates/packages';
$::LOCKCMD=
'/projects/CGAL/submissions/autohandle/scripts/lockfile';
$::last_version_file = '/projects/CGAL/lib/last_internal_release';
#----------------------------------------------------------------#
# unzip_files #
@ -43,6 +49,7 @@ sub unzip_files($@)
my $package = shift;
my ($ITEM, @zip_contents,@to_unzip,$zipped_file);
@zip_contents = `unzip -l $package`;
# remove the first 2 and last 2 lines generated by unzip -l.
shift @zip_contents;
shift @zip_contents;
pop @zip_contents;
@ -63,7 +70,7 @@ sub unzip_files($@)
sub get_file_type($)
{
open SOURCE_FILE, shift;
open SOURCE_FILE, $_[0] or return 0;
while ( <SOURCE_FILE> ) {
if ( /^Copyright \(c\) 1997|8 The CGAL Consortium/ ) {
return 1;
@ -230,19 +237,39 @@ sub list_test_directories($)
sub install_packages()
{
my ($filenaam, $direc);
@_ = glob("$::PACKAGEDIR/*/*.zip");
#really should use readdir and exlude certain directories that are marked as
#such.
my ($filenaam, $direc, %is_permitted_package, $package_name);
print "Installing packages ...\n";
foreach $filenaam (@_) {
open PACKAGES_TO_INCLUDE, "$::PACKAGEDIR/include_in_release" or die;
while (<PACKAGES_TO_INCLUDE>) {
chomp;
s/\s*//g;
next if /^$/;
$is_permitted_package{$_}=1;
}
close PACKAGES_TO_INCLUDE;
opendir PACKAGEDIR, $::PACKAGEDIR or return;
while (defined($package_name = readdir(PACKAGEDIR)) ) {
next unless $is_permitted_package{$package_name};
$filenaam = "$::PACKAGEDIR/$package_name/$package_name.zip";
if (! -f $filenaam) {
print STDERR "WARNING: $filenaam does not exist.\n";
next;
}
print "$filenaam\n";
unzip_files("$filenaam", "include", "test", "examples", "demo", "src", "version","doc_tex");
if (-f 'version') {
open CUR_VERSION, 'version';
while (<CUR_VERSION>) {
next if /^\s*$/;
chomp;
print VERSIONS "$package_name : $_\n";
last;
}
close CUR_VERSION;
}
foreach $direc ( list_test_directories($filenaam)) {
if ( -f 'version' && -d "test/$direc" && ! -f "test/$direc/version") {
copy('version', "test/$direc");
# mkdir("$::THIS_RELEASE_RESULTS/$direc", 0775);
# copy('version', "$::THIS_RELEASE_RESULTS/$direc");
}
if ( -f 'version' && -d "examples/$direc"
&& ! -f "examples/$direc/version") {
@ -251,6 +278,7 @@ sub install_packages()
}
unlink 'version';
}
closedir PACKAGEDIR;
}
#---------------------------------------------------------------#
@ -259,10 +287,10 @@ sub install_packages()
sub install_misc()
{
system 'unzip', '-o', "$::MISCPACKAGEDIR/Auxiliary/Auxiliary.zip";
system 'unzip', '-o', "$::MISCPACKAGEDIR/Configuration/Configuration.zip";
system 'unzip', '-o', "$::MISCPACKAGEDIR/Installation/Installation.zip";
system 'unzip', '-o', "$::MISCPACKAGEDIR/Scripts/Scripts.zip";
system 'unzip', '-oqq', "$::MISCPACKAGEDIR/Auxiliary/Auxiliary.zip";
system 'unzip', '-oqq', "$::MISCPACKAGEDIR/Configuration/Configuration.zip";
system 'unzip', '-oqq', "$::MISCPACKAGEDIR/Installation/Installation.zip";
system 'unzip', '-oqq', "$::MISCPACKAGEDIR/Scripts/Scripts.zip";
unlink 'version', 'description.txt', 'long_description.txt', 'changes.txt';
}
@ -397,11 +425,12 @@ sub unlock()
umask(002);
if ($::CURRENT_DIR ne '/private') {
die "$0 should only be called from directory /private on goya.\n";
if ($::CURRENT_DIR ne '/private/CGAL') {
die "$0 should only be called from directory /private/CGAL on goya.\n";
}
check_call;
mkdir "$::VERSION",0775 or die;
open VERSIONS, ">versions_$::VERSION";
chdir $::VERSION or die;
$::CURRENT_DIR=cwd();
lock;
@ -409,9 +438,10 @@ lock;
install_packages();
install_misc;
unlock;
close VERSIONS;
CreateExampleTestDirs;
make_testscripts;
SetFileHeaders;
SetFileHeaders if !$::TESTING;
set_version_in_config;
make_results_page;