From 55e7f374ada24a67d26d8e9bb2c5b45e40c34434 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 13 Feb 2014 15:53:12 +0100 Subject: Parallelize archive creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie090f3c39db3558a6a0d76779ad421a6e4454dc0 Reviewed-by: Iikka Eklund Reviewed-by: Jędrzej Nowacki --- packaging-tools/mksrc.sh | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'packaging-tools/mksrc.sh') diff --git a/packaging-tools/mksrc.sh b/packaging-tools/mksrc.sh index a97ba9642..b50e8c5de 100755 --- a/packaging-tools/mksrc.sh +++ b/packaging-tools/mksrc.sh @@ -85,16 +85,22 @@ function create_main_file() # This will cause it to compress simultaneously, though # at the rate of the slowest of the processes (e.g., # with xz at 100% CPU, and gzip 15%) - tar cf - $PACKAGE_NAME/ | \ +( tar cf - $PACKAGE_NAME/ | \ tee \ >(xz -9 > $PACKAGE_NAME.tar.xz) | \ gzip -9 > $PACKAGE_NAME.tar.gz - echo " - Creating single 7z file - " - 7z a $PACKAGE_NAME.7z $PACKAGE_NAME/ > /dev/null - - echo " - Creating single win zip - " + echo " - Created tar.xz and tar.gz - " +) & +( 7z a $PACKAGE_NAME.7z $PACKAGE_NAME/ > /dev/null + echo " - Created 7z - " +) & +( $SCRIPT_DIR/winzipdir.sh $PACKAGE_NAME.zip $PACKAGE_NAME + echo " - Created single win zip - " +) & +wait +echo " - Done creating archives - " } function create_and_delete_submodule() @@ -104,15 +110,20 @@ function create_and_delete_submodule() cd $PACKAGE_NAME while read submodule submodule_sha1; do _file=$submodule-$LICENSE-src-$QTVER - echo " - tarring $_file -" mv $submodule $_file - tar c $_file | tee \ - >(xz -9 > ../submodules_tar/$_file.tar.xz) | \ - gzip -9 > ../submodules_tar/$_file.tar.gz - echo " - 7zipping $_file - " - 7z a ../submodules_zip/$_file.7z $_file/ > /dev/null - echo " - zipping $_file -" - $SCRIPT_DIR/winzipdir.sh ../submodules_zip/$_file.zip $_file + echo " - Creating archives - " + ( tar c $_file | tee \ + >(xz -9 > ../submodules_tar/$_file.tar.xz) | \ + gzip -9 > ../submodules_tar/$_file.tar.gz + echo " - Done tarring $_file -" + ) & + ( 7z a ../submodules_zip/$_file.7z $_file/ > /dev/null + echo " - Done 7zipping $_file - " + ) & + ( $SCRIPT_DIR/winzipdir.sh ../submodules_zip/$_file.zip $_file + echo " - Done zipping $_file -" + ) & + wait done < $MODULES cd .. } -- cgit v1.2.3