pkgmeek: explicitly choose the compression mode for the created package
(workaround for buggy pkginfo -f)
This commit is contained in:
parent
9e3c7e2c49
commit
c04e9cf3e8
@ -9,7 +9,8 @@
|
||||
main() {
|
||||
######################## main routine ################################
|
||||
local pkg_dir src_dir work _local_ here url u pkg_utd f DIR TARGET
|
||||
local errDL=0; local errUZ=0; local BSDTAR="/usr/bin/bsdtar -a --format=gnutar"
|
||||
local errDL=0; local errUZ=0; local BSDTAR="/usr/bin/bsdtar --format=gnutar"
|
||||
declare -A ZFLAG=([xz]="-J" [bz2]="-j" [gz]="-z" [lz4]="--lz4" [zstd]="--zstd")
|
||||
parse_options "$@"
|
||||
|
||||
# Exit early if refreshing an existing sha256 manifest was requested
|
||||
@ -131,7 +132,7 @@ if [ "$pkg_utd" = 0 ] || [[ "$PKGMK_FORCE $PKGMK_EXTRACT_ONLY" =~ yes ]]; then
|
||||
here="${_local_[u]}"
|
||||
case "$here" in
|
||||
*.tar|*.tar.gz|*.tar.Z|*.tgz|*.tar.bz2|*.tbz2|*.tar.xz|*.txz|*.tar.lzma|*.tar.lz|*.7z|*.zip|*.rpm)
|
||||
bsdtar -p -o --no-xattrs -C src -xf "$here" || errUZ+=1 ;;
|
||||
bsdtar -p -o -C src -xf "$here" || errUZ+=1 ;;
|
||||
*)
|
||||
cp -r -L "$here" src/ ;;
|
||||
esac
|
||||
@ -171,7 +172,11 @@ if [ "$pkg_utd" = 0 ] || [[ "$PKGMK_FORCE $PKGMK_EXTRACT_ONLY" =~ yes ]]; then
|
||||
done } < <(find pkg -type l -path "*/man/man*/*" -printf '%f!%h\n')
|
||||
|
||||
# Create the archive
|
||||
BSDTAR+=" ${ZFLAG[$PKGMK_COMPRESSION_MODE]}"
|
||||
[ $UID = 0 ] || BSDTAR+=" --uid 0 --gid 0"
|
||||
[ -w "$pkg_dir$package" ] || rm -f "$pkg_dir$package" 2>/dev/null \
|
||||
|| { error "$pkg_dir$package not writable.";
|
||||
cleanup_work; exit "$E_BUILD"; }
|
||||
if (cd pkg; $BSDTAR -cf "$pkg_dir$package" -- *); then
|
||||
info "Package creation successful."
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user