Skip to content

Commit 30e4fe2

Browse files
authored
Merge pull request #197 from SUSE/fix_duplicate_migrations
Fix duplicate migration paths
2 parents c430086 + aa15e6e commit 30e4fe2

File tree

6 files changed

+19
-3
lines changed

6 files changed

+19
-3
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = rmt-server
2-
VERSION = 1.0.2
2+
VERSION = 1.0.3
33

44
all:
55
@:

app/models/migration_engine.rb

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def sort_migrations(migrations)
103103
.map { |migration| sort_migration(migration) }
104104
.sort_by { |migration| migration.map(&:version) }
105105
.reverse!
106+
.uniq
106107
end
107108

108109
# we sort the migration products, so clients will activate them in the right dependency order

lib/rmt.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module RMT
2-
VERSION ||= '1.0.2'.freeze
2+
VERSION ||= '1.0.3'.freeze
33

44
DEFAULT_USER = '_rmt'.freeze
55
DEFAULT_GROUP = 'nginx'.freeze

package/rmt-server.changes

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-------------------------------------------------------------------
2+
Wed Jun 27 12:18:16 UTC 2018 - ikapelyukhin@suse.com
3+
4+
- Version 1.0.3
5+
- Fix duplicate migration paths (bsc#1097824)
6+
17
-------------------------------------------------------------------
28
Tue Jun 19 15:01:19 UTC 2018 - ikapelyukhin@suse.com
39

package/rmt-server.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
%define is_sle_12_family 1
2626
%endif
2727
Name: rmt-server
28-
Version: 1.0.2
28+
Version: 1.0.3
2929
Release: 0
3030
Summary: Repository mirroring tool and registration proxy for SCC
3131
License: GPL-2.0-or-later

spec/models/migration_engine_spec.rb

+9
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,13 @@
463463
end
464464
end
465465
end
466+
467+
describe '#sort_migrations' do
468+
let(:installed_products) { [sle12] }
469+
let(:system) { FactoryGirl.create(:system, :with_activated_base_product) }
470+
471+
it 'removes duplicate migration paths' do
472+
expect(engine.send(:sort_migrations, [[sle12], [sle12], [sle12]])).to eq([[sle12]])
473+
end
474+
end
466475
end

0 commit comments

Comments
 (0)