Skip to content

Commit

Permalink
Merge pull request pierre#5 from stevenschlansker/version-without-art…
Browse files Browse the repository at this point in the history
…ifact-name

Version without artifact name
  • Loading branch information
hgschmie committed Sep 12, 2012
2 parents 0c745fc + 246737c commit 2fa5875
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/galaxy/agent_remote_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ def become! req_build_version, requested_config_path, config_uri=nil, binaries_u
raise error_reason
end
end

prop_builder = Galaxy::Properties::Builder.new config_uri.nil? ? @repository_base : config_uri, @http_user, @http_password, @logger

build_version = Galaxy::BuildVersion.new_from_options req_build_version
build_version = Galaxy::BuildVersion.new_from_options req_build_version, prop_builder, requested_config

if build_version.nil?
prop_builder = Galaxy::Properties::Builder.new config_uri.nil? ? @repository_base : config_uri, @http_user, @http_password, @logger
build_version = Galaxy::BuildProperties.new_from_config(@logger, prop_builder, requested_config)
build_version.validate_os(@os)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/properties.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def build hierarchy, file_name
end
history
end
@log.debug props.inspect
@log.debug "Built properties are #{props.inspect}"
props
end

Expand Down
15 changes: 12 additions & 3 deletions lib/galaxy/software.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,20 @@ def initialize group, artifact, version
@version = version
end

def self.new_from_options build_version
def self.new_from_options build_version, prop_builder = nil, config = nil
if !prop_builder.nil?
build_properties = prop_builder.build(config.config_path, "build.properties")

group = build_properties['group']
artifact = build_properties['type'] || build_properties['artifact']
version = build_properties['build'] || build_properties['version']
end

if !build_version.nil?
elements = build_version.split ':'
if elements.size == 2
group = nil
if elements.size == 1
version = elements[0]
elsif elements.size == 2
artifact = elements[0]
version = elements[1]
elsif elements.size == 3
Expand Down

0 comments on commit 2fa5875

Please sign in to comment.