Skip to content

Commit

Permalink
Merge pull request #29 from yast/non_UTF8_bios_fix
Browse files Browse the repository at this point in the history
fixed vendor detection
  • Loading branch information
lslezak committed Nov 4, 2013
2 parents 3be3f6f + 79904c6 commit ac299f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.6
3.0.7
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Nov 4 11:37:42 UTC 2013 - lslezak@suse.cz

- fixed vendor detection, check the output directly in shell
to avoid reading binary (non-UTF8) text (bnc#847153)
- 3.0.7

-------------------------------------------------------------------
Tue Oct 15 07:11:25 UTC 2013 - lslezak@suse.cz

Expand Down
18 changes: 2 additions & 16 deletions src/modules/Packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -838,24 +838,10 @@ def modePackages

# CHeck whether this is a Dell system
def DellSystem
ret = false
command = "/usr/sbin/hwinfo --bios"
command = "/usr/sbin/hwinfo --bios | grep -q '^[[:space:]]*Vendor:.*Dell Inc\\.'"
Builtins.y2milestone("Executing: %1", command)

out = Convert.to_map(SCR.Execute(path(".target.bash_output"), command))
Builtins.y2milestone("Result: %1", out)

if Ops.get_integer(out, "exit", -1) == 0
lines = Builtins.splitstring(Ops.get_string(out, "stdout", ""), "\n")

Builtins.foreach(lines) do |line|
if Builtins.regexpmatch(line, "Vendor:.*Dell Inc.*")
Builtins.y2milestone("Found matching line: %1", line)
ret = true
end
end
end

ret = SCR.Execute(path(".target.bash"), command) == 0
Builtins.y2milestone("Detected a Dell system") if ret

ret
Expand Down

0 comments on commit ac299f0

Please sign in to comment.