Skip to content

Commit

Permalink
Merge pull request #60 from ranma42/xz-or-7z
Browse files Browse the repository at this point in the history
Check for both `7z` and `xz` and use the available one
  • Loading branch information
alexcrichton authored May 2, 2017
2 parents d7855d6 + a7a6d46 commit 4cf7397
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions make-tarballs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ need_cmd find
need_cmd rev
need_cmd sort
need_cmd gzip
need_cmd 7z

# need_cmd xz || need_cmd 7z
if command -v xz >/dev/null 2>&1
then msg "found xz"
else need_cmd 7z
fi

CFG_ARGS="$@"

Expand Down Expand Up @@ -270,8 +275,10 @@ find "$CFG_INPUT" \( -type d -empty \) -or \( -not -type d \) \
| rev | sort | rev | tar -cf "$CFG_OUTPUT.tar" -T -
need_ok "failed to tar"

# xz -9 -T2 --keep "$CFG_OUTPUT.tar"
7z a -bd -txz -mx=9 -mmt=off "$CFG_OUTPUT.tar.xz" "$CFG_OUTPUT.tar"
if command -v xz >/dev/null 2>&1
then xz -9 --keep "$CFG_OUTPUT.tar"
else 7z a -bd -txz -mx=9 -mmt=off "$CFG_OUTPUT.tar.xz" "$CFG_OUTPUT.tar"
fi
need_ok "failed to xz"

gzip "$CFG_OUTPUT.tar"
Expand Down

0 comments on commit 4cf7397

Please sign in to comment.