From: <mg...@us...> - 2009-09-23 04:17:57
|
Revision: 4490 http://planeshift.svn.sourceforge.net/planeshift/?rev=4490&view=rev Author: mgist Date: 2009-09-23 04:17:48 +0000 (Wed, 23 Sep 2009) Log Message: ----------- - Update jobber. Modified Paths: -------------- trunk/tools/jobber-svn.pl trunk/tools/jobber.cfg Removed Paths: ------------- trunk/tools/svnwrapper Modified: trunk/tools/jobber-svn.pl =================================================================== --- trunk/tools/jobber-svn.pl 2009-09-22 19:44:08 UTC (rev 4489) +++ trunk/tools/jobber-svn.pl 2009-09-23 04:17:48 UTC (rev 4490) @@ -98,7 +98,7 @@ # as noted above. # # $jobber_svn_flags [optional] -# Additional flags to pass to each of the `cvs' command invocations. An +# Additional flags to pass to each of the `svn' command invocations. An # obvious example would be to set this variable to "-z9" to enable # compression. No default. # @@ -200,6 +200,9 @@ # Online browseable files are placed into # $jobber_browseable_dir/$dir, and downloadable packages are placed # into $jobber_package_dir/$dir. +# package-dir [optional] +# Directory name into which downloadable package files for this +# task are published. If omitted, "dir" is used. # name [required] # Base package name used when generating downloadable packages via # @jobber_archivers (see below). When published, the base package @@ -246,6 +249,8 @@ # Archives with 'tar' and compresses with 'gzip'. Extension: .tgz # $ARCHIVER_ZIP # Archives and compresses with 'zip'. Extension: .zip +# $ARCHIVER_LZMA +# Archives with 'tar' and compresses with 'lzma'. Extension: .tar.lzma # # Default: ($ARCHIVER_BZIP2, $ARCHIVER_GZIP, $ARCHIVER_ZIP) # @@ -279,7 +284,7 @@ $Getopt::Long::ignorecase = 0; my $PROG_NAME = 'jobber-svn.pl'; -my $PROG_VERSION = '35'; +my $PROG_VERSION = '40'; my $AUTHOR_NAME = 'Eric Sunshine'; my $AUTHOR_EMAIL = 'sun...@su...'; my $COPYRIGHT = "Copyright (C) 2000-2005 by $AUTHOR_NAME <$AUTHOR_EMAIL>\nConverted for SVN support by Marten Svanfeldt"; @@ -296,6 +301,10 @@ 'name' => 'zip', 'extension' => 'zip', 'command' => 'zip -q -r ~D ~S' }; +my $ARCHIVER_LZMA = { + 'name' => 'lzma', + 'extension' => 'tar.lzma', + 'command' => 'tar --create --file=- ~S | lzma > ~D' }; my $jobber_project_root = undef; my $jobber_svn_base_url = undef; @@ -308,14 +317,15 @@ my $jobber_temp_dir = '/tmp'; my @jobber_binary_override = ('(?i)\.(dsw|dsp)$'); my @jobber_tasks = (); -my @jobber_archivers = ($ARCHIVER_BZIP2, $ARCHIVER_GZIP, $ARCHIVER_ZIP); +my @jobber_archivers = ($ARCHIVER_BZIP2, $ARCHIVER_GZIP, $ARCHIVER_ZIP, $ARCHIVER_LZMA); my %jobber_properties = (); # SVN binary name -my $jobber_svn_command = getcwd . '/svnwrapper'; +my $jobber_svn_command = '/usr/bin/svn'; my $CONFIG_FILE = undef; my $TESTING = undef; +my $EXPORT = 1; my $CONV_DIR = undef; my $CAPTURED_OUTPUT = ''; @@ -323,6 +333,7 @@ 'set=s' => \%jobber_properties, 'config=s' => \$CONFIG_FILE, 'test!' => \$TESTING, + 'export!' => \$EXPORT, 'help' => \&option_help, 'version|V' => \&option_version, '<>' => \&option_error @@ -454,6 +465,14 @@ } #------------------------------------------------------------------------------ +# Remove a directory. +#------------------------------------------------------------------------------ +sub remove_dir { + my $dir = shift; + rmdir($dir) or expire("rmdir($dir)"); +} + +#------------------------------------------------------------------------------ # Generate a temporary name in a directory. Perl tmpnam() only works with # '/tmp', so must do this manually, instead. #------------------------------------------------------------------------------ @@ -491,7 +510,7 @@ #------------------------------------------------------------------------------ # Perform a recursive scan of a directory and return a sorted list of all # files and directories contained therein, except for the ".svn" directory and -# its control files. Also ignores ".cvsignore" files. +# its control files. Also ignores ".cvsignore" files and ".svn" directories. #------------------------------------------------------------------------------ sub scandir { my $dir = shift; @@ -509,7 +528,7 @@ return unless @{$files}; my $paths = prepare_pathnames(@{$files}); print "Invoking SVN delete: ${\scalar(@{$files})} paths\n"; - run_command("$jobber_svn_command $jobber_svn_flags delete $paths") unless $TESTING; + run_command("$jobber_svn_command delete $paths $jobber_svn_flags") unless $TESTING; } #------------------------------------------------------------------------------ @@ -542,7 +561,7 @@ $flags = '' unless defined($flags); print "Invoking SVN add: ${\scalar(@{$files})} paths" . ($flags ? " [$flags]" : '') . "\n"; - run_command("$jobber_svn_command $jobber_svn_flags add $flags $paths") unless $TESTING; + run_command("$jobber_svn_command add $flags $paths $jobber_svn_flags") unless $TESTING; } #------------------------------------------------------------------------------ @@ -584,7 +603,7 @@ #------------------------------------------------------------------------------ sub svn_checkout { print "URL: $jobber_svn_base_url\n"; - run_command("$jobber_svn_command co $jobber_svn_flags $jobber_svn_base_url"); + run_command("$jobber_svn_command co $jobber_svn_base_url $jobber_svn_flags"); } #------------------------------------------------------------------------------ @@ -595,11 +614,11 @@ my $line = '-' x length($message); my $dirs = ''; foreach my $task (@jobber_tasks) { - $dirs .= " @{$task->{'olddirs'}}" if exists $task->{'olddeirs'}; + $dirs .= " @{$task->{'olddirs'}}" if exists $task->{'olddirs'}; } if ($dirs) { print "$line\n$message\n"; - my $changes = run_command("$jobber_svn_command $jobber_svn_flags status $dirs"); + my $changes = run_command("$jobber_svn_command status $dirs $jobber_svn_flags"); print $changes ? $changes : " No files modified\n", "$line\n"; } } @@ -617,7 +636,7 @@ print RESPFILE $message; close(RESPFILE); - run_command("$jobber_svn_command $jobber_svn_flags --username $jobber_svn_user commit -F $respFileName $dirsAsText") + run_command("$jobber_svn_command commit --username $jobber_svn_user -F $respFileName $dirsAsText $jobber_svn_flags") unless $TESTING; unlink($respFileName); } @@ -647,6 +666,13 @@ sub run_tasks { foreach my $task (@jobber_tasks) { next unless exists($task->{'command'}); + my $does_svn = exists($task->{'olddirs'}); + my $does_export = exists($task->{'export'}); + if ($does_export && !$EXPORT && !$does_svn) + { + print "Skipping: $task->{'action'} $task->{'name'}.\n"; + next; + } print "$task->{'action'} $task->{'name'}.\n"; run_command($task->{'command'}); } @@ -731,6 +757,11 @@ foreach my $task (@jobber_tasks) { next unless exists $task->{'export'} and (exists $task->{'olddirs'} or exists $task->{'newdirs'}); + if (!$EXPORT) + { + print "Skipped publishing $task->{'name'}.\n"; + next; + } print "Publishing $task->{'name'}.\n"; next if $TESTING; create_directory_deep($jobber_browseable_dir, $jobber_public_group) @@ -750,6 +781,10 @@ print " Installing.\n"; rename_file($dst, $old_dir) if -e $dst; + create_directory_deep($dst, $jobber_public_group); + # create_directory_deep also creates the directory which we want to + # move in, so delete that first + remove_dir($dst); rename_file($new_dir, $dst); print " Cleaning.\n"; @@ -793,6 +828,11 @@ foreach my $task (@jobber_tasks) { next unless exists $task->{'export'} and (exists $task->{'olddirs'} or exists $task->{'newdirs'}); + if (!$EXPORT) + { + print "Skipped Packaging $task->{'name'}.\n"; + next; + } print "Packaging $task->{'name'}.\n"; my @srclist = exists $task->{'newdirs'} ? @@ -808,7 +848,8 @@ } my $base = $export->{'name'}; - my $dst = "$jobber_package_dir/$export->{'dir'}"; + my $dst = "$jobber_package_dir/" . ($export->{'package-dir'} ? + $export->{'package-dir'} : $export->{'dir'}); create_directory_deep($dst, $jobber_public_group) unless $TESTING; foreach my $archiver (@jobber_archivers) { publish_package($archiver, $appear, $dst, $base, ' '); @@ -895,8 +936,6 @@ last; } } - - # $jobber_cvs_sources = $jobber_project_root unless $jobber_svna_sources; } #------------------------------------------------------------------------------ @@ -970,6 +1009,9 @@ named jobber.cfg or .jobber. -t --test Process all tasks but do not actually modify the SVN repository or export any files. + --noexport + Process all tasks and update the SVN repository but don't + export any files. -h --help Display this usage message. -V --version Display the version number of @{[basename($0)]} Modified: trunk/tools/jobber.cfg =================================================================== --- trunk/tools/jobber.cfg 2009-09-22 19:44:08 UTC (rev 4489) +++ trunk/tools/jobber.cfg 2009-09-23 04:17:48 UTC (rev 4490) @@ -23,7 +23,7 @@ #============================================================================== # Minimum jobber.pl version expected by this configuration. -jobber_require(35); +jobber_require(40); #============================================================================== @@ -43,57 +43,23 @@ # "--set svnuser=someone". #------------------------------------------------------------------------------ exists $jobber_properties{'svnuser'} or - die "ERROR: you must set the SVN username via '--set svnuser=someone'}n"; + die "ERROR: you must set the SVN username via '--set svnuser=someone'\n"; $jobber_svn_user = $jobber_properties{'svnuser'}; #------------------------------------------------------------------------------ -# SourceForge's shell machine does not have compilers or other build tools -# installed, so we can not invoke Crystal Space's configure script to prepare -# the project. Instead, we fake up project configuration by manually creating -# a minimal Jamconfig and Jamfile. +# The parent location where browseable and downloadable Crystal Space +# documentation is placed. Used in the composition of $jobber_browseable_dir +# and $jobber_package_dir. #------------------------------------------------------------------------------ -my $configure = - "psver=`grep AC_INIT configure.ac | awk '{ print \$2 }' | tr -d [],` \n" . - "psverlist=`echo \$psver | tr '.' ' '`\n" . - "pscopy=`sed '/\\[[Cc]opyright/!d;s/[^[]*\\[\\([^]]*\\)\\].*/\\1/'" . - " < configure.ac`\n" . - "cat << EOF > Jamconfig\n" . - "CMD.C++ ?= \"g++\" ;\n" . - "CMD.C++CPP ?= \"g++ -E\" ;\n" . - "CMD.CC ?= \"gcc\" ;\n" . - "CMD.DOXYGEN ?= \"doxygen\" ;\n" . - "CMD.DVIPS ?= \"dvips\" ;\n" . - "CMD.LINK ?= \"\\\$(CMD.C++)\" ;\n" . - "CMD.MAKEINFO ?= \"makeinfo\" ;\n" . - "CMD.MKDIR ?= \"mkdir\" ;\n" . - "CMD.MKDIRS ?= \"mkdir -p\" ;\n" . - "CMD.OBJC ?= \"gcc\" ;\n" . - "CMD.OBJC++ ?= \"g++\" ;\n" . - "JAM ?= \"jam\" ;\n" . - "MODE ?= \"optimize\" ;\n" . - "MSVCGEN_SILENT ?= \"yes\" ;\n" . - "PACKAGE_COPYRIGHT ?= \"\$pscopy\" ;\n" . - "PACKAGE_HOMEPAGE ?= \"http://www.planeshift.it/\" ;\n" . - "PACKAGE_LONGNAME ?= \"PlaneShift a 3d MMORPG\" ;\n" . - "PACKAGE_NAME ?= \"PlaneShift\" ;\n" . - "PACKAGE_STRING ?= \"PlaneShift \$psver\" ;\n" . - "PACKAGE_VERSION ?= \"\$psver\" ;\n" . - "PACKAGE_VERSION_LIST ?= \$psverlist ;\n" . - "RUN_TTREE ?= \"ttree\" ;\n" . - "TARGET.OS ?= \"UNIX\" ;\n" . - "EOF\n" . - "sed 's/\@top_srcdir\@/./;s/\@top_builddir\@//' < Jamfile.in > Jamfile\n" . - "mkdir -p include\n" . - "cat << EOF > include/csconfig.h\n" . - "#ifndef __CS_CSCONFIG_H__\n" . - "#define __CS_CSCONFIG_H__\n" . - "#define CS_HAVE_INTTYPES_H\n" . - "#define CS_HAVE_STDINT_H\n" . - "#endif // __CS_CSCONFIG_H__\n" . - "EOF\n" - ; +my $cs_base_doc_dir = '/home/crystal/www/crystalspace3d.org/htdocs/docs'; #------------------------------------------------------------------------------ +# Command to configure project after checkout but before the jobber tasks are +# run. +#------------------------------------------------------------------------------ +my $configure = "./configure --quiet --disable-make-emulation"; + +#------------------------------------------------------------------------------ # Ensure that various tools can be found. #------------------------------------------------------------------------------ $ENV{'PATH'} .= ':/usr/local/bin'; @@ -103,12 +69,15 @@ # *** Jobber Configuration Section *** #============================================================================== +my $svn_branch = $jobber_properties{'svnbranch'}; +$svn_branch = 'trunk' unless $svn_branch; #------------------------------------------------------------------------------ # $jobber_project_root [required] # Root directory of the project. This is the top-level directory created # as a side-effect of retrieving the files from SVN. No default. #------------------------------------------------------------------------------ -$jobber_project_root = 'trunk'; +$jobber_project_root = $svn_branch; +$jobber_project_root =~ s/.*\///; #------------------------------------------------------------------------------ # $jobber_svn_base_url [required] @@ -116,7 +85,7 @@ # must allow "write" access to the repository if files are to be committed # back to the repository. No default. #------------------------------------------------------------------------------ -$jobber_svn_base_url = "https://planeshift.svn.sourceforge.net/svnroot/planeshift/trunk"; +$jobber_svn_base_url = "https://planeshift.svn.sourceforge.net/svnroot/planeshift/$svn_branch"; #------------------------------------------------------------------------------ # $jobber_svn_flags [optional] @@ -126,6 +95,23 @@ $jobber_svn_flags = '-q'; #------------------------------------------------------------------------------ +# $jobber_browseable_dir [conditional] +# Absolute path of directory into which generated documentation should be +# copied for online browsing. This setting is required if any tasks publish +# documentation, otherwise it is optional. No default. +#------------------------------------------------------------------------------ +$jobber_browseable_dir = "$cs_base_doc_dir/online"; + +#------------------------------------------------------------------------------ +# $jobber_package_dir [conditional] +# Absolute path of directory into which archives of generated documentation +# are placed to make them available for download in package form. This +# setting is required if any tasks publish documentation, otherwise it is +# optional. No default. +#------------------------------------------------------------------------------ +$jobber_package_dir = "$cs_base_doc_dir/download"; + +#------------------------------------------------------------------------------ # $jobber_public_group [optional] # Group name to which to assign ownership of all directories which will # exist after script's termination (such as the "browseable" directory). @@ -253,7 +239,7 @@ 'command' => $configure }, { 'name' => 'Visual-C++ project files', 'action' => 'Repairing', - 'command' => 'jam msvcgen', + 'command' => 'jam -sMSVCGEN_SILENT=yes msvcgen', 'newdirs' => ['out/mk/msvc', 'out/mk/msvc8', 'out/mk/msvc9'], 'olddirs' => ['mk/msvc', 'mk/msvc8', 'mk/msvc9'], 'log' => 'Automated Visual-C++ project file repair.' }, @@ -284,7 +270,9 @@ # Archives with 'tar' and compresses with 'gzip'. Extension: .tgz # $ARCHIVER_ZIP # Archives and compresses with 'zip'. Extension: .zip +# $ARCHIVER_LZMA +# Archives with 'tar' and compresses with 'lzma'. Extension: .tar.lzma # -# Default: ($ARCHIVER_BZIP2, $ARCHIVER_GZIP, $ARCHIVER_ZIP) +# Default: ($ARCHIVER_BZIP2, $ARCHIVER_GZIP, $ARCHIVER_ZIP, $ARCHIVER_LZMA) #------------------------------------------------------------------------------ -# @jobber_archivers = ($ARCHIVER_BZIP2, $ARCHIVER_GZIP, $ARCHIVER_ZIP); +# @jobber_archivers = ($ARCHIVER_BZIP2, $ARCHIVER_GZIP, $ARCHIVER_ZIP, $ARCHIVER_LZMA); Deleted: trunk/tools/svnwrapper =================================================================== --- trunk/tools/svnwrapper 2009-09-22 19:44:08 UTC (rev 4489) +++ trunk/tools/svnwrapper 2009-09-23 04:17:48 UTC (rev 4490) @@ -1,48 +0,0 @@ -#!/bin/bash - -# Special SVN wrapper to ease operations against SF. -# Pass through all options to normal SVN, however when doing a -# checkout it also runs a number of updates afterwards to -# compensate for SFs sometimes broken SVN. - -eval adress=\$$# - -MAXITER=2 - -if [[ "$1" == "co" || "$1" == "checkout" ]] -then - # First do a normal checkout, pass on all options to SVN - # Then if it fails, do at most MAXITER updates - DIRNAME=`basename $adress` - - svn $@ - - if [[ $? ]] - then - echo "FAILED, Trying updates" - - # Set some variables - # Shift away co and url - shift 2 - - var0=0 - while [ "$var0" -lt "$MAXITER" ] - do - svn up $@ $DIRNAME - - if [[ $? = 0 ]] - then - break - fi - var0=$(($var0+1)) - done - - exit 0 - fi - - exit 0 -fi - -# Just pass stuff on to SVN - -svn $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |