@source_path = config.path
unless @source == :dir
raise "'#{@source_path} is not a git repository!" unless Testing.git?(@source_path)
- @checkout = config.checkout if Testing.git_tree?(@source_path, config.checkout)
+ @treeish = config.treeish if Testing.git_tree?(@source_path, config.treeish)
end
when :tar
raise "Tarball '#{config.path}' not found!" unless Testing.tarball?(config.path)
build_path = @source_path
case @source
when :git
- if @checkout
- tarball = Testing.archive_git(@source_path, @checkout, "kernel-#{@name}", Testing.build_dir)
+ if @treeish
+ tarball = Testing.archive_git(@source_path, @treeish, "kernel-#{@name}", Testing.build_dir)
build_path = Testing.extract_tarball(tarball, Testing.build_dir)
end
when :tar
end
end
- # Ensure that we have a kernel config.
+ # Ensure that we have a kernel config. Either set in the configuration
+ # or found in the given dir.
def ensure_config(dir)
config = File.join(dir, ".config")
@config ||= config
# Build the kernel and move it to the given location.
def build_kernel(dir, kernel)
Dir.chdir(dir) do
- # TODO what about logging
+ # TODO what about logging and error handling
`make clean ARCH=um 2>&1`
# the next command might interact with the user. since '`' redirects
# stdout we would have to use 'system'. currently we use 'yes' to
@source_path = config.path
unless @source == :dir
raise "'#{@source_path} is not a git repository!" unless Testing.git?(@source_path)
- @checkout = config.checkout if Testing.git_tree?(@source_path, config.checkout)
+ @treeish = config.treeish if Testing.git_tree?(@source_path, config.treeish)
end
when :tar
raise "Tarball '#{config.path}' not found!" unless config.path && Testing.tarball?(config.path)
@build_path = File.join(Testing.build_dir, "strongswan-#{name}")
case @source
when :git
- if @checkout
- tarball = Testing.archive_git(@source_path, @checkout, "strongswan-#{@name}", Testing.build_dir)
+ if @treeish
+ tarball = Testing.archive_git(@source_path, @treeish, "strongswan-#{@name}", Testing.build_dir)
@source_path = @build_path = Testing.extract_tarball(tarball, Testing.build_dir)
end
when :tar
private
# Run the configure script located in directory 'sources' within the
- # directory given as 'build'. autogen.sh is run if configure does not yet
- # exist.
+ # directory given as 'build'. autogen.sh is run if configure does not
+ # yet exist.
def configure(sources, build)
script = File.join(sources, "configure")
unless File.executable?(script)