From ec83843d6e5e7b1ca8473cf7f9b05fdfe10d220f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 11 Sep 2009 09:39:13 +0200 Subject: Allowing to overwrite default gzip options through config switch or option. --- helpers/lh_binary_net | 9 ++------- helpers/lh_binary_tar | 9 ++------- helpers/lh_config | 9 ++++++++- helpers/lh_source_debian-live | 9 ++------- helpers/lh_source_net | 9 ++------- helpers/lh_source_tar | 9 ++------- 6 files changed, 18 insertions(+), 36 deletions(-) (limited to 'helpers') diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index 3e962c49e..15f6388ca 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -140,13 +140,8 @@ case "${LH_NET_TARBALL}" in ;; gzip) - if gzip --help | grep -qs "\-\-rsyncable" - then - tar cf ../binary-net.tar * - gzip --rsyncable --best ../binary-net.tar - else - tar cfz ../binary-net.tar.gz * - fi + tar cf ../binary-net.tar * + gzip ${GZIP_OPTIONS} ../binary-net.tar ;; tar) diff --git a/helpers/lh_binary_tar b/helpers/lh_binary_tar index 110e5cdf7..7c769d594 100755 --- a/helpers/lh_binary_tar +++ b/helpers/lh_binary_tar @@ -45,13 +45,8 @@ Create_lockfile .lock # Remove old binary rm -f binary.tar.gz -if gzip --help | grep -qs '\-\-rsyncable' -then - tar cf binary-tar.tar binary - gzip --rsyncable --best binary-tar.tar -else - tar cfz binary-tar.tar.gz binary -fi +tar cf binary-tar.tar binary +gzip ${GZIP_OPTIONS} binary-tar.tar # Creating stage file Create_stagefile .stage/binary_tar diff --git a/helpers/lh_config b/helpers/lh_config index 57a8b9e82..03297be07 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -71,6 +71,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--force]\n\ \t [--genisoimage genisomage|mkisofs]\n\ \t [--grub-splash FILE]\n\ +\t [--gzip-options OPTION|\"OPTIONS\"]\n\ \t [--hooks FILE]\n\ \t [--hostname NAME]\n\ \t [--ignore-system-defaults]\n\ @@ -136,7 +137,7 @@ Local_arguments () templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,clean, distribution:,mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:, mirror-binary-security:,categories:,chroot-filesystem:,union-filesystem:,exposed-root:,virtual-root-size:, - hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:, + gzip-options:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:, packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-filesystem:,binary-images:, binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,chroot-build:, debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:, @@ -429,6 +430,11 @@ Local_arguments () shift 2 ;; + --gzip-options) + GZIP_OPTIONS="${2}" + shift 2 + ;; + --hooks) LH_HOOKS="${2}" shift 2 @@ -904,6 +910,7 @@ _QUIET="${_QUIET}" # Internal stuff (FIXME) APT_OPTIONS="${APT_OPTIONS}" APTITUDE_OPTIONS="${APTITUDE_OPTIONS}" +GZIP_OPTIONS="${GZIP_OPTIONS}" EOF # Creating lh_bootstrap_* configuration diff --git a/helpers/lh_source_debian-live b/helpers/lh_source_debian-live index 03b39925b..809794c00 100755 --- a/helpers/lh_source_debian-live +++ b/helpers/lh_source_debian-live @@ -62,13 +62,8 @@ cd source SUFFIX="$(date +%Y%m%d.%s)" -if gzip --help | grep -qs '\-\-rsyncable' -then - tar cf debian-live-config_${SUFFIX}.tar debian-live - gzip --rsyncable --best debian-live-config_${SUFFIX}.tar -else - tar cfz debian-live-config_${SUFFIX}.tar.gz debian-live -fi +tar cf debian-live-config_${SUFFIX}.tar debian-live +gzip ${GZIP_OPTIONS} debian-live-config_${SUFFIX}.tar cd "${OLDPWD}" diff --git a/helpers/lh_source_net b/helpers/lh_source_net index 8ffeb3c83..eb32ed9ad 100755 --- a/helpers/lh_source_net +++ b/helpers/lh_source_net @@ -54,13 +54,8 @@ then fi # Create tarball -if gzip --help | grep -qs '\-\-rsyncable' -then - tar cf source-net.tar source - gzip --rsyncable --best source-net.tar -else - tar cfz source-net.tar.gz source -fi +tar cf source-net.tar source +gzip ${GZIP_OPTIONS} source-net.tar # Creating stage file Create_stagefile .stage/source_net diff --git a/helpers/lh_source_tar b/helpers/lh_source_tar index 64c191c01..cbf3f839d 100755 --- a/helpers/lh_source_tar +++ b/helpers/lh_source_tar @@ -55,13 +55,8 @@ then fi # Create tarball -if gzip --help | grep -qs '\-\-rsyncable' -then - tar cf source.tar source - gzip --rsyncable --best source.tar -else - tar cfz source.tar.gz source -fi +tar cf source.tar source +gzip ${GZIP_OPTIONS} source.tar # Creating stage file Create_stagefile .stage/source_tar -- cgit v1.2.3