Commit 13866a4309f3e107c1658fbf10ccff613cbb03a6

Authored by Perry Werneck
1 parent f5a4e0ac

Working on windows package build.

Showing 1 changed file with 27 additions and 29 deletions   Show diff stats
win/pack.sh
... ... @@ -36,7 +36,7 @@ PACKAGE_EXTRAS="libhllapi pw3270-keypads"
36 36 TARGET_ARCHS="x86_64"
37 37  
38 38 GIT_URL="https://github.com/PerryWerneck"
39   -BUILD_UNSTABLE=0
  39 +BUILD_BRANCH="master"
40 40 MAKE_ZIP=0
41 41 CLEAR_TARGET_PATH=0
42 42  
... ... @@ -83,17 +83,16 @@ failed()
83 83 #
84 84 clone()
85 85 {
86   - echo -e "\e]2;Cloning ${1}\a"
87 86  
88 87 mkdir -p ${WORKDIR}/sources
89 88  
90   - if [ "${BUILD_UNSTABLE}" == "1" ]; then
91   - BRANCH="develop"
92   - else
93   - TEMPVAR=$(echo ${1}_branch | sed -e "s@-@@g")
94   - BRANCH=${!TEMPVAR}
  89 + TEMPVAR=$(echo ${1}_branch | sed -e "s@-@@g")
  90 + BRANCH=${!TEMPVAR}
  91 + if [ -z ${BRANCH} ]; then
  92 + BRANCH=${BUILD_BRANCH}
95 93 fi
96 94  
  95 + echo -e "\e]2;Cloning ${1} ${BRANCH}\a"
97 96 echo "Cloning ${1} ${BRANCH}"
98 97 if [ -z ${BRANCH} ]; then
99 98 git clone --quiet ${GIT_URL}/${1}.git ${WORKDIR}/sources/${1}
... ... @@ -424,7 +423,7 @@ buildApplication()
424 423 fi
425 424 done
426 425  
427   - if [ "${BUILD_UNSTABLE}" == "1" ]; then
  426 + if [ "${BUILD_BRANCH}" == "develop" ]; then
428 427 APP_OPTIONS="--enable-unstable"
429 428 else
430 429 APP_OPTIONS=""
... ... @@ -569,13 +568,22 @@ copy_install_file() {
569 568 failed "Can't copy ${1} to ${FILENAME}"
570 569 fi
571 570  
572   - if [ ${BUILD_UNSTABLE} == "1" ]; then
  571 + case ${BUILD_BRANCH} in
  572 + develop)
573 573 TARGET_PATH="/${PRODUCT_NAME}/unstable/${ARCH}"
574 574 FILENAME=${PROJECTDIR}/dist/unstable/${ARCH}/$(basename ${1})
575   - else
  575 + ;;
  576 +
  577 + master)
576 578 TARGET_PATH="/${PRODUCT_NAME}/stable/${ARCH}"
577 579 FILENAME=${PROJECTDIR}/dist/stable/${ARCH}/$(basename ${1})
578   - fi
  580 + ;;
  581 +
  582 + *)
  583 + TARGET_PATH="/${PRODUCT_NAME}/${BUILD_BRANCH}/${ARCH}"
  584 + FILENAME=${PROJECTDIR}/dist/${BUILD_BRANCH}/${ARCH}/$(basename ${1})
  585 +
  586 + esac
579 587  
580 588 if [ "${CLEAR_TARGET_PATH}" == "1" ]; then
581 589 rm -fr "$(dirname ${FILENAME})/*"
... ... @@ -798,21 +806,6 @@ do
798 806  
799 807 CLEAR)
800 808 CLEAR_TARGET_PATH=1
801   -
802   -# if [ ${BUILD_UNSTABLE} == "1" ]; then
803   -# CLEAR_TARGET="${PRODUCT_NAME}/unstable"
804   -# else
805   -# CLEAR_TARGET="${PRODUCT_NAME}/stable"
806   -# fi
807   -#
808   -# if [ -d ~/public_html/win/${STORAGE_PATH} ]; then
809   -# echo rm -fr ~/public_html/win/${CLEAR_TARGET}/{x86_32,x86_64}
810   -# fi
811   -#
812   -# if [ ! -z "${XDG_PUBLICSHARE_DIR}" ] && [ -d "${XDG_PUBLICSHARE_DIR}/${CLEAR_TARGET}" ]; then
813   -# echo rm -fr ${XDG_PUBLICSHARE_DIR}/${CLEAR_TARGET}/{x86_32,x86_64}
814   -# fi
815   -
816 809 ;;
817 810  
818 811 EXTRA-PACKAGES)
... ... @@ -836,11 +829,15 @@ do
836 829 ;;
837 830  
838 831 UNSTABLE)
839   - BUILD_UNSTABLE=1
  832 + BUILD_BRANCH="develop"
840 833 ;;
841 834  
842 835 DEVELOP)
843   - BUILD_UNSTABLE=1
  836 + BUILD_BRANCH="develop"
  837 + ;;
  838 +
  839 + BRANCH)
  840 + BUILD_BRANCH=${value}
844 841 ;;
845 842  
846 843 SHELL-ON-ERROR)
... ... @@ -863,7 +860,8 @@ do
863 860  
864 861 echo " --product-name Set the product name (current is ${PRODUCT_NAME})"
865 862 echo " --project-path Set the path for the customization data"
866   - echo " --unstable Build unstable version"
  863 + echo " --unstable Build unstable version (--branch=develop)"
  864 + echo " --branch Build selected branch (current=${BUILD_BRANCH}"
867 865  
868 866 echo " --target-archs Set the target architectures (current are ${TARGET_ARCHS})"
869 867 echo " --sources-from Base URL of the git server with the sources (current is ${GIT_URL})"
... ...