autobuild 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes.txt +6 -0
- data/Manifest.txt +1 -0
- data/bin/autobuild +6 -2
- data/lib/autobuild.rb +1 -1
- data/lib/autobuild/import/git.rb +12 -4
- data/lib/autobuild/packages/orogen.rb +48 -0
- data/lib/autobuild/reporting.rb +13 -3
- metadata +5 -4
data/Changes.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== Version 1.2.3
|
2
|
+
* Fix git update again. FETCH_HEAD may resolve as an ID which is not the one
|
3
|
+
to be selected for merge
|
4
|
+
* Make the dependency on RMail optional
|
5
|
+
* added the orogen package type
|
6
|
+
|
1
7
|
== Version 1.2
|
2
8
|
* Fix git update
|
3
9
|
* Fix cmake dependency handling. Give a way to always run cmake before running
|
data/Manifest.txt
CHANGED
@@ -20,6 +20,7 @@ lib/autobuild/packages/autotools.rb
|
|
20
20
|
lib/autobuild/packages/cmake.rb
|
21
21
|
lib/autobuild/packages/genom.rb
|
22
22
|
lib/autobuild/packages/import.rb
|
23
|
+
lib/autobuild/packages/orogen.rb
|
23
24
|
lib/autobuild/packages/pkgconfig.rb
|
24
25
|
lib/autobuild/pkgconfig.rb
|
25
26
|
lib/autobuild/reporting.rb
|
data/bin/autobuild
CHANGED
@@ -29,10 +29,14 @@ begin
|
|
29
29
|
load conffile
|
30
30
|
|
31
31
|
if Autobuild.mail[:to]
|
32
|
-
|
32
|
+
if !Autobuild::HAS_RMAIL
|
33
|
+
STDERR.puts "RMail is not available. Mail notification is disabled"
|
34
|
+
else
|
35
|
+
Reporting << MailReporter.new(Autobuild.mail)
|
36
|
+
end
|
33
37
|
end
|
34
38
|
|
35
|
-
targets
|
39
|
+
targets = ['import']
|
36
40
|
targets += ['prepare', 'build'] if Autobuild.do_build
|
37
41
|
targets.each do |phase|
|
38
42
|
packages = Autobuild.packages
|
data/lib/autobuild.rb
CHANGED
data/lib/autobuild/import/git.rb
CHANGED
@@ -31,18 +31,26 @@ module Autobuild
|
|
31
31
|
def update(package)
|
32
32
|
Dir.chdir(package.srcdir) do
|
33
33
|
if !File.directory?('.git')
|
34
|
-
raise "#{package.srcdir} is not a git repository"
|
34
|
+
raise ConfigException, "#{package.srcdir} is not a git repository"
|
35
35
|
end
|
36
36
|
|
37
37
|
# Fetch and merge if the merge leads to a fast-forward
|
38
38
|
Subprocess.run(package.name, :import, Autobuild.tool('git'), 'fetch')
|
39
|
-
|
39
|
+
if !File.readable?( File.join('.git', 'FETCH_HEAD') )
|
40
|
+
return
|
41
|
+
end
|
42
|
+
|
43
|
+
fetch_commit = File.readlines( File.join('.git', 'FETCH_HEAD') ).
|
44
|
+
delete_if { |l| l =~ /not-for-merge/ }
|
45
|
+
return if fetch_commit.empty?
|
46
|
+
fetch_commit = fetch_commit.first.split(/\s+/).first
|
47
|
+
|
48
|
+
common_commit = `git merge-base HEAD #{fetch_commit}`.chomp
|
40
49
|
head_commit = `git rev-parse HEAD`.chomp
|
41
|
-
fetch_commit = `git rev-parse FETCH_HEAD`.chomp
|
42
50
|
|
43
51
|
if common_commit != fetch_commit
|
44
52
|
if merge? || common_commit == head_commit
|
45
|
-
Subprocess.run(package.name, :import, Autobuild.tool('git'), 'merge',
|
53
|
+
Subprocess.run(package.name, :import, Autobuild.tool('git'), 'merge', fetch_commit)
|
46
54
|
else
|
47
55
|
raise "importing the current version would lead to a non fast-forward"
|
48
56
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Autobuild
|
2
|
+
def self.orogen(opts, &proc)
|
3
|
+
Orogen.new(opts, &proc)
|
4
|
+
end
|
5
|
+
|
6
|
+
class Orogen < CMake
|
7
|
+
class << self
|
8
|
+
attr_accessor :corba
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_accessor :corba
|
12
|
+
|
13
|
+
attr_accessor :orogen_file
|
14
|
+
def initialize(*args, &config)
|
15
|
+
@corba = Orogen.corba
|
16
|
+
super
|
17
|
+
|
18
|
+
@orogen_file ||= "#{File.basename(name)}.orogen"
|
19
|
+
|
20
|
+
task "#{name}-prepare" => genstamp
|
21
|
+
file genstamp => File.join(srcdir, orogen_file) do
|
22
|
+
regen
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def depends_on(*packages)
|
27
|
+
super
|
28
|
+
|
29
|
+
packages.each do |p|
|
30
|
+
file genstamp => Package[p].installstamp
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def genstamp; File.join(srcdir, '.orogen', 'orogen-stamp') end
|
35
|
+
|
36
|
+
def regen
|
37
|
+
cmdline = [Autobuild.tool('orogen')]
|
38
|
+
cmdline << '--corba' if corba
|
39
|
+
cmdline << orogen_file
|
40
|
+
|
41
|
+
Dir.chdir(srcdir) do
|
42
|
+
Subprocess.run name, 'orogen', *cmdline
|
43
|
+
touch_stamp genstamp
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
data/lib/autobuild/reporting.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
|
-
|
2
|
-
require 'rmail
|
1
|
+
begin
|
2
|
+
require 'rmail'
|
3
|
+
require 'rmail/serialize'
|
4
|
+
Autobuild::HAS_RMAIL = true
|
5
|
+
rescue LoadError
|
6
|
+
Autobuild::HAS_RMAIL = false
|
7
|
+
end
|
8
|
+
|
3
9
|
require 'net/smtp'
|
4
10
|
require 'socket'
|
5
11
|
require 'etc'
|
@@ -70,8 +76,11 @@ module Autobuild
|
|
70
76
|
end
|
71
77
|
end
|
72
78
|
end
|
79
|
+
end
|
73
80
|
|
74
|
-
|
81
|
+
## Report by mail
|
82
|
+
if Autobuild::HAS_RMAIL
|
83
|
+
module Autobuild
|
75
84
|
class MailReporter < Reporter
|
76
85
|
def default_mail
|
77
86
|
Etc::endpwent
|
@@ -154,5 +163,6 @@ module RMail
|
|
154
163
|
end
|
155
164
|
end
|
156
165
|
end
|
166
|
+
end # if Autobuild::HAS_RMAIL
|
157
167
|
|
158
168
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-09 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -44,13 +44,13 @@ dependencies:
|
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: hoe
|
47
|
-
type: :
|
47
|
+
type: :development
|
48
48
|
version_requirement:
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
53
|
+
version: 1.7.0
|
54
54
|
version:
|
55
55
|
description: This work is licensed under the GPLv2 license. See License.txt for details == What's autobuild ? Autobuild imports, configures, builds and installs various kinds of software packages. It can be used in software development to make sure that nothing is broken in the build process of a set of packages, or can be used as an automated installation tool. Autobuild config files are Ruby scripts which configure rake to * imports the package from a SCM or (optionnaly) updates it * configures it. This phase can handle code generation, configuration (for instance for autotools-based packages), ... * build * install It takes the dependencies between packages into account in its build process, updates the needed environment variables (+PKG_CONFIG_PATH+, +PATH+, +LD_LIBRARY_PATH+, ...)
|
56
56
|
email: sylvain.joyeux@m4x.org
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/autobuild/packages/cmake.rb
|
86
86
|
- lib/autobuild/packages/genom.rb
|
87
87
|
- lib/autobuild/packages/import.rb
|
88
|
+
- lib/autobuild/packages/orogen.rb
|
88
89
|
- lib/autobuild/packages/pkgconfig.rb
|
89
90
|
- lib/autobuild/pkgconfig.rb
|
90
91
|
- lib/autobuild/reporting.rb
|