Skip to content

Commit

Permalink
Merge pull request #123 from jerryk55/drive_letter_fix
Browse files Browse the repository at this point in the history
Fix Drive Letter Appending
  • Loading branch information
roliveri authored May 8, 2020
2 parents 1a38800 + 749a9ff commit 36f7091
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/metadata/util/md5deep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ def scan_glob(filename)

def process_each_glob_file(file_name)
FindClassMethods.glob(file_name, @fs) do |f|
# Passing "startDir" as the first parameter is a work-around for issues
# when scanning Win VMs from Linux where the path returned from dirGlob
# do not include the drive letter.
# Prepending @drive_letter to the file is a work-around for issues
# when scanning Win VMs from Linux where the path returned from glob
# does not include the drive letter.
f = File.join(@drive_letter, f)
processFile(File.dirname(f), File.basename(f), @xml.root)
end
rescue => err
Expand All @@ -98,7 +99,7 @@ def read_fs(path, xmlNode)

def processDir(path, x, xmlNode)
if x != "." && x != ".."
currFile = File.join(@drive_letter, path, x)
currFile = File.join(path, x)

begin
if File.directory?(currFile)
Expand All @@ -117,7 +118,7 @@ def processDir(path, x, xmlNode)

def process_dir_as_file(path, x, xml_node)
if x != "." && x != ".."
curr_dir = File.join(@drive_letter, path, x)
curr_dir = File.join(path, x)
if isDir?(curr_dir)
xml_file_node = xml_node.add_element("file", "name" => x, "fqname" => curr_dir)
stat_hash = {}
Expand All @@ -129,7 +130,7 @@ def process_dir_as_file(path, x, xml_node)

def processFile(path, x, xmlNode)
if (@opts.exclude.include?(x) == false) && x[0..0] != "$"
currFile = File.join(@drive_letter, path, x)
currFile = File.join(path, x)

begin
# unless File.directory?(currFile) then
Expand Down

0 comments on commit 36f7091

Please sign in to comment.