Author: vborja
Date: Sun Sep 21 09:47:26 2008
New Revision: 697544
URL: http://svn.apache.org/viewvc?rev=697544&view=rev
Log:
artifact_namespace allows registering two artifacts with different name
Modified:
incubator/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb
Modified: incubator/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb?rev=697544&r1=697543&r2=697544&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb (original)
+++ incubator/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb Sun Sep
21 09:47:26 2008
@@ -697,10 +697,13 @@
raise "Unsatisfied dependency #{previous} " +
"not satisfied by #{artifact}" unless satisfied
previous.version = artifact.version # OK, set new version
+ artifact = previous # use the same object for aliases
else # not a requirement, set the new values
- previous.copy_attrs(artifact)
+ unless artifact.id == previous.id && name != previous.name
+ previous.copy_attrs(artifact)
+ artifact = previous
+ end
end
- artifact = previous # use the same object for aliases
else
if unvers.nil? && # we only have the version
(previous = get(unvers, true, false, false))
@@ -722,8 +725,8 @@
group(name, *(names + [{:namespace => self}]))
elsif artifact.id
unvers = artifact.unversioned_spec
- registry[unvers] = artifact
- registry.alias name, unvers unless name.to_s[/^\s*$/]
+ registry[name] = artifact
+ registry.alias unvers, name
else
registry[name] = artifact
end