Uploaded image for project: 'Buildr'
  1. Buildr
  2. BUILDR-325

Overriding package spec with classifer doesn't work

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.4
    • Fix Version/s: 1.3.5
    • Component/s: Packaging
    • Labels:
      None

      Description

      The current code in package.rb does this:

      package = (no_options && packages.detect { |pkg| pkg.type == spec[:type] ||
      packages.find

      { |pkg| pkg.name == file_name } ||
      packager.call(file_name)

      ie, if you define two packages that use the :zip type, only the first one will be taken into account.

      I happen to work on Eclipse features, in which both the source and original features work with the same type, but have different classifiers.

      So I'd like the code to do this instead:

      package = (no_options && packages.detect { |pkg| pkg.type == spec[:type] && (spec[:classifier].nil? || pkg.classifier == spec[:classifier])}) ||
      packages.find { |pkg| pkg.name == file_name }

      ||
      packager.call(file_name)

      1. spec_BUILDR-325
        1 kB
        Antoine Toulme
      2. buildrpatch
        0.8 kB
        Antoine Toulme

        Activity

        Hide
        boisvert Alex Boisvert added a comment -

        Patch applied (with minor addition to the spec). Thanks Antoine!

        boisvert@sixtine:~/svn/buildr-325$ svn commit -m "BUILDR-325: Overriding package spec with classifer doesn't work (Antoine Toulme)"
        Sending CHANGELOG
        Sending lib/buildr/packaging/package.rb
        Sending spec/packaging/packaging_spec.rb
        Transmitting file data ...
        Committed revision 821029.

        Show
        boisvert Alex Boisvert added a comment - Patch applied (with minor addition to the spec). Thanks Antoine! boisvert@sixtine:~/svn/buildr-325$ svn commit -m " BUILDR-325 : Overriding package spec with classifer doesn't work (Antoine Toulme)" Sending CHANGELOG Sending lib/buildr/packaging/package.rb Sending spec/packaging/packaging_spec.rb Transmitting file data ... Committed revision 821029.
        Hide
        toulmean Antoine Toulme added a comment -

        Here is a patch with a spec that reproduces the problem.

        Show
        toulmean Antoine Toulme added a comment - Here is a patch with a spec that reproduces the problem.
        Hide
        boisvert Alex Boisvert added a comment -

        FYI, I added a few packaging specs to reveal this issue but coudln't ...

        boisvert@sixtine:~/svn/buildr-325/spec$ svn commit -m "Add a few more packaging specs"
        Sending spec/packaging/packaging_spec.rb
        Transmitting file data .
        Committed revision 820502.

        Show
        boisvert Alex Boisvert added a comment - FYI, I added a few packaging specs to reveal this issue but coudln't ... boisvert@sixtine:~/svn/buildr-325/spec$ svn commit -m "Add a few more packaging specs" Sending spec/packaging/packaging_spec.rb Transmitting file data . Committed revision 820502.
        Hide
        toulmean Antoine Toulme added a comment -

        Attached a patch that just does this.

        Show
        toulmean Antoine Toulme added a comment - Attached a patch that just does this.

          People

          • Assignee:
            Unassigned
            Reporter:
            toulmean Antoine Toulme
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development