mirror of https://github.com/CGAL/cgal
Remove some antique scripts (pre-CVS area).
This commit is contained in:
parent
216c62b83e
commit
e2b46846b1
|
|
@ -1,205 +0,0 @@
|
|||
#! /sw/bin/perl -T
|
||||
|
||||
use strict;
|
||||
|
||||
|
||||
#--------------------------------------------------------------#
|
||||
# This script scans through the mail box $MAIL_IN, using formail.
|
||||
# It handles requests automatically.
|
||||
# This script deals with reading the mail box and dispatching the separate
|
||||
# mails to the program that treats one mail.
|
||||
# It takes care that there is only one program doing so, by means of locking.
|
||||
#--------------------------------------------------------------#
|
||||
|
||||
# the mail boxes
|
||||
my $Scripts_directory='/projects/CGAL/admin_scripts';
|
||||
my $Data_directory='/projects/CGAL/submissions/autohandle/data';
|
||||
my $LOCKFILE="$Data_directory/collect_submission.lock";
|
||||
my $Mail_directory='/users/geert/PUBLIC/CGAL-submit';
|
||||
my $MAIL_IN="$Mail_directory/incoming-mail";
|
||||
#my $MAIL_OUT="$Mail_directory/handled-mail";
|
||||
my $MAIL_TMP="$Mail_directory/temp-mail";
|
||||
my $SCRIPT="$Scripts_directory/collect_submissions";
|
||||
my $MAIL_PROG="$Scripts_directory/send_cgal_mail";
|
||||
my $treat_one_mail_program="$Scripts_directory/treat_submit_mail";
|
||||
|
||||
# program locations
|
||||
my $FORMAIL="/sw/bin/formail";
|
||||
my $LOCKCMD="/sw/bin/lockfile";
|
||||
|
||||
# the log file
|
||||
my $LOGFILE="$Data_directory/collect_submissions.log";
|
||||
|
||||
#
|
||||
my $seconds_between_invocations=300;
|
||||
my $max_tries_between_warning= int 21600/$seconds_between_invocations;
|
||||
|
||||
$ENV{PATH}='/sbin:/usr/sbin:/usr/bsd:/bin:/usr/bin';
|
||||
|
||||
# variable that is set when there is an attempt to kill this process.
|
||||
my $please_die=0;
|
||||
|
||||
my $invoker = $ENV{USER};
|
||||
if ($invoker =~ /^\s*([-\@\w]+)\s*$/) {
|
||||
$invoker = "$1\@cs.uu.nl";
|
||||
} else {
|
||||
print STDERR <<"TOTHIER";
|
||||
The script $SCRIPT did not start because
|
||||
the USER environment value has a strange value.
|
||||
TOTHIER
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $hostname = $ENV{HOST};
|
||||
if ($hostname =~ /^\s*([-\@\w.]+)\s*$/) {
|
||||
$hostname = $1;
|
||||
} else {
|
||||
print STDERR <<"TOTHIER";
|
||||
The script $SCRIPT did not start because
|
||||
the HOST environment value has a strange value ($hostname).
|
||||
TOTHIER
|
||||
exit 1;
|
||||
}
|
||||
|
||||
|
||||
sub termination_signal_handler {
|
||||
$please_die=1;
|
||||
}
|
||||
|
||||
|
||||
sub initialisation()
|
||||
{
|
||||
#
|
||||
# Disable signals that kill this process.
|
||||
#
|
||||
|
||||
$SIG{INT} = \&termination_signal_handler;
|
||||
$SIG{TERM} = \&termination_signal_handler;
|
||||
|
||||
#
|
||||
# Try to acquire the lock.
|
||||
# Quit with a message if it fails.
|
||||
#
|
||||
|
||||
if ( system("$LOCKCMD", "-r", '10', "$LOCKFILE") != 0) {
|
||||
open NOTICE, "|$MAIL_PROG \"collect_submissions notice\" $invoker";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The script $SCRIPT could not proceed because
|
||||
it could not acquire the needed lock on file $LOCKFILE.
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
exit 1;
|
||||
}
|
||||
#
|
||||
# Now that you have the lock, check to see if there is another process
|
||||
# executing this program. If so, quit.
|
||||
#
|
||||
my $logline = `tail -1 $LOGFILE`;
|
||||
if ($logline !~ /stopped/) {
|
||||
unlink $LOCKFILE;
|
||||
open NOTICE, "|$MAIL_PROG \"collect_submissions notice\" $invoker";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The script $SCRIPT did not proceed because
|
||||
there seems to be another process collecting the mail messages.
|
||||
The file $LOGFILE says:
|
||||
|
||||
$logline
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
exit 1;
|
||||
}
|
||||
#
|
||||
# We can proceed. Record a message to the log file that this process
|
||||
# takes control of dealing with the mail box.
|
||||
#
|
||||
open LOGFILE, ">>$LOGFILE";
|
||||
print LOGFILE "$hostname $$: started executing on ", `date`;
|
||||
close LOGFILE;
|
||||
|
||||
unlink $LOCKFILE;
|
||||
}
|
||||
|
||||
sub new_untreated_mail_file()
|
||||
{
|
||||
my $filename;
|
||||
my $n=1;
|
||||
for ($n=1; $n<1000; ++$n) {
|
||||
$filename="$Mail_directory/untreated_mail_$n";
|
||||
last if (! -f $filename);
|
||||
}
|
||||
return $filename;
|
||||
}
|
||||
|
||||
sub treat_current_mail()
|
||||
{
|
||||
if ( -f $MAIL_IN ) {
|
||||
if ( system("$LOCKCMD", "-r", '10', "$MAIL_IN.lock") == 0) {
|
||||
rename($MAIL_IN, $MAIL_TMP);
|
||||
unlink "$MAIL_IN.lock";
|
||||
if (system("$FORMAIL -ns $treat_one_mail_program < $MAIL_TMP")== 0 )
|
||||
{
|
||||
unlink $MAIL_TMP;
|
||||
} else {
|
||||
my $Save_file = new_untreated_mail_file();
|
||||
rename($MAIL_TMP, $Save_file) or die;
|
||||
open NOTICE,
|
||||
"|$MAIL_PROG \"collect_submissions notice\" $invoker";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The script $SCRIPT could not treat incoming mail.
|
||||
This mail was saved in $Save_file.
|
||||
TOTHIER
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub main_loop()
|
||||
{
|
||||
my $tries_to_go = $max_tries_between_warning;
|
||||
while (! $please_die) {
|
||||
if ( system("$LOCKCMD", "-r", '10', "$LOCKFILE") != 0) {
|
||||
--$tries_to_go;
|
||||
if ($tries_to_go < 0) {
|
||||
open NOTICE,
|
||||
"|$MAIL_PROG \"collect_submissions notice\" $invoker";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The script $SCRIPT could not proceed because
|
||||
it could not acquire the needed lock on file $LOCKFILE.
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
$tries_to_go = $max_tries_between_warning;
|
||||
}
|
||||
} else {
|
||||
$tries_to_go = $max_tries_between_warning;
|
||||
if ( -f $MAIL_TMP ) {
|
||||
open NOTICE,
|
||||
"|$MAIL_PROG \"collect_submissions notice\" $invoker";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The script $SCRIPT has been stopped,
|
||||
because the temporary mail box $MAIL_TMP was not emptied.
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
unlink $LOCKFILE;
|
||||
$please_die = 1;
|
||||
} else {
|
||||
treat_current_mail;
|
||||
}
|
||||
unlink $LOCKFILE;
|
||||
}
|
||||
sleep $seconds_between_invocations unless $please_die;
|
||||
}
|
||||
}
|
||||
|
||||
sub finalisation()
|
||||
{
|
||||
open LOGFILE, ">>$LOGFILE";
|
||||
print LOGFILE "$hostname $$: stopped executing at ", `date`;
|
||||
close LOGFILE;
|
||||
}
|
||||
|
||||
initialisation();
|
||||
main_loop();
|
||||
finalisation();
|
||||
exit 0;
|
||||
|
||||
|
|
@ -1,581 +0,0 @@
|
|||
#!/sw/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use File::Find;
|
||||
use Cwd;
|
||||
# install_submission <url1> <url2> ...
|
||||
|
||||
|
||||
my $testing=0;
|
||||
my $MAIL_PROG='/projects/CGAL/admin_scripts/send_cgal_mail';
|
||||
|
||||
my ($submission, $packagedir, $oldpackagedir, $download_dir,
|
||||
$console_output,
|
||||
$tempdir, $check_source_file_prog, @reply_list);
|
||||
my $WGET;
|
||||
|
||||
my $LOCKCMD="/sw/bin/lockfile";
|
||||
|
||||
umask 002;
|
||||
|
||||
sub init_variables()
|
||||
{
|
||||
if ($testing) {
|
||||
$packagedir='/users/geert/tmp/inst_www/packages';
|
||||
$oldpackagedir='/users/geert/tmp/inst_www/old_packages';
|
||||
$download_dir='/users/geert/tmp/inst_www/download';
|
||||
$console_output=1;
|
||||
$check_source_file_prog=
|
||||
'/users/geert/CGAL/Geert/maintenance/package_handling/check_headers';
|
||||
} else {
|
||||
$packagedir='/users/www/CGAL/Members/Develop/updates/packages';
|
||||
$oldpackagedir='/projects/CGAL/old_packages';
|
||||
$download_dir='/projects/CGAL/submissions/download';
|
||||
$console_output=0;
|
||||
$check_source_file_prog= '/projects/CGAL/admin_scripts/check_headers';
|
||||
}
|
||||
@reply_list = ('geert@cs.uu.nl');
|
||||
$WGET="/projects/CGAL/admin_scripts/get_cgal_html";
|
||||
}
|
||||
|
||||
$ENV{PATH}=
|
||||
'/sw/bin:/sbin:/usr/sbin:/usr/bsd:/bin:/usr/bin:/usr/bin/X11';
|
||||
|
||||
|
||||
|
||||
my $ACTUAL_LOGFILE="/tmp/install_www_submission.log.$$";
|
||||
|
||||
|
||||
|
||||
# write to logfile
|
||||
#
|
||||
|
||||
sub log_header($)
|
||||
{
|
||||
if ( $console_output ) {
|
||||
print "$_[0]\n";
|
||||
}
|
||||
print LOGFILE "-------------------------------------------------------\n";
|
||||
print LOGFILE " $_[0]\n";
|
||||
print LOGFILE "-------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
sub log_msg($)
|
||||
{
|
||||
if ( $console_output ) {
|
||||
print "$0: $_[0]\n";
|
||||
}
|
||||
print LOGFILE " $_[0]\n";
|
||||
}
|
||||
|
||||
sub log_done()
|
||||
{
|
||||
if ( $console_output ) {
|
||||
print " done\n-------------------------------------------------------\n"
|
||||
}
|
||||
print LOGFILE "-------------------------------------------------------\n";
|
||||
print LOGFILE " DONE\n";
|
||||
print LOGFILE "-------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
sub print_usage()
|
||||
{
|
||||
print STDERR "usage: $0 <url1> \n";
|
||||
}
|
||||
|
||||
|
||||
sub make_package_name($)
|
||||
{
|
||||
$_ = $_[0];
|
||||
# remove the directory path
|
||||
s|.*/||;
|
||||
# remove trailing blanks
|
||||
s|\s*$||;
|
||||
# remove suffixes
|
||||
s|\.gz$||;
|
||||
s|\.tar$||;
|
||||
s|\.zip$||;
|
||||
s|\.tgz$||;
|
||||
# remove version
|
||||
# s|([-\.\d]+)+[a-zA-Z]?$||;
|
||||
# or should that be
|
||||
s|([-\.]\d+)+[a-zA-Z]?$||;
|
||||
return $_;
|
||||
}
|
||||
|
||||
|
||||
sub belongs_to_release($)
|
||||
# parameter 1 is the name of the package
|
||||
{
|
||||
open PACKAGES_TO_INCLUDE, "$packagedir/include_in_release" or die;
|
||||
while (<PACKAGES_TO_INCLUDE>) {
|
||||
chomp;
|
||||
if (/^\s*$_[0]\s*$/) {
|
||||
close PACKAGES_TO_INCLUDE;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
close PACKAGES_TO_INCLUDE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub create_package_dir()
|
||||
{
|
||||
$tempdir="$packagedir/TMP$$";
|
||||
mkdir($tempdir, 0775) ;
|
||||
}
|
||||
|
||||
sub unpack_package($)
|
||||
{
|
||||
my ($full_file_name);
|
||||
$full_file_name = shift;
|
||||
chdir $tempdir;
|
||||
if ( $full_file_name =~ /\.tar\s*$/) {
|
||||
system 'gtar', 'xf', "$full_file_name";
|
||||
} elsif ($full_file_name =~ /\.zip\s*$/) {
|
||||
system('unzip', '-oqq', "$full_file_name");
|
||||
} elsif ($full_file_name =~ /\.tgz\s*$/ or $full_file_name =~ /\.tar.gz\s*$/) {
|
||||
system("gunzip -c $full_file_name | gtar xf -");
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return !$?;
|
||||
}
|
||||
|
||||
sub gzip_if_psfile
|
||||
{
|
||||
if ($_ =~ /\.ps\s*$/ and -f $_) {
|
||||
system('gzip',"$_");
|
||||
}
|
||||
}
|
||||
|
||||
sub compress_psfiles()
|
||||
{
|
||||
if (-d 'doc_ps') {
|
||||
find(\&gzip_if_psfile, "doc_ps");
|
||||
}
|
||||
}
|
||||
|
||||
sub get_version($)
|
||||
{
|
||||
my ($version_string, $date);
|
||||
open VERSION, $_[0] or return ();
|
||||
while (<VERSION>) {
|
||||
next if (/^\s*$/);
|
||||
if ( /^\s*(\d+(?:[\.]\d+)*)\s*\((.*)\)\s*$/ ) {
|
||||
$version_string = $1;
|
||||
$date = $2;
|
||||
$_ = <VERSION>;
|
||||
close VERSION;
|
||||
if (/^\s*[Mm]aintainer\s*:\s*(.*)$/ ) {
|
||||
return ($version_string,$date, $1);
|
||||
} else {
|
||||
return ($version_string,$date);
|
||||
}
|
||||
}
|
||||
close VERSION;
|
||||
return ();
|
||||
}
|
||||
close VERSION;
|
||||
return ();
|
||||
}
|
||||
|
||||
sub check_version($)
|
||||
{
|
||||
my $package_name = shift;
|
||||
my ($new_version_string, $new_date, $package_maintainer,
|
||||
$old_version_string, $old_date, $old_package_maintainer,
|
||||
@nversion, @oversion);
|
||||
($new_version_string, $new_date,$package_maintainer) = get_version('version');
|
||||
if (!defined($new_version_string)) {
|
||||
log_msg "Failed to parse version file";
|
||||
return ();
|
||||
}
|
||||
if (!defined($package_maintainer)) {
|
||||
log_msg "Version file does not contain a maintainer line!";
|
||||
return ();
|
||||
}
|
||||
($old_version_string, $old_date, $old_package_maintainer) =
|
||||
get_version("$packagedir/$package_name/version");
|
||||
if (!defined($old_version_string)) {
|
||||
return ($new_version_string, $old_version_string, $package_maintainer);
|
||||
}
|
||||
my ($new_nr,$old_nr);
|
||||
@nversion = split /\./, $new_version_string;
|
||||
@oversion = split /\./, $old_version_string;
|
||||
my $version_ok = 0;
|
||||
while (@nversion) {
|
||||
$new_nr = shift @nversion;
|
||||
$old_nr = shift @oversion;
|
||||
$old_nr = 0 if !defined($old_nr);
|
||||
if ($new_nr < $old_nr) {
|
||||
last;
|
||||
}
|
||||
if ($new_nr > $old_nr) {
|
||||
$version_ok = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (defined($old_package_maintainer)) {
|
||||
if ($old_package_maintainer =~ /\<(.*)\>/) {
|
||||
push(@reply_list, $1);
|
||||
}
|
||||
}
|
||||
if ( $package_maintainer ne $old_package_maintainer) {
|
||||
log_msg "Alert: Maintainer changed from '$old_package_maintainer'" .
|
||||
" to '$package_maintainer'";
|
||||
}
|
||||
if ($version_ok ) {
|
||||
return ($new_version_string,$old_version_string, $package_maintainer);
|
||||
} else {
|
||||
log_msg
|
||||
"Version $new_version_string is not bigger than $old_version_string";
|
||||
return ();
|
||||
}
|
||||
}
|
||||
|
||||
my @source_files_to_check;
|
||||
|
||||
sub add_codefiles
|
||||
{
|
||||
if ( $_ =~ /\.(C|h)\s*$/ and -f $_) {
|
||||
push @source_files_to_check, $File::Find::name;
|
||||
}
|
||||
}
|
||||
|
||||
sub check_codefiles($$)
|
||||
{
|
||||
my $package_name = $_[0];
|
||||
my $package_maintainer = $_[1];
|
||||
@source_files_to_check = ();
|
||||
if (-d 'include') {
|
||||
find(\&add_codefiles, "include");
|
||||
}
|
||||
if (-d 'src') {
|
||||
find(\&add_codefiles, "src");
|
||||
}
|
||||
if (-d 'config') {
|
||||
find(\&add_codefiles, "config");
|
||||
}
|
||||
my $source_file;
|
||||
foreach $source_file (@source_files_to_check) {
|
||||
system("$check_source_file_prog -u -d \"\" -p \"$package_name\" -m \"$package_maintainer\" $source_file >tmpmsg.$$");
|
||||
open CHECK_MSGS, "<tmpmsg.$$";
|
||||
while (<CHECK_MSGS>) {
|
||||
chomp;
|
||||
log_msg($_);
|
||||
}
|
||||
close CHECK_MSGS;
|
||||
unlink "tmpmsg.$$";
|
||||
}
|
||||
}
|
||||
|
||||
sub append_maintainer_file_to_version_file()
|
||||
{
|
||||
open(MAINTAINER,'maintainer') or return;
|
||||
$_ = <MAINTAINER>;
|
||||
if (/^\s*$/) {
|
||||
close(MAINTAINER);
|
||||
return;
|
||||
}
|
||||
open(VERSION,'>>version');
|
||||
if ($_ !~ /^maintainer\s*:/) {
|
||||
print VERSION "maintainer: ";
|
||||
}
|
||||
print VERSION $_;
|
||||
close(VERSION);
|
||||
while (<MAINTAINER>) {
|
||||
if ($_ =~ /\<(.*@.*)\>/) {
|
||||
push(@reply_list, $1);
|
||||
}
|
||||
}
|
||||
close(MAINTAINER);
|
||||
}
|
||||
|
||||
sub filenames_of_package_ok($)
|
||||
{
|
||||
my $rc;
|
||||
$rc = system("/projects/CGAL/admin_scripts/check_filenames_of_package \"$_[0]\" . >tmpmsg.$$");
|
||||
open CHECK_MSGS, "<tmpmsg.$$";
|
||||
while (<CHECK_MSGS>) {
|
||||
chomp;
|
||||
log_msg($_);
|
||||
}
|
||||
close CHECK_MSGS;
|
||||
unlink "tmpmsg.$$";
|
||||
|
||||
$rc >>= 8;
|
||||
if ($rc == 1) {
|
||||
log_msg("ERROR: sorry, there was an internal error at Utrecht.")
|
||||
}
|
||||
if ($rc == 2) {
|
||||
log_msg("ERROR: Your submissions contains files that are in use in another package")
|
||||
}
|
||||
return ($rc == 0);
|
||||
}
|
||||
|
||||
sub check_for_ignored_files()
|
||||
{
|
||||
my %expected_names;
|
||||
my @expected_names = ("include", "test", "examples", "demo", "src",
|
||||
"version","doc_tex","stlport","winutils","auxiliary",
|
||||
"developer_scripts","scripts","cgal_config.bat",
|
||||
"install.txt","INSTALL.win32",
|
||||
"submission_info","maintainer","description.txt",
|
||||
"changes.txt","long_description.txt","doc_ps");
|
||||
my @files_in_directory;
|
||||
opendir THISDIR, "." or die "Cannot open current directory: $!";
|
||||
@files_in_directory = grep !/^\.\.?$/, readdir THISDIR;
|
||||
closedir THISDIR;
|
||||
for (@expected_names) {
|
||||
$expected_names{$_}++;
|
||||
}
|
||||
for (@files_in_directory) {
|
||||
if (!$expected_names{$_}) {
|
||||
log_msg "WARNING: toplevel file $_ will not go into releases!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub check_package($)
|
||||
{
|
||||
my ($version, $prev_version, $package_maintainer);
|
||||
if ( ! -f 'version' ) {
|
||||
log_msg "ERROR: File version is missing!";
|
||||
return 0;
|
||||
}
|
||||
if (-f 'maintainer') {
|
||||
append_maintainer_file_to_version_file();
|
||||
}
|
||||
if ( ! (($version, $prev_version, $package_maintainer) =
|
||||
check_version($_[0])) ) {
|
||||
log_msg "ERROR: version file does not pass the checks!";
|
||||
return 0;
|
||||
}
|
||||
if ( ! -f 'description.txt' ) {
|
||||
log_msg "WARNING: File description.txt is missing!";
|
||||
} else {
|
||||
my $word_count;
|
||||
$word_count = `cat description.txt| wc -w`;
|
||||
if ($word_count > 50) {
|
||||
log_msg "WARNING: File description.txt contains more than 50 words!";
|
||||
}
|
||||
my $rc;
|
||||
$rc = system("sed -e 's/</\\</g' -e 's/>/\\>/g' < description.txt > descr");
|
||||
if ($rc == 0) {
|
||||
rename 'descr', 'description.txt';
|
||||
} else {
|
||||
unlink 'descr';
|
||||
}
|
||||
}
|
||||
# if ( ! -f 'changes.txt' ) {
|
||||
# log_msg "WARNING: File changes.txt is missing!";
|
||||
# }
|
||||
check_for_ignored_files();
|
||||
if ( ! filenames_of_package_ok($_[0])) {
|
||||
return 0;
|
||||
}
|
||||
check_codefiles("$_[0] ($version)", "$package_maintainer");
|
||||
if (defined($prev_version)) {
|
||||
log_msg "Version $version will replace $prev_version";
|
||||
} else {
|
||||
log_msg "Version $version will be installed";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub compress_package($)
|
||||
{
|
||||
my $package_name = shift;
|
||||
compress_psfiles;
|
||||
system 'zip', '-q', '-r', $package_name, glob("*");
|
||||
return !$?;
|
||||
}
|
||||
|
||||
sub remove_files()
|
||||
{
|
||||
my ($file);
|
||||
opendir THISDIR, "." or die;
|
||||
foreach $file (readdir THISDIR) {
|
||||
if (-d $file) {
|
||||
next if $file eq '.';
|
||||
next if $file eq '..';
|
||||
next if $file eq 'doc_ps';
|
||||
system 'rm', '-rf', "$file";
|
||||
} elsif (-f $file) {
|
||||
next if $file =~ /\.zip$/;
|
||||
next if $file eq 'version';
|
||||
next if $file eq 'description.txt';
|
||||
next if $file eq 'long_description.txt';
|
||||
next if $file eq 'changes.txt';
|
||||
next if $file eq 'submission_info';
|
||||
unlink $file;
|
||||
}
|
||||
}
|
||||
closedir THISDIR;
|
||||
}
|
||||
|
||||
sub move_packagedir($)
|
||||
{
|
||||
my $package_name = shift;
|
||||
# first remove the earlier version (if it exists)
|
||||
if ( -d "$oldpackagedir/$package_name" ) {
|
||||
# log_msg "removing directory $oldpackagedir/$package_name"
|
||||
system('rm', '-rf', "$oldpackagedir/$package_name");
|
||||
}
|
||||
|
||||
# move existing version to old packages
|
||||
if ( -d "$packagedir/$package_name" ) {
|
||||
# log_msg "moving directory $packagedir/$package_name to $oldpackagedir/$package_name"
|
||||
print STDERR 'cp',' -r'," $packagedir/$package_name ", $oldpackagedir ,"\n";
|
||||
(system('cp','-r',"$packagedir/$package_name", $oldpackagedir)==0) or die;
|
||||
(system('rm','-r',"$packagedir/$package_name")==0) or die;
|
||||
}
|
||||
|
||||
# log_msg "moving directory $tempdir to $packagedir/$package_name"
|
||||
rename($tempdir, "$packagedir/$package_name") or die;
|
||||
|
||||
system 'chgrp', '-R', 'cgal', "$packagedir/$package_name";
|
||||
system 'chmod', '-R', 'ug+w,a+r', "$packagedir/$package_name" ;
|
||||
}
|
||||
|
||||
sub install_submission($$)
|
||||
{
|
||||
my ($file_name, $file_pathname, $package_name);
|
||||
$file_name = shift;
|
||||
$package_name = shift;
|
||||
$file_pathname = "$download_dir/$file_name";
|
||||
|
||||
if (! unpack_package( $file_pathname) ) {
|
||||
log_msg("Failed to unpack $file_pathname");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!check_package($package_name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!compress_package($package_name)) {
|
||||
log_msg "ERROR: Failed to compress $file_name";
|
||||
return 0;
|
||||
}
|
||||
|
||||
remove_files;
|
||||
move_packagedir($package_name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub do_submission($)
|
||||
{
|
||||
my ($url, $cur_dir,$file_name,$package_name);
|
||||
$url = shift;
|
||||
($file_name) = ($url =~ m|^.*/(.*?)\s*$|);
|
||||
$package_name = make_package_name($file_name);
|
||||
if ($package_name !~ /^[a-zA-Z_]\w*$/) {
|
||||
log_header
|
||||
"ERROR: Filename $file_name was turned into the illegal package name $package_name";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!belongs_to_release($package_name) ) {
|
||||
log_msg "WARNING: package $package_name will not go into releases";
|
||||
log_msg "Send a separate mail to cgal_submit if you want that";
|
||||
}
|
||||
unlink glob("$download_dir/*") if (! $testing);
|
||||
log_header "downloading $url";
|
||||
# my $logfileno = fileno(LOGFILE);
|
||||
# die "Log file not open" if ! defined($logfileno);
|
||||
$cur_dir =cwd();
|
||||
my $lockfile = "$download_dir/$package_name.lock";
|
||||
if ( system("$LOCKCMD", "-r", '10', $lockfile) != 0) {
|
||||
log_msg "ERROR: could not acquire lock on file $lockfile!";
|
||||
return 0;
|
||||
}
|
||||
if (chdir "$download_dir") {
|
||||
system("$WGET $url");
|
||||
chdir $cur_dir;
|
||||
}
|
||||
if ( ! -f "$download_dir/$file_name" ) {
|
||||
log_msg "ERROR: download failed!";
|
||||
return 0;
|
||||
}
|
||||
|
||||
chdir($tempdir);
|
||||
open SUBMISSION_INFO, ">submission_info";
|
||||
print SUBMISSION_INFO "URL: $url.\n";
|
||||
close SUBMISSION_INFO;
|
||||
|
||||
if (install_submission("$file_name",$package_name) ) {
|
||||
log_header "Package was successfully installed!";
|
||||
} else {
|
||||
log_header "ERROR: Installation of the package failed!";
|
||||
unlink $lockfile;
|
||||
return 0;
|
||||
}
|
||||
unlink $lockfile;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------
|
||||
#
|
||||
# main loop
|
||||
#
|
||||
#-----------------------------------
|
||||
|
||||
if ($#ARGV < 0) {
|
||||
print "Too few arguments:",$#ARGV,"\n";
|
||||
print_usage;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $starting_directory = cwd();
|
||||
|
||||
if ($starting_directory =~ m'CGAL/Geert/maintenance') {
|
||||
$testing=1;
|
||||
}
|
||||
|
||||
init_variables();
|
||||
|
||||
$SIG{INT}='IGNORE';
|
||||
$SIG{QUIT} = 'IGNORE';
|
||||
$SIG{TERM} = 'IGNORE';
|
||||
|
||||
unlink $ACTUAL_LOGFILE;
|
||||
system("echo >$ACTUAL_LOGFILE");
|
||||
open LOGFILE, ">$ACTUAL_LOGFILE";
|
||||
|
||||
|
||||
foreach $submission ( @ARGV) {
|
||||
if (!create_package_dir) {
|
||||
log_msg "Failed to create temporary directory $tempdir";
|
||||
exit 1;
|
||||
}
|
||||
do_submission($submission);
|
||||
chdir($starting_directory);
|
||||
if (-d "$tempdir") {
|
||||
system('rm', '-rf', "$tempdir");
|
||||
}
|
||||
}
|
||||
|
||||
close LOGFILE;
|
||||
|
||||
@reply_list = sort(@reply_list);
|
||||
my $prev = "";
|
||||
my @rlist;
|
||||
foreach (@reply_list) {
|
||||
if ($_ ne $prev) {
|
||||
$prev = $_;
|
||||
push(@rlist, $prev);
|
||||
}
|
||||
}
|
||||
|
||||
$ARGV[0] =~ s|.*/||;
|
||||
system "cat $ACTUAL_LOGFILE | $MAIL_PROG \"CGAL submission $ARGV[0]\" @rlist";
|
||||
|
||||
|
||||
unlink $ACTUAL_LOGFILE;
|
||||
|
||||
exit 0;
|
||||
|
||||
|
||||
|
|
@ -1,273 +0,0 @@
|
|||
#!/sw/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $treated_messages_log =
|
||||
'/projects/CGAL/submissions/autohandle/data/treated_submit_messages';
|
||||
my $install_submission_program =
|
||||
'/projects/CGAL/admin_scripts/install_www_submission';
|
||||
|
||||
my $scripts_dir= '/projects/CGAL/admin_scripts';
|
||||
my $receive_testresult_program =
|
||||
'/users/geert/tmp/echo_to_log';
|
||||
my $update_submissions_www_page_program = "$scripts_dir/create_packages_page";
|
||||
my $receive_result_collection_program = "$scripts_dir/treat_result_collection";
|
||||
my $MAIL_PROG="$scripts_dir/send_cgal_mail";
|
||||
#my $MAIL_PROG='/usr/sbin/Mail';
|
||||
|
||||
my $Sender;
|
||||
my $maintainer= 'geert@cs.uu.nl';
|
||||
my $no_of_succesful_submissions = 0;
|
||||
|
||||
my @trusted_hosts = (
|
||||
'cgal.org',
|
||||
'cs.uu.nl',
|
||||
'inria.fr',
|
||||
'informatik.uni-halle.de',
|
||||
'inf.ethz.ch',
|
||||
'math.ethz.ch',
|
||||
'mpi-sb.mpg.de',
|
||||
'inf.fu-berlin.de',
|
||||
'uni-trier.de',
|
||||
'clipper.ens.fr',
|
||||
'schtroumpf.ens.fr',
|
||||
'eleves.ens.fr',
|
||||
'cs.unc.edu',
|
||||
'twi.tudelft.nl',
|
||||
'tau.ac.il');
|
||||
|
||||
sub get_url()
|
||||
{
|
||||
my $html_address="";
|
||||
while (<>) {
|
||||
chomp;
|
||||
if (/^\s*$/) {
|
||||
return $html_address;
|
||||
}
|
||||
s/\s//g;
|
||||
$html_address .= $_;
|
||||
if ($html_address =~ /\.tar\.gz$/) {
|
||||
return $html_address;
|
||||
}
|
||||
if ($html_address =~ /\.tgz$/) {
|
||||
return $html_address;
|
||||
}
|
||||
if ($html_address =~ /\.zip$/) {
|
||||
return $html_address;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
sub is_trusted_url($)
|
||||
{
|
||||
my $URL = shift;
|
||||
foreach (@trusted_hosts) {
|
||||
if ($URL =~ m|^\s*http://[\.\w-]+\.$_[/:]|) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub is_trusted_sender($)
|
||||
{
|
||||
my $sender = shift;
|
||||
foreach (@trusted_hosts) {
|
||||
if ($sender =~ m|$_\s*$|) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub treat_submission($)
|
||||
{
|
||||
my ($URL,$option);
|
||||
$option = shift;
|
||||
$URL = get_url;
|
||||
if ($URL eq "") {
|
||||
# mail $Sender that something went wrong.
|
||||
# do the same to maintainer.
|
||||
open NOTICE, "|$MAIL_PROG \"CGAL autohandle failure!\" $Sender
|
||||
$maintainer";
|
||||
print NOTICE <<"TOTHIER";
|
||||
Your submission (or one of your submissions) had an unrecognized URL.
|
||||
The URL should be on a separate line, directly following the line
|
||||
with the submission keyword, e.g as in:
|
||||
|
||||
submission::
|
||||
http://www.mysite.mycountry/mypackage.zip
|
||||
|
||||
Please resend your request or send a message to cgal-submit asking for more
|
||||
information.
|
||||
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
return;
|
||||
}
|
||||
if (! is_trusted_url($URL)) {
|
||||
open NOTICE, "|$MAIL_PROG \"Untrusted URL!\" $maintainer";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The submission by $Sender with URL
|
||||
$URL
|
||||
is not trusted and did not proceed.
|
||||
Please take manual action.
|
||||
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
return;
|
||||
}
|
||||
if (system("$install_submission_program", "$URL") == 0)
|
||||
{ ++$no_of_succesful_submissions; }
|
||||
}
|
||||
|
||||
sub treat_result_collection()
|
||||
{
|
||||
my ($URL);
|
||||
$URL = get_url;
|
||||
if (!$URL) {
|
||||
# mail $Sender that something went wrong.
|
||||
# do the same to maintainer.
|
||||
return;
|
||||
}
|
||||
if (! is_trusted_url($URL)) {
|
||||
open NOTICE, "|$MAIL_PROG \"Untrusted URL!\" $maintainer";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The Testresult with URL
|
||||
$URL
|
||||
is not trusted and did not proceed.
|
||||
Please take manual action.
|
||||
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
return;
|
||||
}
|
||||
system("$receive_result_collection_program", $URL);
|
||||
}
|
||||
|
||||
sub treat_testresult($)
|
||||
{
|
||||
my ($URL,$release);
|
||||
$release = shift;
|
||||
$URL = get_url;
|
||||
if (!$URL) {
|
||||
# mail $Sender that something went wrong.
|
||||
# do the same to maintainer.
|
||||
return;
|
||||
}
|
||||
if (! is_trusted_url($URL)) {
|
||||
open NOTICE, "|$MAIL_PROG \"Untrusted URL!\" $maintainer";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The Testresult with URL
|
||||
$URL
|
||||
is not trusted and did not proceed.
|
||||
Please take manual action.
|
||||
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
return;
|
||||
}
|
||||
system("$receive_testresult_program", "$release", "$Sender", "$URL");
|
||||
}
|
||||
|
||||
sub message_processed($)
|
||||
{
|
||||
my $message_id = shift;
|
||||
open(TREATED_MESSAGES, "<$treated_messages_log");
|
||||
while (<TREATED_MESSAGES>) {
|
||||
chomp;
|
||||
if ($message_id eq $_) {
|
||||
close TREATED_MESSAGES;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
close TREATED_MESSAGES;
|
||||
open(TREATED_MESSAGES, ">>$treated_messages_log");
|
||||
print TREATED_MESSAGES "$message_id\n";
|
||||
close TREATED_MESSAGES;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub main()
|
||||
{
|
||||
my ($from);
|
||||
my $command_found = 0;
|
||||
$_ = <>;
|
||||
chomp;
|
||||
($from, $Sender) = split;
|
||||
if ($from ne "From") {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
$Sender =~ s/\s*//g;
|
||||
|
||||
if ( $Sender eq 'daemon@cs.uu.nl') {
|
||||
while(<>) {
|
||||
if (/^\s*Sender\s*:\s*(.+)$/) {
|
||||
$Sender = $1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!is_trusted_sender($Sender)) {
|
||||
open NOTICE, "|$MAIL_PROG \"Untrusted sender!\" $maintainer";
|
||||
print NOTICE <<"TOTHIER";
|
||||
The submission with sender
|
||||
$Sender
|
||||
is not trusted and did not proceed.
|
||||
-------------- start of message --------------
|
||||
TOTHIER
|
||||
while(<>) {
|
||||
print NOTICE $_;
|
||||
}
|
||||
print NOTICE "-------------- end of message --------------\n";
|
||||
close NOTICE;
|
||||
exit 0;
|
||||
}
|
||||
|
||||
while(<>) {
|
||||
if (/^\s*message-id\s*:\s*(.*?)\s*$/i) {
|
||||
last if message_processed($1);
|
||||
}
|
||||
elsif (/^\s*submission\s*:\s*([^:]*?)\s*:\s*$/) {
|
||||
$command_found = 1;
|
||||
treat_submission($1);
|
||||
}
|
||||
elsif (/^\s*result[\s_-]?collection\s*:\s*:\s*$/){
|
||||
$command_found = 1;
|
||||
treat_result_collection();
|
||||
}
|
||||
elsif (/^\s*testresult\s*:\s*([^:]*?)\s*:\s*$/){
|
||||
$command_found = 1;
|
||||
treat_testresult($1);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
if ($no_of_succesful_submissions > 0) {
|
||||
system($update_submissions_www_page_program);
|
||||
}
|
||||
if (!$command_found) {
|
||||
open NOTICE, "|$MAIL_PROG \"CGAL autohandle warning\" $Sender";
|
||||
print NOTICE <<"TOTHIER";
|
||||
Your submission did not contain any command.
|
||||
A command is e.g.
|
||||
|
||||
submission::
|
||||
|
||||
Note the two colons (and note that it is on a separate line).
|
||||
|
||||
TOTHIER
|
||||
close NOTICE;
|
||||
}
|
||||
}
|
||||
|
||||
# don't break off processing of a message
|
||||
|
||||
$SIG{INT}='IGNORE';
|
||||
$SIG{QUIT} = 'IGNORE';
|
||||
$SIG{TERM} = 'IGNORE';
|
||||
|
||||
main;
|
||||
exit 0;
|
||||
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
#!/sw/bin/perl -w
|
||||
|
||||
#use strict
|
||||
|
||||
#Checking for correct usage
|
||||
|
||||
sub usage()
|
||||
{
|
||||
print STDERR "usage: $0 versionfile1 versionfile2\n";
|
||||
print STDERR "where versionfile1 and versionfile2 are filenames like\n";
|
||||
print STDERR "directory/versions_CGAL-3.4-I-28.\n";
|
||||
print STDERR "The order of the two version files is not important.\n\n";
|
||||
}
|
||||
|
||||
if ($#ARGV != 1) {
|
||||
usage();
|
||||
die "\n";
|
||||
}
|
||||
|
||||
my @testers = (
|
||||
'geert',
|
||||
# 'd.pasechnik@twi.tudelft.nl',
|
||||
'hert@mpi-sb.mpg.de',
|
||||
# 'stschirr@mpi-sb.mpg.de',
|
||||
'hoffmann@inf.ethz.ch',
|
||||
'rineau@clipper.ens.fr',
|
||||
# 'Francois.Rebufat@sophia.inria.fr',
|
||||
'Mariette.Yvinec@sophia.inria.fr',
|
||||
'Sylvain.Pion@sophia.inria.fr',
|
||||
'Andreas.Fabri@sophia.inria.fr',
|
||||
'Radu.Ursu@sophia.inria.fr',
|
||||
);
|
||||
my $scripts_dir= "/projects/CGAL/admin_scripts/";
|
||||
my $data_dir= "${scripts_dir}DATA/";
|
||||
my $testsuite_dir = '/users/www/CGAL/Members/Develop/testsuite';
|
||||
my $diff_dir = "/tmp/CGAL/diffs";
|
||||
my $release_dir = "/users/www/CGAL/Members/Develop/updates";
|
||||
my $new_version;
|
||||
my $old_version;
|
||||
|
||||
my ($v1,$v2,$v3,$u1,$u2,$u3);
|
||||
my $versionv=shift or die;
|
||||
if ( !(($v1,$v2,$v3)= ($versionv =~ /versions_CGAL-(\d+)\.(\d+)-I-(\d+)$/)) ) {
|
||||
usage();
|
||||
die "Invalid first version file with name $versionv\n";
|
||||
}
|
||||
my $versionu=shift or die;
|
||||
if ( !(($u1,$u2,$u3)= ($versionu =~ /versions_CGAL-(\d+)\.(\d+)-I-(\d+)$/) ) ) {
|
||||
usage();
|
||||
die "Invalid second version file with name $versionu\n";
|
||||
}
|
||||
|
||||
my $swap_versions = 0;
|
||||
if ($v1 == $u1 && $v2 == $u2 && $v3 == $u3) {
|
||||
die "Versions are the same ($v1-$v2-$v3\n)";
|
||||
}
|
||||
|
||||
if ($u1 > $v1 || ($u1 == $v1 && ($u2 > $v2 || ($u2 == $v2 && $u3 > $v3))) ) {
|
||||
$swap_versions = 1;
|
||||
}
|
||||
|
||||
die "File $versionv does not exist or is not readable" if (! -r $versionv );
|
||||
die "File $versionu does not exist or is not readable" if (! -r $versionu );
|
||||
die "No write permission in $data_dir" if (! -w $data_dir);
|
||||
umask(02);
|
||||
|
||||
# end of checking of input
|
||||
|
||||
my %new_versions;
|
||||
my %old_versions;
|
||||
|
||||
unlink "${data_dir}version_info",
|
||||
"${data_dir}new_versions",
|
||||
"${data_dir}new_packages",
|
||||
"${data_dir}removed_packages",
|
||||
"${data_dir}latest_versions",
|
||||
"${data_dir}version_info";
|
||||
|
||||
open(VERSION_INFO, ">${data_dir}version_info");
|
||||
if ($swap_versions) {
|
||||
$new_version = "CGAL-${u1}.${u2}-I-${u3}";
|
||||
$old_version = "CGAL-${v1}.${v2}-I-${v3}";
|
||||
print VERSION_INFO "CGAL-${u1}.${u2}-I-${u3} ";
|
||||
print VERSION_INFO "CGAL-${v1}.${v2}-I-${v3}\n";
|
||||
open(NEW_VERSIONS,"<${versionu}") or die;
|
||||
open(OLD_VERSIONS,"<$versionv") or die;
|
||||
} else {
|
||||
$old_version = "CGAL-${u1}.${u2}-I-${u3}";
|
||||
$new_version = "CGAL-${v1}.${v2}-I-${v3}";
|
||||
print VERSION_INFO "CGAL-${v1}.${v2}-I-${v3} ";
|
||||
print VERSION_INFO "CGAL-${u1}.${u2}-I-${u3}\n";
|
||||
open(NEW_VERSIONS,"<$versionv") or die;
|
||||
open(OLD_VERSIONS,"<$versionu") or die;
|
||||
}
|
||||
|
||||
close VERSION_INFO or die;
|
||||
|
||||
open(UPDATED,">${data_dir}new_versions") or die;
|
||||
system('chgrp','cgal',"${data_dir}new_versions");
|
||||
open(NEW_PACKAGES,">${data_dir}new_packages") or die;
|
||||
system('chgrp','cgal',"${data_dir}new_packages");
|
||||
open(DELETED,">${data_dir}removed_packages") or die;
|
||||
system('chgrp','cgal',"${data_dir}removed_packages");
|
||||
open(FORMATTED_VERSIONS,">${data_dir}latest_versions") or die;
|
||||
system('chgrp','cgal',"${data_dir}latest_versions");
|
||||
|
||||
|
||||
while(<OLD_VERSIONS>) {
|
||||
if (m/^\s*(.*?)\s*:\s*(.*?)\s*$/) {
|
||||
$old_versions{$1}=$2;
|
||||
}
|
||||
}
|
||||
|
||||
close OLD_VERSIONS or die;
|
||||
|
||||
my $pckge='aapje';
|
||||
my $vrsion;
|
||||
|
||||
format FORMATTED_VERSIONS=
|
||||
@<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
$pckge, $vrsion
|
||||
.
|
||||
|
||||
|
||||
while(<NEW_VERSIONS>) {
|
||||
if (m/^\s*(.*?)\s*:\s*(.*?)\s*$/) {
|
||||
($pckge,$vrsion) = ($1,$2);
|
||||
write FORMATTED_VERSIONS;
|
||||
$new_versions{$1}=$2;
|
||||
}
|
||||
}
|
||||
|
||||
close NEW_VERSIONS or die;
|
||||
|
||||
my ($key, $value);
|
||||
|
||||
while (($key,$value) = each %new_versions) {
|
||||
if (exists $old_versions{$key} ) {
|
||||
if ( $value ne $old_versions{$key} ) {
|
||||
print UPDATED "$key\n";
|
||||
}
|
||||
} else {
|
||||
print NEW_PACKAGES "$key\n";
|
||||
}
|
||||
}
|
||||
|
||||
while (($key,$value) = each %old_versions) {
|
||||
if (!exists $new_versions{$key} ) {
|
||||
print DELETED "$key\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
close(UPDATED) or die;
|
||||
close(NEW_PACKAGES) or die;
|
||||
close(DELETED) or die;
|
||||
close(FORMATTED_VERSIONS) or die;
|
||||
|
||||
#make_diffs();
|
||||
|
||||
system("${scripts_dir}print_release_page");
|
||||
|
||||
chdir($testsuite_dir);
|
||||
system("echo","./create_testresult_page", '-p', $old_version, $new_version);
|
||||
system("./create_testresult_page", '-p', $old_version, $new_version);
|
||||
|
||||
sub make_diffs()
|
||||
{
|
||||
system('mkdir','-p',"$diff_dir");
|
||||
chdir $diff_dir;
|
||||
system("gunzip -c $release_dir/$old_version.tar.gz | gtar xf - ");
|
||||
system("gunzip -c $release_dir/$new_version.tar.gz | gtar xf -" );
|
||||
system("diff -urPN $old_version $new_version > diffs_$new_version");
|
||||
system('rm','-r',$old_version,$new_version);
|
||||
system('gzip', "diffs_$new_version");
|
||||
system('cp',"diffs_$new_version.gz","$testsuite_dir/$new_version");
|
||||
system('cp',"diffs_$new_version.gz","$release_dir");
|
||||
system('rm',"diffs_$new_version.gz");
|
||||
}
|
||||
|
||||
open (TEST_REQUEST, "| ${scripts_dir}send_cgal_mail -s 'CGAL autotest request' @testers") or die;
|
||||
print TEST_REQUEST <<"EOM"
|
||||
release: $new_version
|
||||
EOM
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#!/sw/bin/perl
|
||||
|
||||
#use strict
|
||||
|
||||
my $pckge='aapje';
|
||||
my $vrsion;
|
||||
|
||||
format STDOUT =
|
||||
@<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
$pckge, $vrsion
|
||||
.
|
||||
|
||||
#$~ = "Nice_Output";
|
||||
|
||||
while(<STDIN>) {
|
||||
if (m/^\s*(.*?)\s*:\s*(.*?)\s*$/) {
|
||||
($pckge,$vrsion) = ($1,$2);
|
||||
#print STDERR $pckge, $vrsion,"\n";
|
||||
write;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
#!/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;
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
WGETRC=/projects/CGAL/admin_scripts/DATA/wgetrc
|
||||
export WGETRC
|
||||
|
||||
/sw/bin/wget $1
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#! /sw/bin/perl5
|
||||
|
||||
use strict;
|
||||
|
||||
$ENV{PATH}="$ENV{PATH}:/sw/bin";
|
||||
my $subject = shift;
|
||||
if ($subject eq "-s") {
|
||||
$subject = shift;
|
||||
}
|
||||
my $recipients = join(' ',@ARGV);
|
||||
open NOTI, "| '/sw/sbin/sendmail' '-t'";
|
||||
#open NOTI, "| '/usr/bin/cat'";
|
||||
print NOTI <<"TOTHIER";
|
||||
From: geert+cgal-submit\@cs.uu.nl
|
||||
Subject: $subject
|
||||
To: $recipients
|
||||
|
||||
TOTHIER
|
||||
|
||||
while ( <STDIN> ) {
|
||||
print NOTI $_;
|
||||
}
|
||||
close NOTI;
|
||||
exit 0;
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
old_results_dir=/projects/CGAL/old_results
|
||||
tempdir=/tmp
|
||||
|
||||
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
if [ -d "$1" ] ; then
|
||||
if [ -d "$1/Polygon" -o -d "$1/src" ] ; then
|
||||
echo "emptying $1" >&2
|
||||
if [ -x "$1" ] ;
|
||||
then
|
||||
cp -r "$1" $tempdir
|
||||
find "$tempdir/$1" -name '*.gz' | xargs gunzip
|
||||
(cd $tempdir; tar cf $1.tar $1; gzip --best $1.tar; rm -r $1)
|
||||
if mv $tempdir/$1.tar.gz $old_results_dir
|
||||
then
|
||||
chgrp cgal $old_results_dir/$1.tar.gz
|
||||
chmod g+w $old_results_dir/$1.tar.gz
|
||||
cd $1
|
||||
rm */* ;
|
||||
rm -f diffs*.gz
|
||||
rmdir * 2>/dev/null
|
||||
cd ..
|
||||
echo "Moved $1 to $old_results_dir" >&2
|
||||
else
|
||||
echo "Could not mv $tempdir/$1.tar.gz $old_results_dir"
|
||||
fi
|
||||
else
|
||||
echo "Could not cd to $1" >&2
|
||||
fi
|
||||
else
|
||||
echo "$1 seems to be emptied already" >&2
|
||||
fi
|
||||
else
|
||||
echo "$1 is not a directory" >&2
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#!/sw/bin/perl5
|
||||
|
||||
use strict;
|
||||
|
||||
my $new_platform = "";
|
||||
while (<>) {
|
||||
if ( m/Build on\s+(\S+):\s/ ) {
|
||||
$new_platform = $1;
|
||||
print "Found ($new_platform)\n";
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $new_platform ) {
|
||||
print "No platform\n";
|
||||
}
|
||||
|
||||
while ($new_platform) {
|
||||
open PLATFORM_OUTPUT, ">$new_platform" or die;
|
||||
$new_platform = "";
|
||||
print PLATFORM_OUTPUT $_;
|
||||
|
||||
while (<>) {
|
||||
if ( m/Build on\s+(\S+):\s/ ) {
|
||||
$new_platform = $1;
|
||||
print "Found ($new_platform)\n";
|
||||
last;
|
||||
} else {
|
||||
print PLATFORM_OUTPUT $_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
lockfile=/private/cgal_testannounce.lock
|
||||
annoucements=/private/cgal_testannouncements
|
||||
notify=/projects/CGAL/admin_scripts/send_cgal_mail
|
||||
|
||||
|
||||
if /sw/bin/lockfile -60 -r 100 -l 600 $lockfile
|
||||
then
|
||||
if files=`ls /private/CGAL/testannouncements/* 2>/dev/null`
|
||||
then
|
||||
for file in $files
|
||||
do
|
||||
base=`basename $file`
|
||||
if $notify -s "New test results (${base})" 'cgal-develop-l@postino.mpi-sb.mpg.de' < $file
|
||||
then
|
||||
rm -f $file
|
||||
fi
|
||||
done
|
||||
fi
|
||||
rm -f $lockfile
|
||||
fi
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
#!/sw/bin/perl5 -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $tmpdir;
|
||||
|
||||
sub usage {
|
||||
print STDERR "$0: usage\n";
|
||||
print STDERR "$0 result1.tar[.gz] ...\n";
|
||||
}
|
||||
|
||||
sub make_tempdir()
|
||||
{
|
||||
my $dirno = 1;
|
||||
$tmpdir = "TMP$dirno";
|
||||
while ( -f $tmpdir or -d $tmpdir ) {
|
||||
++$dirno;
|
||||
$tmpdir = "TMP$dirno";
|
||||
}
|
||||
mkdir($tmpdir,0770) or die "Cannot create temporary directory $tmpdir\n";
|
||||
}
|
||||
|
||||
sub one_archive($)
|
||||
{
|
||||
my $archive = shift;
|
||||
make_tempdir();
|
||||
if (! -f $archive) {
|
||||
print STDERR "$archive is not a valid filename\n";
|
||||
return 0;
|
||||
}
|
||||
if ( $archive =~ m/\.gz$/ ) {
|
||||
system("/sw/bin/gunzip", "$archive") == 0 or return 0;
|
||||
$archive =~ s/\.gz$//;
|
||||
}
|
||||
if ( $archive =~ m/.*\.tgz$/ ) {
|
||||
system("gunzip", "$archive") == 0 or return 0;
|
||||
$archive =~ s/\.tgz$/.tar/;
|
||||
}
|
||||
if ( $archive !~ /\.tar$/) {
|
||||
print STDERR "$0: $archive not a tar file\n";
|
||||
return 0;
|
||||
}
|
||||
rename("$archive","$tmpdir/$archive") or die;
|
||||
chdir("$tmpdir") or die;
|
||||
system("tar", "xf", "$archive") == 0 or die;
|
||||
unlink($archive);
|
||||
system('gzip',glob("*/*"));
|
||||
system('chmod','-R','a+r,og+w','.');
|
||||
system('tar', 'cf', "../$archive", glob("*")) == 0 or die;
|
||||
chdir('..') or die;
|
||||
system('rm', '-rf', "$tmpdir")== 0 or die;
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub all_archives() {
|
||||
my $archive;
|
||||
foreach $archive (@ARGV) {
|
||||
if (one_archive($archive)) {
|
||||
print STDERR "$archive succesfully reformatted.\n";
|
||||
} else {
|
||||
print STDERR "Could not reformat $archive\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($#ARGV < 0) {
|
||||
usage;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
all_archives();
|
||||
|
||||
|
||||
|
||||
#--------------------------
|
||||
# parse_mail such that you get
|
||||
# $test_url ==
|
||||
# (http://)($host_and_directory)/($release_version)(-test)($number)(.tar.gz)
|
||||
# make tmpdir under /private/CGAL and go there
|
||||
# wget $test_url
|
||||
# gunzip $name == ${release_version}-test${number}.tar.gz
|
||||
# rm *.txt
|
||||
# $unpack_dir = cwd
|
||||
# $testresult_dir = $CGWW/testsuite/$release_version
|
||||
# test if $testresult_dir exists.
|
||||
# foreach $name.gz in result*gz {
|
||||
# to_zipped_format $name.gz
|
||||
# cd $testresult_dir
|
||||
# tar xf $unpack_dir/$name
|
||||
# cd $unpack_dir
|
||||
# }
|
||||
# cd $testresult_dir/..
|
||||
# make_www_page ${release_version}
|
||||
|
||||
Loading…
Reference in New Issue