Skip to content

Commit

Permalink
Merge pull request #80 from yast/correct-program-paths
Browse files Browse the repository at this point in the history
Don't use nonexisting programs
  • Loading branch information
mvidner committed Feb 27, 2019
2 parents 0173791 + 2a1f4fc commit 6ab554b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
6 changes: 6 additions & 0 deletions package/yast2-nfs-client.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Feb 27 12:04:37 UTC 2019 - mvidner@suse.com

- Use /sbin/rpcinfo only, /usr/sbin/rpcinfo is gone (bsc#1127138).
- 4.1.5

-------------------------------------------------------------------
Fri Dec 28 11:54:27 CET 2018 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-nfs-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-nfs-client
Version: 4.1.4
Version: 4.1.5
Release: 0
Url: https://github.com/yast/yast-nfs-client

Expand Down
14 changes: 2 additions & 12 deletions src/modules/Nfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -553,20 +553,10 @@ def AutoPackages
# Uses RPC broadcast to mountd.
# @return [Array<String>] a list of hostnames
def ProbeServers
# newer, shinier, better rpcinfo from rpcbind (#450056)
prog_name = "/sbin/rpcinfo"
delim = ""

# fallback from glibc (uses different field separators, grr :( )
# TODO: looks like glibc no longer contain this fallback?
if !FileUtils.Exists(prog_name)
prog_name = "/usr/sbin/rpcinfo"
delim = "-d ' ' "
end

# #71064
# this works also if ICMP broadcasts are ignored
cmd = "#{prog_name} -b mountd 1 | /usr/bin/cut #{delim} -f 2 | /usr/bin/sort -u"
# newer, shinier, better rpcinfo from rpcbind (#450056)
cmd = "/sbin/rpcinfo -b mountd 1 | /usr/bin/cut -f 2 | /usr/bin/sort -u"
out = Convert.to_map(SCR.Execute(path(".target.bash_output"), cmd))
Ops.get_string(out, "stdout", "").lines.map(&:strip).reject(&:empty?)
end
Expand Down

0 comments on commit 6ab554b

Please sign in to comment.