lib/autobuild/config.rb in autobuild-1.2.8 vs lib/autobuild/config.rb in autobuild-1.2.9

- old
+ new

@@ -9,30 +9,32 @@ # Main Autobuild module. This module includes the build configuration options # (see Autobuild::DEFAULT_OPTIONS) for the default values) # nice:: the nice value at which we should spawn subprocesses # srcdir:: the base source directory. If a package defines a relative srcdir, then -# it is defined relatively to Autobuild.srcdir. Defaults to the current directory. +# it is defined relatively to Autobuild.srcdir. Defaults to the current directory. # prefix:: the base install directory. If a package defines a relative prefix, then -# it is defined relatively to Autobuild.prefix. +# it is defined relatively to Autobuild.prefix. # verbose:: if true, displays all subprocesses output # debug:: more verbose than 'verbose': displays Rake's debugging output # do_update:: if we should update the packages # do_build:: if we should build the packages # do_doc:: if we should produce the documentation # doc_errors:: if errors during the documentation generation are treated as errors # daemonize:: if the build should go into daemon mode (only if the daemons gem is available) # clean_log:: remove all logs before starting the build # packages:: a list of packages to build specifically # default_packages:: the list of packages to build if Autobuild.packages is empty. -# It this array is empty too, build all defined packages. +# It this array is empty too, build all defined packages. +# keep_oldlogs:: if true, new runs will be appended to existing logfiles. +# Otherwise, the existing logfile contents is erased. module Autobuild class << self %w{ nice srcdir prefix verbose debug do_update do_build only_doc do_doc doc_errors daemonize clean_log packages default_packages - doc_prefix }.each do |name| + doc_prefix keep_oldlogs}.each do |name| attr_accessor name end # Configure the programs used by different packages attr_reader :programs @@ -47,11 +49,11 @@ DEFAULT_OPTIONS = { :nice => 0, :srcdir => Dir.pwd, :prefix => Dir.pwd, :logdir => nil, :verbose => false, :debug => false, :do_build => true, :do_update => true, :daemonize => false, :packages => [], :default_packages => [], :only_doc => false, :do_doc => true, :doc_errors => false, - :doc_prefix => 'doc' } + :doc_prefix => 'doc', :keep_oldlogs => false } @programs = Hash.new DEFAULT_OPTIONS.each do |name, value| send("#{name}=", value) end @@ -161,9 +163,10 @@ opts.separator "" opts.separator "Program output" opts.on("--[no-]verbose", "display output of commands on stdout") do |@verbose| end opts.on("--[no-]debug", "debug information (for debugging purposes)") do |@debug| end + opts.on("--keep-oldlogs", "old logs will be kept, new program output being appended") do |@keep_oldlogs| end opts.separator "" opts.separator "Mail reports" opts.on("--mail-from EMAIL", String, "From: field of the sent mails") do |from_email| mail[:from] = from_email