Bug #581: Users may choose from gz/bz2/xz for the compression mode now.

This commit is contained in:
Juergen Daubert 2010-05-21 20:03:48 +02:00 committed by Tilman Sauerbeck
parent 780862a6ec
commit 37c478ef8b
3 changed files with 28 additions and 5 deletions

View File

@ -13,5 +13,6 @@ export CXXFLAGS="-O2 -march=i686 -pipe"
# PKGMK_IGNORE_FOOTPRINT="no"
# PKGMK_NO_STRIP="no"
# PKGMK_WGET_OPTS=""
# PKGMK_COMPRESSION_MODE="gz"
# End of file

View File

@ -57,6 +57,11 @@ Default: 'no'
If set to 'no', pkgmk will strip built binaries.
.br
Default: 'no'
.TP
\fBPKGMK_COMPRESSION_MODE='STRING'\fP
Option to select the mode used to compress the packages. Valid strings are gz, bz2 and xz.
.br
Default: 'gz'
.SH SEE ALSO
pkgmk(8)
.SH COPYRIGHT

View File

@ -353,6 +353,7 @@ remove_work_dir() {
build_package() {
local BUILD_SUCCESSFUL="no"
local COMPRESSION
check_file "$TARGET"
make_work_dir
@ -377,8 +378,14 @@ build_package() {
cd $PKG
info "Build result:"
tar czvvf $TARGET *
case $PKGMK_COMPRESSION_MODE in
gz) COMPRESSION="-z" ;;
bz2) COMPRESSION="-j" ;;
xz) COMPRESSION="-J" ;;
esac
bsdtar -c $COMPRESSION -f $TARGET * && bsdtar -t -v -f $TARGET
if [ $? = 0 ]; then
BUILD_SUCCESSFUL="yes"
@ -606,9 +613,17 @@ main() {
check_directory "`dirname $PKGMK_WORK_DIR`"
check_pkgfile
TARGET="$PKGMK_PACKAGE_DIR/$name#$version-$release.pkg.tar.gz"
case $PKGMK_COMPRESSION_MODE in
gz|bz2|xz)
TARGET="$PKGMK_PACKAGE_DIR/$name#$version-$release.pkg.tar.$PKGMK_COMPRESSION_MODE"
;;
*)
error "Compression mode '$PKGMK_COMPRESSION_MODE' not supported"
exit 1
;;
esac
if [ "$PKGMK_CLEAN" = "yes" ]; then
clean
exit 0
@ -682,6 +697,8 @@ PKGMK_SOURCE_DIR="$PWD"
PKGMK_PACKAGE_DIR="$PWD"
PKGMK_WORK_DIR="$PWD/work"
PKGMK_COMPRESSION_MODE="gz"
PKGMK_INSTALL="no"
PKGMK_RECURSIVE="no"
PKGMK_DOWNLOAD="no"