aboutsummaryrefslogtreecommitdiffstats
path: root/packaging-tools/mksrc.sh
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-13 15:53:12 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-14 12:47:43 +0100
commit55e7f374ada24a67d26d8e9bb2c5b45e40c34434 (patch)
tree1090108f6c90a72750429ccbb6b7c1824cca1c11 /packaging-tools/mksrc.sh
parentcaaae435a14a9737bcc304b1d9902bb9eecf8e24 (diff)
Parallelize archive creation
Change-Id: Ie090f3c39db3558a6a0d76779ad421a6e4454dc0 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'packaging-tools/mksrc.sh')
-rwxr-xr-xpackaging-tools/mksrc.sh37
1 files changed, 24 insertions, 13 deletions
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 ..
}