Commit 3c14dbdd authored by Johanna Aijala's avatar Johanna Aijala Committed by Simo Fält
Browse files

Commandline options to mksrc script.


Commandline options:
-j [count]   make thread count
--silent     silent mode (-s to make cmd)
--strict     strict mode, script exists on any error

Removed __files_to_list temp file from qt5 zip.

Change-Id: Iec42e500ffab0ce6e195698441821ed7a43379dc
Reviewed-by: default avatarIikka Eklund <iikka.eklund@digia.com>
Reviewed-by: default avatarSimo Fält <simo.falt@digia.com>
parent ba3a66a8
No related merge requests found
Showing with 52 additions and 25 deletions
...@@ -31,22 +31,25 @@ IGNORE_LIST= ...@@ -31,22 +31,25 @@ IGNORE_LIST=
LICENSE=opensource LICENSE=opensource
PATCH_FILE='' PATCH_FILE=''
REPO_TAG=HEAD REPO_TAG=HEAD
STRICT=0
function usage() function usage()
{ {
echo "Usage:" echo "Usage:"
echo "./mksrc.sh -u <file_url_to_git_repo> -v <version> [-m][-d][-i sub][-l lic][-p patch][-t revision]" echo "./mksrc.sh -u <file_url_to_git_repo> -v <version> [-m][-d][-i sub][-l lic][-p patch][-t revision][--strict][--silent]"
echo "where -u is path to git repo and -v is version" echo "where -u is path to git repo and -v is version"
echo "Optional parameters:" echo "Optional parameters:"
echo "-m one is able to tar each sub module separately" echo "-m one is able to tar each sub module separately"
echo "--no-docs skip generating documentation" echo "--no-docs skip generating documentation"
echo "--tag also tag the repository" echo "--tag also tag the repository"
echo "-N don't use git fetch to update submodules" echo "-N don't use git fetch to update submodules"
echo "-i submodule will exclude the submodule from final package " echo "--strict strict mode, execution will fail on any error"
echo "-l license license type, will default to 'opensource', if set to 'commercial' all the necessary patches will be applied for commercial build" echo "--silent silent mode"
echo "-p patch file patch file (.sh) to execute, example: change_licenses.sh" echo "-i submodule will exclude the submodule from final package "
echo "-t revision committish to pack (tag name, branch name or SHA-1)" echo "-l license license type, will default to 'opensource', if set to 'commercial' all the necessary patches will be applied for commercial build"
echo "--exit-after-docs exit after creating doc arhives (without creating src archives)" echo "-p patch file patch file (.sh) to execute, example: change_licenses.sh"
echo "-t revision committish to pack (tag name, branch name or SHA-1)"
echo "-j make thread count"
} }
function cleanup() function cleanup()
...@@ -71,7 +74,7 @@ function create_main_file() ...@@ -71,7 +74,7 @@ function create_main_file()
tar cf - $PACKAGE_NAME/ | \ tar cf - $PACKAGE_NAME/ | \
tee \ tee \
>(xz -9 > $PACKAGE_NAME.tar.xz) | \ >(xz -9 > $PACKAGE_NAME.tar.xz) | \
gzip -9 > $BIG_TAR gzip -9 > $PACKAGE_NAME.tar.gz
echo " - Creating single 7z file - " echo " - Creating single 7z file - "
7z a $PACKAGE_NAME.7z $PACKAGE_NAME/ > /dev/null 7z a $PACKAGE_NAME.7z $PACKAGE_NAME/ > /dev/null
...@@ -80,9 +83,9 @@ function create_main_file() ...@@ -80,9 +83,9 @@ function create_main_file()
# ZIP # ZIP
find $PACKAGE_NAME/ > __files_to_zip find $PACKAGE_NAME/ > __files_to_zip
# zip binfiles # zip binfiles
file -f __files_to_zip | fgrep -f _txtfiles -v | cut -d: -f1 | zip -9q $BIG_ZIP -@ file -f __files_to_zip | fgrep -f _txtfiles -v | cut -d: -f1 | zip -9q $PACKAGE_NAME.zip -@
#zip ascii files with win line endings #zip ascii files with win line endings
file -f __files_to_zip | fgrep -f _txtfiles | cut -d: -f1 | zip -l9q $BIG_ZIP -@ file -f __files_to_zip | fgrep -f _txtfiles | cut -d: -f1 | zip -l9q $PACKAGE_NAME.zip -@
} }
function create_and_delete_submodule() function create_and_delete_submodule()
...@@ -104,6 +107,7 @@ function create_and_delete_submodule() ...@@ -104,6 +107,7 @@ function create_and_delete_submodule()
#zip ascii files with win line endings #zip ascii files with win line endings
file -f __files_to_zip | fgrep -f ../_txtfiles | cut -d: -f1 | zip -l9q ../submodules_zip/$_file.zip -@ file -f __files_to_zip | fgrep -f ../_txtfiles | cut -d: -f1 | zip -l9q ../submodules_zip/$_file.zip -@
rm -rf $_file rm -rf $_file
rm -rf __files_to_zip
done < $MODULES done < $MODULES
cd .. cd ..
} }
...@@ -168,6 +172,19 @@ while test $# -gt 0; do ...@@ -168,6 +172,19 @@ while test $# -gt 0; do
--exit-after-docs) --exit-after-docs)
shift shift
EXIT_AFTER_DOCS=true EXIT_AFTER_DOCS=true
-j|--jobs)
shift
MAKEARGS=$MAKEARGS+' -j'$1
shift
;;
--strict)
shift
STRICT=1
shift
;;
--silent)
shift
MAKEARGS=$MAKEARGS+' -s'
shift shift
;; ;;
*) *)
...@@ -186,8 +203,6 @@ if ! git rev-parse --git-dir >/dev/null 2>/dev/null; then ...@@ -186,8 +203,6 @@ if ! git rev-parse --git-dir >/dev/null 2>/dev/null; then
fi fi
PACKAGE_NAME=qt-everywhere-$LICENSE-src-$QTVER PACKAGE_NAME=qt-everywhere-$LICENSE-src-$QTVER
BIG_TAR=$PACKAGE_NAME.tar.gz
BIG_ZIP=$PACKAGE_NAME.zip
MODULES=$CUR_DIR/submodules.txt MODULES=$CUR_DIR/submodules.txt
_TMP_DIR=$CUR_DIR/$PACKAGE_NAME _TMP_DIR=$CUR_DIR/$PACKAGE_NAME
...@@ -198,13 +213,10 @@ _TMP_DIR=$CUR_DIR/$PACKAGE_NAME ...@@ -198,13 +213,10 @@ _TMP_DIR=$CUR_DIR/$PACKAGE_NAME
echo " -- Finding submodules from $REPO_DIR -- " echo " -- Finding submodules from $REPO_DIR -- "
rm -f $MODULES rm -f $MODULES
rm -f $BIG_TAR
rm -f $BIG_ZIP
rm -rf $_TMP_DIR rm -rf $_TMP_DIR
mkdir $_TMP_DIR mkdir $_TMP_DIR
# detect the submodules to be archived # detect the submodules to be archived
rm -f $MODULES
git ls-tree $REPO_TAG | while read mode type sha1 name; do git ls-tree $REPO_TAG | while read mode type sha1 name; do
test "$type" = "commit" || continue test "$type" = "commit" || continue
test -d "$name" || { test -d "$name" || {
...@@ -227,6 +239,8 @@ if $DO_TAG && test "v$QTVER" != "$REPO_TAG"; then ...@@ -227,6 +239,8 @@ if $DO_TAG && test "v$QTVER" != "$REPO_TAG"; then
REPO_TAG=v$QTVER REPO_TAG=v$QTVER
fi fi
cd $REPO_DIR
#archive the main repo #archive the main repo
git archive --format=tar $REPO_TAG | tar -x -C $_TMP_DIR git archive --format=tar $REPO_TAG | tar -x -C $_TMP_DIR
_SHA=`git rev-parse $REPO_TAG` _SHA=`git rev-parse $REPO_TAG`
...@@ -336,8 +350,24 @@ if [ $DOCS = generate ]; then ...@@ -336,8 +350,24 @@ if [ $DOCS = generate ]; then
# Put the generated docs back into the clean source directory # Put the generated docs back into the clean source directory
echo "DOC: Put the generated docs back into the clean source directory" echo "DOC: Put the generated docs back into the clean source directory"
mv $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/html $CUR_DIR/$PACKAGE_NAME/qtdoc/doc if [ ! -d $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/html ]; then
mv $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/qch $CUR_DIR/$PACKAGE_NAME/qtdoc/qch echo "DOC: *** Error: $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/html not found!"
if [ $STRICT -eq 1 ]; then
echo " -> exiting.."
exit 2
fi
else
mv $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/html $CUR_DIR/$PACKAGE_NAME/qtdoc/doc
fi
if [ ! -d $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/qch ]; then
echo "DOC: *** Error: $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/qch not found"
if [ $STRICT -eq 1 ]; then
echo " -> exiting.."
exit 2
fi
else
mv $DOC_BUILD/$PACKAGE_NAME/qtdoc/doc/qch $CUR_DIR/$PACKAGE_NAME/qtdoc/qch
fi
# Cleanup # Cleanup
cd $CUR_DIR/$PACKAGE_NAME/ cd $CUR_DIR/$PACKAGE_NAME/
#rm -rf $DOC_BUILD #rm -rf $DOC_BUILD
...@@ -381,13 +411,10 @@ if [ $MULTIPACK = yes ]; then ...@@ -381,13 +411,10 @@ if [ $MULTIPACK = yes ]; then
create_and_delete_submodule create_and_delete_submodule
create_main_file create_main_file
mv $PACKAGE_NAME.tar.xz submodules_tar/qt5-$LICENSE-src-$QTVER.tar.xz mv $PACKAGE_NAME.tar.xz submodules_tar/qt5-$LICENSE-src-$QTVER.tar.xz
mv $BIG_TAR submodules_tar/qt5-$LICENSE-src-$QTVER.tar.gz mv $PACKAGE_NAME.tar.gz submodules_tar/qt5-$LICENSE-src-$QTVER.tar.gz
mv $BIG_ZIP submodules_zip/qt5-$LICENSE-src-$QTVER.zip mv $PACKAGE_NAME.zip submodules_zip/qt5-$LICENSE-src-$QTVER.zip
fi fi
cleanup cleanup
echo "Done!" echo "Done!"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment