autobuild 1.2.8 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes.txt +7 -0
- data/lib/autobuild.rb +1 -1
- data/lib/autobuild/config.rb +8 -5
- data/lib/autobuild/subcommand.rb +11 -2
- metadata +1 -1
data/Changes.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== Version 1.2.9
|
2
|
+
* small usability issue
|
3
|
+
- provide the --keep-oldlogs command line option and the
|
4
|
+
Autobuild.erase_oldlogs configuration flag to configure whether old logs
|
5
|
+
should be kept (new data being appended to them), or erased
|
6
|
+
- change the default behaviour from keeping old logs to erasing them
|
7
|
+
|
1
8
|
== Version 1.2.8
|
2
9
|
* small fix
|
3
10
|
- fixes --mail-smtp. This now works even without port specification.
|
data/lib/autobuild.rb
CHANGED
data/lib/autobuild/config.rb
CHANGED
@@ -11,9 +11,9 @@ end
|
|
11
11
|
# (see Autobuild::DEFAULT_OPTIONS) for the default values)
|
12
12
|
# nice:: the nice value at which we should spawn subprocesses
|
13
13
|
# srcdir:: the base source directory. If a package defines a relative srcdir, then
|
14
|
-
#
|
14
|
+
# it is defined relatively to Autobuild.srcdir. Defaults to the current directory.
|
15
15
|
# prefix:: the base install directory. If a package defines a relative prefix, then
|
16
|
-
#
|
16
|
+
# it is defined relatively to Autobuild.prefix.
|
17
17
|
# verbose:: if true, displays all subprocesses output
|
18
18
|
# debug:: more verbose than 'verbose': displays Rake's debugging output
|
19
19
|
# do_update:: if we should update the packages
|
@@ -24,13 +24,15 @@ end
|
|
24
24
|
# clean_log:: remove all logs before starting the build
|
25
25
|
# packages:: a list of packages to build specifically
|
26
26
|
# default_packages:: the list of packages to build if Autobuild.packages is empty.
|
27
|
-
#
|
27
|
+
# It this array is empty too, build all defined packages.
|
28
|
+
# keep_oldlogs:: if true, new runs will be appended to existing logfiles.
|
29
|
+
# Otherwise, the existing logfile contents is erased.
|
28
30
|
module Autobuild
|
29
31
|
class << self
|
30
32
|
%w{ nice srcdir prefix
|
31
33
|
verbose debug do_update do_build only_doc do_doc doc_errors
|
32
34
|
daemonize clean_log packages default_packages
|
33
|
-
doc_prefix }.each do |name|
|
35
|
+
doc_prefix keep_oldlogs}.each do |name|
|
34
36
|
attr_accessor name
|
35
37
|
end
|
36
38
|
|
@@ -49,7 +51,7 @@ module Autobuild
|
|
49
51
|
:verbose => false, :debug => false, :do_build => true, :do_update => true,
|
50
52
|
:daemonize => false, :packages => [], :default_packages => [],
|
51
53
|
:only_doc => false, :do_doc => true, :doc_errors => false,
|
52
|
-
:doc_prefix => 'doc' }
|
54
|
+
:doc_prefix => 'doc', :keep_oldlogs => false }
|
53
55
|
|
54
56
|
@programs = Hash.new
|
55
57
|
DEFAULT_OPTIONS.each do |name, value|
|
@@ -163,6 +165,7 @@ module Autobuild
|
|
163
165
|
opts.separator "Program output"
|
164
166
|
opts.on("--[no-]verbose", "display output of commands on stdout") do |@verbose| end
|
165
167
|
opts.on("--[no-]debug", "debug information (for debugging purposes)") do |@debug| end
|
168
|
+
opts.on("--keep-oldlogs", "old logs will be kept, new program output being appended") do |@keep_oldlogs| end
|
166
169
|
|
167
170
|
opts.separator ""
|
168
171
|
opts.separator "Mail reports"
|
data/lib/autobuild/subcommand.rb
CHANGED
@@ -27,8 +27,17 @@ module Autobuild::Subprocess
|
|
27
27
|
input_streams = command.collect { |o| $1 if o =~ /^\<(.+)/ }.compact
|
28
28
|
command.reject! { |o| o =~ /^\<(.+)/ }
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
open_flag = if Autobuild.keep_oldlogs then 'a'
|
31
|
+
else 'w'
|
32
|
+
end
|
33
|
+
|
34
|
+
status = File.open(logname, open_flag) do |logfile|
|
35
|
+
if Autobuild.keep_oldlogs
|
36
|
+
logfile.puts
|
37
|
+
end
|
38
|
+
logfile.puts "#{Time.now}: running"
|
39
|
+
logfile.puts " #{command.join(" ")}"
|
40
|
+
logfile.puts
|
32
41
|
logfile.flush
|
33
42
|
|
34
43
|
pread, pwrite = IO.pipe # to feed subprocess stdin
|