From 0bd866d9b534a0e9c617707696e93c6550e011e6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 6 Sep 2008 14:41:17 +0000 Subject: [PATCH] Removing files temporarily. --HG-- branch : sourcemod-1.0.x extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402509 --- tools/buildbot/bootstrap.pl | 59 ------------------ tools/buildbot/helpers.pm | 116 ----------------------------------- tools/buildbot/package.pl | 79 ------------------------ tools/buildbot/startbuild.pl | 39 ------------ 4 files changed, 293 deletions(-) delete mode 100644 tools/buildbot/bootstrap.pl delete mode 100644 tools/buildbot/helpers.pm delete mode 100644 tools/buildbot/package.pl delete mode 100644 tools/buildbot/startbuild.pl diff --git a/tools/buildbot/bootstrap.pl b/tools/buildbot/bootstrap.pl deleted file mode 100644 index df7e995e..00000000 --- a/tools/buildbot/bootstrap.pl +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/perl - -use strict; -use Cwd; -use File::Basename; - -my ($myself, $path) = fileparse($0); -chdir($path); - -require 'helpers.pm'; - -chdir(Build::PathFormat('../builder')); -if ($^O eq "linux") -{ - Build::Command('make clean'); - Build::Command('make'); -} -else -{ - Build::Command('"' . $ENV{'MSVC7'} . '" /Rebuild Release builder.csproj'); - Build::Command('move ' . Build::PathFormat('bin/Release/builder.exe') . ' .'); -} - -die "Unable to build builder tool!\n" unless -e 'builder.exe'; - -#Go back to main source dir. -chdir(Build::PathFormat('../..')); - -#Get the source path. -my ($root) = getcwd(); - -#Create output folder if it doesn't exist. -if (!(-d 'OUTPUT')) { - mkdir('OUTPUT') or die("Failed to create output folder: $!\n"); -} - -#Write the configuration file. -open(CONF, '>build.cfg') or die("Failed to write build.cfg: $!\n"); -print CONF "OutputBase = " . Build::PathFormat($root . '/OUTPUT') . "\n"; -print CONF "SourceBase = $root\n"; -if ($^O eq "linux") -{ - print CONF "BuilderPath = /usr/bin/make\n"; -} -else -{ - print CONF "BuilderPath = " . $ENV{'MSVC8'} . "\n"; -} -close(CONF); - -#Do the annoying revision bumping. -#Linux needs some help here. -if ($^O eq "linux") -{ - Build::Command("flip -u modules.versions"); - Build::Command("flip -u tools/versionchanger.pl"); - Build::Command("chmod +x tools/versionchanger.pl"); -} -Build::Command(Build::PathFormat('tools/versionchanger.pl')); diff --git a/tools/buildbot/helpers.pm b/tools/buildbot/helpers.pm deleted file mode 100644 index c1b5de72..00000000 --- a/tools/buildbot/helpers.pm +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/perl - -use strict; -use Cwd; - -package Build; - -our $SVN = "/usr/bin/svn"; -our $SVN_USER = 'dvander'; -our $SVN_ARGS = ''; -our $SVN_VERSION = "/usr/bin/svnversion"; - -sub Revision -{ - my ($str)=(@_); - my $dir = $SVN_VERSION; - - my $data = Command($dir . ' -c ' . $str); - if ($data =~ /(\d+):(\d+)/) - { - return $2; - } elsif ($data =~ /(\d+)/) { - return $1; - } else { - return 0; - } -} - -sub Delete -{ - my ($str)=(@_); - if ($^O =~ /MSWin/) - { - Command("del /S /F /Q \"$str\""); - Command("rmdir /S /Q \"$str\""); - } else { - Command("rm -rf $str"); - } - return !(-e $str); -} - -sub Copy -{ - my ($src,$dest)=(@_); - if ($^O =~ /MSWin/) - { - Command("copy \"$src\" \"$dest\" /y"); - } else { - Command("cp \"$src\" \"$dest\""); - } - return (-e $dest); -} - -sub Move -{ - my ($src,$dest)=(@_); - if ($^O =~ /MSWin/) - { - Command("move \"$src\" \"$dest\""); - } else { - Command("mv \"$src\" \"$dest\""); - } - return (-e $dest); -} - -sub Command -{ - my($cmd)=(@_); - print "$cmd\n"; - return `$cmd`; -} - -sub PathFormat -{ - my ($str)=(@_); - if ($^O =~ /MSWin/) - { - $str =~ s#/#\\#g; - } else { - $str =~ s#\\#/#g; - } - return $str; -} - -sub SVN_Remove -{ - my ($file)=(@_); - my ($path, $name); - if ($^O =~ /MSWin/) - { - ($path, $name) = ($file =~ /(.+)\/([^\/]+)$/); - } else { - ($path, $name) = ($file =~ /(.+)\\([^\\]+)$/); - } - my $dir = Cwd::cwd(); - chdir($path); - Command($SVN . ' ' . $SVN_ARGS . ' delete ' . $name); - chdir($dir); -} - -sub SVN_Add -{ - my ($file)=(@_); - my ($path, $name); - if ($^O =~ /MSWin/) - { - ($path, $name) = ($file =~ /(.+)\/([^\/]+)$/); - } else { - ($path, $name) = ($file =~ /(.+)\\([^\\]+)$/); - } - my $dir = Cwd::cwd(); - chdir($path); - Command($SVN . ' ' . $SVN_ARGS . ' add ' . $name); - chdir($dir); -} - diff --git a/tools/buildbot/package.pl b/tools/buildbot/package.pl deleted file mode 100644 index 99e33b68..00000000 --- a/tools/buildbot/package.pl +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl - -use strict; -use Cwd; -use File::Basename; -use Net::FTP; - -my ($ftp_file, $ftp_host, $ftp_user, $ftp_pass, $ftp_path); - -$ftp_file = shift; - -open(FTP, $ftp_file) or die "Unable to read FTP config file $ftp_file: $!\n"; -$ftp_host = ; -$ftp_user = ; -$ftp_pass = ; -$ftp_path = ; -close(FTP); - -chomp $ftp_host; -chomp $ftp_user; -chomp $ftp_pass; -chomp $ftp_path; - -my ($myself, $path) = fileparse($0); -chdir($path); - -require 'helpers.pm'; - -#Switch to the output folder. -chdir(Build::PathFormat('../../OUTPUT/base')); - -my ($version); - -$version = `cat ../../product.version`; -chomp $version; -$version .= '.' . Build::Revision('../..'); - -my ($filename); -$filename = 'sourcemod-' . $version; -if ($^O eq "linux") -{ - $filename .= '.tar.gz'; - print "tar zcvf $filename addons cfg\n"; - system("tar zcvf $filename addons cfg"); -} -else -{ - $filename .= '.zip'; - print "zip -r $filename addons cfg\n"; - system("zip -r $filename addons cfg"); -} - -my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/); -$ftp_path .= "/$major.$minor"; - -my ($ftp); - -$ftp = Net::FTP->new($ftp_host, Debug => 0) - or die "Cannot connect to host $ftp_host: $@"; - -$ftp->login($ftp_user, $ftp_pass) - or die "Cannot connect to host $ftp_host as $ftp_user: " . $ftp->message . "\n"; - -if ($ftp_path ne '') -{ - $ftp->cwd($ftp_path) - or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n"; -} - -$ftp->binary(); -$ftp->put($filename) - or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n"; - -$ftp->close(); - -print "File sent to drop site as $filename -- build succeeded.\n"; - -exit(0); - diff --git a/tools/buildbot/startbuild.pl b/tools/buildbot/startbuild.pl deleted file mode 100644 index 9c371032..00000000 --- a/tools/buildbot/startbuild.pl +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/perl - -use File::Basename; - -my ($myself, $path) = fileparse($0); -chdir($path); - -require 'helpers.pm'; - -chdir('..'); -chdir('..'); - -my ($cmd, $output); - -$cmd = Build::PathFormat('tools/builder/builder.exe') . ' build.cfg 2>&1'; - -if ($^O eq "linux") -{ - $cmd = 'mono ' . $cmd; -} - -system($cmd); - -if ($? == -1) -{ - die "Build failed: $!\n"; -} -elsif ($^O eq "linux" and $? & 127) -{ - die "Build died :(\n"; -} -elsif ($? >> 8 != 0) -{ - die "Build failed with exit code: " . ($? >> 8) . "\n"; -} -else -{ - exit(0); -}