Skip to content

Commit

Permalink
remove unused method splitPath
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Sep 2, 2014
1 parent 152cb23 commit 6a8e572
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
28 changes: 0 additions & 28 deletions src/include/bootloader/routines/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,34 +303,6 @@ def difflist(a, b)
Builtins.filter(a) { |e| !Builtins.contains(b, e) }
end

# translate filename path (eg. /boot/kernel) to list of device
# and relative path
# @param [String] fullpth string fileststem path (eg. /boot/vmlinuz)
# @return a list containing device and relative path,
# eg. ["/dev/hda1", "/vmlinuz"]
def splitPath(fullpth)
mountpoints = Storage.GetMountPoints,
dev = ""
mp = ""
max = 0
#
# FIXME: this is broken code, implement a proper prefix match!! see below
Builtins.foreach(mountpoints) do |k, v|
if k != "swap" && Builtins.issubstring(fullpth, k) &&
Ops.greater_than(Builtins.size(k), max)
max = Builtins.size(k)
dev = Ops.get_string(v, 0, "")
mp = k
end
end
return [] if mp == ""

# FIXME: pth will be wrong for fullpth=='(hd0,1)/boot/vmlinux' !!
pth = Builtins.substring(fullpth, Builtins.size(mp))
pth = Ops.add("/", pth) if Builtins.substring(pth, 0, 1) != "/"
[dev, pth]
end

# Get bootloader device for specified location
# FIXME: this function is being phased out. Keeping it around until
# selected_location and loader_device can be dropped for all bootloader
Expand Down
1 change: 0 additions & 1 deletion src/modules/BootCommon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,6 @@ def Md2Partitions(md_device)
publish :function => :updateTimeoutPopupForFloppy, :type => "void (string)"
publish :function => :remapGlobals, :type => "map <string, string> (map <string, string>)"
publish :function => :remapSections, :type => "list <map <string, any>> (list <map <string, any>>)"
publish :function => :splitPath, :type => "list <string> (string)"
publish :function => :GetBootloaderDevice, :type => "string ()"
publish :function => :GetBootloaderDevices, :type => "list <string> ()"
publish :function => :IsPartitionBootable, :type => "boolean (string)"
Expand Down

0 comments on commit 6a8e572

Please sign in to comment.