Skip to content

Commit

Permalink
Merge f7b0ba0 into 3503988
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 6, 2018
2 parents 3503988 + f7b0ba0 commit aa3ad30
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
13 changes: 12 additions & 1 deletion library/control/src/modules/WorkflowManager.rb
Expand Up @@ -439,7 +439,18 @@ def control_file(source)
dir = addon_control_dir(src, cleanup: true)
fetch_package(src, package, dir)

path = File.join(dir, "installation.xml")
# lets first try FHS compliant path (bsc#1114573)
# sadly no glob escaping - https://bugs.ruby-lang.org/issues/8258
# but as we generate directory, it should be ok
files = Dir.glob("#{dir}/usr/share/system-roles/*.xml")
if files.size == 1
path = files.first
elsif files.size > 1
log.error "more then one file in system role #{files.inspect}"
path = files.first
else
path = File.join(dir, "installation.xml")
end
return nil unless File.exist?(path)

log.info("installation.xml path: #{path}")
Expand Down
7 changes: 7 additions & 0 deletions library/control/test/workflow_manager_test.rb
Expand Up @@ -396,6 +396,13 @@
# the returned path contains "/installation.xml" at the end
expect(subject.control_file(repo_id)).to end_with("/installation.xml")
end

it "returns path leading to system-roles dir if it exists" do
allow(Dir).to receive(:glob).and_return(["/tmp/usr/share/system-roles/superyast.xml"])
expect(File).to receive(:exist?).with("/tmp/usr/share/system-roles/superyast.xml").and_return(true)

expect(subject.control_file(repo_id)).to eq "/tmp/usr/share/system-roles/superyast.xml"
end
end

describe "#addon_control_dir" do
Expand Down
9 changes: 8 additions & 1 deletion package/yast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Nov 6 14:14:04 UTC 2018 - jreidinger@suse.com

- WorkflowManager: Allow system roles to live in
/usr/share/system-roles/*.xml (bsc#1108176)
- 4.1.33

-------------------------------------------------------------------
Fri Oct 26 11:46:16 UTC 2018 - jreidinger@suse.com

Expand All @@ -10,7 +17,7 @@ Wed Oct 24 16:55:08 UTC 2018 - schubi@suse.de

- Added flag save_y2logs to control.xml file in order to save
YaST logs at the end of installation (fate#325737)
- 4.1.31
- 4.1.31

-------------------------------------------------------------------
Wed Oct 24 15:55:08 UTC 2018 - jreidinger@suse.com
Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 4.1.32
Version: 4.1.33
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0-only
Expand Down

0 comments on commit aa3ad30

Please sign in to comment.