Module: Y2Packager

Defined in:
library/packages/src/lib/y2packager/product_sorter.rb,
library/packages/src/lib/y2packager/package.rb,
library/packages/src/lib/y2packager/product.rb,
library/packages/src/lib/y2packager/release_notes.rb,
library/packages/src/lib/y2packager/product_reader.rb,
library/packages/src/lib/y2packager/release_notes_store.rb,
library/packages/src/lib/y2packager/release_notes_reader.rb,
library/packages/src/lib/y2packager/release_notes_fetchers/rpm.rb,
library/packages/src/lib/y2packager/release_notes_fetchers/url.rb,
library/packages/src/lib/y2packager/release_notes_content_prefs.rb,
library/packages/src/lib/y2packager/release_notes_fetchers/base.rb

Overview


Copyright © 2017 SUSE LLC, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


Defined Under Namespace

Modules: ReleaseNotesFetchers Classes: Package, Product, ProductReader, ReleaseNotes, ReleaseNotesContentPrefs, ReleaseNotesReader, ReleaseNotesStore

Constant Summary collapse

PRODUCT_SORTER =

Sorter for sorting Products in required display order

proc do |x, y|
  # both products have defined order
  if x.order && y.order
    x.order <=> y.order
  # only one product has defined order
  elsif x.order || y.order
    # product with defined order first
    x.order ? -1 : 1
  else
    # none product has defined order, sort by label
    x.label <=> y.label
  end
end