Skip to content

Commit

Permalink
freetz_patch: eliminate some code clones
Browse files Browse the repository at this point in the history
introduced in Freetz@7178626
  • Loading branch information
er13 committed Apr 10, 2019
1 parent 4537cdb commit fb01b01
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/freetz_patch
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,29 @@ modpatch()
local uncompress_tool
case "$patch_file" in
*.gz)
uncompress_tool=$(_findTool gunzip) || exit $?
uncompress_tool="gunzip"
;;
*.bzip2|*.bz2|*.bz)
uncompress_tool=$(_findTool bunzip2) || exit $?
uncompress_tool="bunzip2"
;;
*.xz)
uncompress_tool=$(_findTool unxz) || exit $?
uncompress_tool="unxz"
;;
*.lz)
uncompress_tool=$(_findTool lunzip) || exit $?
uncompress_tool="lunzip"
;;
*.lzma)
uncompress_tool=$(_findTool unlzma) || exit $?
uncompress_tool="unlzma"
;;
*.Z)
uncompress_tool=$(_findTool uncompress) || exit $?
uncompress_tool="uncompress"
;;
esac

local read_patch_cmd
if [ -n "$uncompress_tool" ]; then
_auto_fix_supported="n"
uncompress_tool=$(_findTool "$uncompress_tool") || exit $?
read_patch_cmd="$uncompress_tool -c"
else
read_patch_cmd="cat"
Expand Down

0 comments on commit fb01b01

Please sign in to comment.