Skip to content

Commit

Permalink
_pkg.sh: streamline test 1
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Apr 9, 2024
1 parent 2a3eee0 commit f0450c2
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions _pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,27 @@ create_pkg() {

_pkg="${_OUT}${_suf}${arch_ext}"

_FLS="$(dirname "$0")/_files"

(
cd "${_DST}/.."
case "${_HOST}" in
win) find "${_BAS}" -exec attrib +A -R '{}' \;
esac

find "${_BAS}" -type f -o -type l | sort > "${_FLS}"

rm -f "${_cdo}/${_pkg}"
case "${arch_ext}" in
.tar.xz) TZ=UTC tar --create \
--format=ustar \
--owner=0 --group=0 --numeric-owner \
--files-from "${_FLS}" | xz > "${_cdo}/${_pkg}";;
.zip) TZ=UTC zip --quiet -9 --strip-extra \
--names-stdin - < "${_FLS}" > "${_cdo}/${_pkg}";;
--sort=name "${_BAS}" | xz > "${_cdo}/${_pkg}";;
.zip)
find "${_BAS}" -type f -o -type l | sort | \
TZ=UTC zip --quiet -9 --strip-extra \
--names-stdin - > "${_cdo}/${_pkg}"
;;
esac
touch -c -r "$1" "${_cdo}/${_pkg}"
)

rm -f "${_FLS}"

# <filename>: <size> bytes <YYYY-MM-DD> <HH:MM>
case "${_HOST}" in
bsd|mac) TZ=UTC stat -f '%N: %z bytes %Sm' -t '%Y-%m-%d %H:%M' "${_pkg}";;
Expand Down

0 comments on commit f0450c2

Please sign in to comment.