Try retrying BOM find command.
This commit is contained in:
parent
c34267442e
commit
db980464f6
@ -39,14 +39,25 @@ module UnpackStrategy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def bom
|
def bom
|
||||||
# rubocop:disable Style/AsciiComments
|
tries = 0
|
||||||
# We need to use `find` here instead of Ruby in order to properly handle
|
result = loop do
|
||||||
# file names containing special characters, such as “e” + “´” vs. “é”.
|
# rubocop:disable Style/AsciiComments
|
||||||
# rubocop:enable Style/AsciiComments
|
# We need to use `find` here instead of Ruby in order to properly handle
|
||||||
result = system_command("find", args: [".", "-print0"], chdir: self, print_stderr: false)
|
# file names containing special characters, such as “e” + “´” vs. “é”.
|
||||||
|
# rubocop:enable Style/AsciiComments
|
||||||
|
r = system_command("find", args: [".", "-print0"], chdir: self, print_stderr: false)
|
||||||
|
tries += 1
|
||||||
|
|
||||||
odebug "BOM `find` exit code: #{result.exit_status}"
|
odebug "BOM `find` output (try #{tries}):", r.merged_output
|
||||||
odebug "BOM `find` output:", result.merged_output
|
|
||||||
|
break r unless r.stderr.match?(/Interrupted system call/i)
|
||||||
|
|
||||||
|
raise "BOM `find` was interrupted." if tries >= 3
|
||||||
|
|
||||||
|
odebug "BOM `find` failed due to interrupt, retrying..."
|
||||||
|
end
|
||||||
|
|
||||||
|
raise "BOM `find` took #{tries} tries." if tries > 1
|
||||||
|
|
||||||
result
|
result
|
||||||
.stdout
|
.stdout
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user