Skip to content

Commit a6f1ffb

Browse files
authored
Merge pull request #37 from libyui/ci_fix
Added SLE15-SP5 targets, newer Rubocop
2 parents 9f7dd4f + 4ebcd05 commit a6f1ffb

File tree

14 files changed

+67
-28
lines changed

14 files changed

+67
-28
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v2
1818

1919
- name: Install Dependencies
20-
run: zypper --non-interactive install --no-recommends 'rubygem(ruby:2.7.0:rubocop:0.41.2)' yast2-devtools
20+
run: zypper --non-interactive install --no-recommends "rubygem(`rpm --eval '%{rb_default_ruby_abi}'`:rubocop:1.24.1)" yast2-devtools
2121

2222
# just for easier debugging...
2323
- name: Inspect Installed Packages

.rubocop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# use the shared Yast defaults
22
inherit_from:
3-
/usr/share/YaST2/data/devtools/data/rubocop_yast_style.yml
3+
/usr/share/YaST2/data/devtools/data/rubocop-1.24.1_yast_style.yml
44

55
Metrics/LineLength:
66
Max: 100
@@ -14,3 +14,6 @@ Metrics/AbcSize:
1414
Metrics/MethodLength:
1515
Max: 14
1616

17+
Metrics/BlockLength:
18+
Exclude:
19+
- lib/tasks/version.rake

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source "https://rubygems.org"
24

35
gemspec

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
#--
24
# Copyright (C) 2015 SUSE LLC
35
# This library is free software; you can redistribute it and/or modify

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.23
1+
0.1.24

data/targets.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,16 @@
6969
obs_project: "Devel:YaST:SLE-15-SP4"
7070
obs_sr_project: "SUSE:SLE-15-SP4:Update"
7171
obs_target: "SUSE_SLE-15-SP4_GA"
72+
:sle15sp5:
73+
obs_api: "https://api.suse.de/"
74+
obs_project: "Devel:YaST:SLE-15-SP5"
75+
obs_sr_project: "SUSE:SLE-15-SP5:Update"
76+
obs_target: "SUSE_SLE-15-SP5_GA"
7277
:sle_latest:
7378
obs_api: "https://api.suse.de/"
7479
obs_project: "Devel:YaST:Head"
75-
obs_sr_project: "SUSE:SLE-15-SP4:GA"
76-
obs_target: "SUSE_SLE-15-SP4_GA"
80+
obs_sr_project: "SUSE:SLE-15-SP5:GA"
81+
obs_target: "SUSE_SLE-15-SP5_GA"
7782
:factory:
7883
obs_project: "devel:libraries:libyui"
7984
obs_sr_project: "openSUSE:Factory"

lib/libyui/rake.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
#--
24
# Copyright (C) 2015 SUSE LLC
35
# This library is free software; you can redistribute it and/or modify
@@ -23,7 +25,7 @@
2325
include Libyui::Tasks::Helpers
2426

2527
# read package name from spec file name because CWD can have a -branch suffix
26-
main_spec = Dir.glob("package/*.spec").sort.last
28+
main_spec = Dir.glob("package/*.spec").max
2729
conf.package_name = main_spec[/package\/(.*)\.spec$/, 1]
2830

2931
conf.version = cmake_version
@@ -36,7 +38,7 @@
3638
end
3739

3840
# load libyui-rake tasks
39-
task_path = File.expand_path("../../tasks", __FILE__)
41+
task_path = File.expand_path("../tasks", __dir__)
4042
Dir["#{task_path}/*.rake"].each do |f|
4143
load f
4244
end

lib/libyui/tasks.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
#--
24
# Copyright (C) 2015-2021 SUSE LLC
35
# This library is free software; you can redistribute it and/or modify
@@ -19,9 +21,9 @@ module Libyui
1921
# Facilities to write Libyui related rake tasks.
2022
module Tasks
2123
# Name of the CMake version file
22-
VERSION_CMAKE = "VERSION.cmake".freeze
24+
VERSION_CMAKE = "VERSION.cmake"
2325
# Targets definition
24-
TARGETS_FILE = File.expand_path("../../../data/targets.yml", __FILE__)
26+
TARGETS_FILE = File.expand_path("../../data/targets.yml", __dir__)
2527

2628
# Wrapper to set up packaging tasks
2729
def self.configuration(&block)
@@ -32,6 +34,7 @@ def self.submit_to(target, file = TARGETS_FILE)
3234
targets = YAML.load_file(file)
3335
config = targets[target]
3436
raise "Not configuration found for #{target}" if config.nil?
37+
3538
Libyui::Tasks.configuration do |conf|
3639
config.each do |meth, val|
3740
conf.public_send("#{meth}=", val)
@@ -101,9 +104,9 @@ def cmake_values(filename, *keys)
101104
# @param key [String] e.g., 'VERSION_MAJOR'
102105
#
103106
# @return [String] e.g., "3"
104-
def cmake_value(s, key)
107+
def cmake_value(text, key)
105108
e_key = Regexp.escape(key)
106-
m = /SET\s*\(\s*#{e_key}\s+"([^"]*)"\s*\)/.match(s)
109+
m = /SET\s*\(\s*#{e_key}\s+"([^"]*)"\s*\)/.match(text)
107110
m ? m[1] : nil
108111
end
109112

@@ -144,7 +147,7 @@ def bump_spec_so_version(filename = nil)
144147
# @param filename [String, nil] if nil, it uses the shortest spec filename
145148
# @return [String]
146149
def spec_filename(filename)
147-
filename || Dir.glob("package/*.spec").sort.first
150+
filename || Dir.glob("package/*.spec").min
148151
end
149152
end
150153
end

lib/tasks/so_version.rake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
#--
24
# Copyright (C) 2021 SUSE LLC
35
# This library is free software; you can redistribute it and/or modify
@@ -24,7 +26,7 @@ namespace :so_version do
2426
filenames = Dir.glob("package/*.spec").sort
2527
filenames.reject! { |f| spec_so_version(f).nil? }
2628

27-
mismatches = filenames.select { |f| spec_so_version(f) != so_version }
29+
mismatches = filenames.reject { |f| spec_so_version(f) == so_version }
2830

2931
if mismatches.any?
3032
messages = ["so version mismatch:"]

lib/tasks/test.rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
#--
24
# Copyright (C) 2015 SUSE LLC
35
# This library is free software; you can redistribute it and/or modify

0 commit comments

Comments
 (0)