Author: toulmean
Date: Thu Jul 1 08:46:53 2010
New Revision: 959557
URL: http://svn.apache.org/viewvc?rev=959557&view=rev
Log:
better fix for BUILDR-461
Modified:
buildr/trunk/lib/buildr/packaging/package.rb
Modified: buildr/trunk/lib/buildr/packaging/package.rb
URL:
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/packaging/package.rb?rev=959557&r1=959556&r2=959557&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/packaging/package.rb (original)
+++ buildr/trunk/lib/buildr/packaging/package.rb Thu Jul 1 08:46:53 2010
@@ -151,7 +151,7 @@ module Buildr
spec = send("package_as_#{spec[:type]}_spec", spec) if
respond_to?("package_as_#{spec[:type]}_spec")
file_name = path_to(:target, Artifact.hash_to_file_name(spec))
end
- package = (no_options && packages.detect { |pkg| pkg.type ==
spec[:type] && pkg.id == spec[:id] &&
+ package = (no_options && packages.detect { |pkg| pkg.type ==
spec[:type] && (pkg.id.nil? || pkg.id == spec[:id]) &&
(pkg.respond_to?(:classifier) ? pkg.classifier : nil) ==
spec[:classifier]}) ||
packages.find { |pkg| pkg.name == file_name } ||
packager.call(file_name)
@@ -171,6 +171,7 @@ module Buildr
if spec[:file]
class << package ; self ; end.send(:define_method, :type) {
spec[:type] }
+ class << package ; self ; end.send(:define_method, :id) { nil }
else
# Make it an artifact using the specifications, and tell it how to
create a POM.
package.extend ActsAsArtifact