Parcourir la source

Make pkg.sh script faster

 + Make it more than 3 times faster.
 + Read from stdin/stdout directly, without rereading from disk. Gzip is used as
 first compressor, since the two others wait for it.
 + There may be cross-platform concerns using tee.
Leo il y a 9 ans
Parent
commit
4f66d78ac2
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      pkg.sh

+ 3 - 3
pkg.sh

@@ -27,9 +27,9 @@ echo "Writing in" $name".*"
 git archive ${TCID} --prefix=${name}/ --format=zip -o dist/${name}.zip -9
 # Creating .xz .gz and .bz2 from tar archive
 tar_name=${name}.tar
-git archive ${TCID} --prefix=${name}/ --format=tar -o dist/${tar_name}
+git archive ${TCID} --prefix=${name}/ --format=tar \
+  | tee dist/${tar_name} \
+  | gzip -c9 >  dist/${tar_name}.gz
 cd dist
-gzip -c9 < ${tar_name} >  ${tar_name}.gz
 bzip2 -c9 < ${tar_name} >  ${tar_name}.bz2
 xz -c9 < ${tar_name} >  ${tar_name}.xz
-