diff options
author | Daniel Baumann <daniel@debian.org> | 2008-04-22 23:32:30 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:03:33 +0100 |
commit | ae58d0f7af61b5bae65ec0532ee316dd9fb5e4ea (patch) | |
tree | 42be46bd4bc1033ebfa535fc10d8f51e1a20f23c | |
parent | 917c2c094fd888d50bdc7844e6db6197d2a753cf (diff) | |
download | vyos-live-build-ae58d0f7af61b5bae65ec0532ee316dd9fb5e4ea.tar.gz vyos-live-build-ae58d0f7af61b5bae65ec0532ee316dd9fb5e4ea.zip |
Producing rsyncable tarballs where possible.
-rwxr-xr-x | helpers/lh_binary_net | 9 | ||||
-rwxr-xr-x | helpers/lh_binary_tar | 8 | ||||
-rwxr-xr-x | helpers/lh_source_debian-live | 10 | ||||
-rwxr-xr-x | helpers/lh_source_net | 8 | ||||
-rwxr-xr-x | helpers/lh_source_tar | 8 |
5 files changed, 38 insertions, 5 deletions
diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index f97d4c3b3..3b5076eda 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -78,7 +78,14 @@ case "${LH_NET_TARBALL}" in ;; gzip) - tar cfz binary-net.tar.gz "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot" + if gzip --help | grep -q "\-\-rsyncable" + then + tar cf binary-net.tar "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot" + gzip --rsyncable --best binary-net.tar + else + tar cfz binary-net.tar.gz "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot" + fi + mv binary-net.tar.gz "${OLDPWD}" ;; diff --git a/helpers/lh_binary_tar b/helpers/lh_binary_tar index 85ff064ab..7560bce15 100755 --- a/helpers/lh_binary_tar +++ b/helpers/lh_binary_tar @@ -50,7 +50,13 @@ Create_lockfile .lock # Remove old binary rm -f binary.tar.gz -tar cfz binary-tar.tar.gz binary +if gzip --help | grep -q '\-\-rsyncable' +then + tar cf binary-tar.tar binary + gzip --rsyncable --best binary-tar.tar +else + tar cfz binary-tar.tar.gz binary +fi # Creating stage file Create_stagefile .stage/binary_tar diff --git a/helpers/lh_source_debian-live b/helpers/lh_source_debian-live index 151146813..c82ca29f2 100755 --- a/helpers/lh_source_debian-live +++ b/helpers/lh_source_debian-live @@ -59,7 +59,15 @@ cp -a config source/debian-live # Create tarball cd source -tar cfz debian-live-config_$(date +%Y%m%d.%s).tar.gz debian-live + +if gzip --help | grep -q '\-\-rsyncable' +then + tar cf debian-live-config_$(date +%Y%m%d.%s).tar debian-live + gzip --rsyncable --best debian-live-config_$(date +%Y%m%d.%s).tar +else + tar cfz debian-live-config_$(date +%Y%m%d.%s).tar.gz debian-live +fi + cd "${OLDPWD}" rm -rf source/debian-live/config diff --git a/helpers/lh_source_net b/helpers/lh_source_net index 192ea3b13..77c7aed65 100755 --- a/helpers/lh_source_net +++ b/helpers/lh_source_net @@ -59,7 +59,13 @@ then fi # Create tarball -tar cfz source-net.tar.gz source +if gzip --help | grep -q '\-\-rsyncable' +then + tar cf source-net.tar source + gzip --rsyncable --best source-net.tar +else + tar cfz source-net.tar.gz source +fi # Creating stage file Create_stagefile .stage/source_net diff --git a/helpers/lh_source_tar b/helpers/lh_source_tar index ecd04ee97..4e00db636 100755 --- a/helpers/lh_source_tar +++ b/helpers/lh_source_tar @@ -60,7 +60,13 @@ then fi # Create tarball -tar cfz source.tar.gz source +if gzip --help | grep -q '\-\-rsyncable' +then + tar cf source.tar source + gzip --rsyncable --best source.tar +else + tar cfz source.tar.gz source +fi # Creating stage file Create_stagefile .stage/source_tar |