DEB build scripts: dropped 'internal pbuilder' option and some code improvements.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/94/head
Michele Calgaro 3 years ago
parent e0d1335be8
commit 1ccf2a151e
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -188,7 +188,6 @@ When building sets of modules or the whole TDE, a global build summary is automa
-po (Prepare Only): only prepare the source folder but do not build the module. Useful to prepare the source code before
doing local changes/development. The module can then be built from the modified local folder
-d (Debug) : enable debug symbols if possible (debian/rules file must contain "RelWithDebInfo" for this to work)
-ip (Internal Pbuilder): build using internal pbuilder mode (experimental)
- <dd>_<set_name>.sh
A number of scripts used to build sets of modules. Each script builds an individual set.

@ -28,12 +28,12 @@ function do_exit()
{
cd "$SCRIPT_DIR"
if [ $1 -eq 0 ]; then
echo -e "${CGreen}#### Processing module ${CLightGreen}\"$MOD_GIVEN\"${CGreen} succeeded ####${CNone}"
echo -e "${CGreen}#### Processing module ${CLightGreen}\"$MOD_NAME\"${CGreen} succeeded ####${CNone}"
if [ "$bool_LOG_RESULT" = "y" ]; then
echo "[ OK ] [$_BUILDMOD_TIME] \"$MOD_NAME\"" >>"$LOG_BUILD_RESULT_FILENAME"
fi
else
echo -e "${CRed}#### Processing module ${CLightRed}\"$MOD_GIVEN\"${CRed} failed ($1) ####${CNone}"
echo -e "${CRed}#### Processing module ${CLightRed}\"$MOD_NAME\"${CRed} failed ($1) ####${CNone}"
if [ "$bool_LOG_RESULT" = "y" ]; then
echo "[FAILED] [$_BUILDMOD_TIME] \"$MOD_NAME\"" >>"$LOG_BUILD_RESULT_FILENAME"
fi
@ -120,7 +120,7 @@ function search_module()
#----------------------------
# Check command line arguments and set options
#----------------------------
MOD_GIVEN="" # the name of the specified module
MOD_NAME="" # the name of the specified module
bool_BUILD_FROM_GIT="n"
bool_EXTRADEP_MOD="n"
bool_SHOW_BUILD_LOGS="n"
@ -129,31 +129,47 @@ bool_LOG_RESULT="n"
bool_SHELL_HOOK="n"
bool_PREPARE_ONLY="n"
bool_DEBUG_MODE="n"
bool_INTERNAL_PBUILDER="n"
for arg in $@; do
if [ "$arg" = "-g" ]; then # select code to build from Git repo (-g) or from local build copy
bool_BUILD_FROM_GIT="y"
elif [ "$arg" = "-l" ]; then # build module Locally instead of in a clean chroot environment
bool_BUILD_LOCALLY="y"
elif [ "$arg" = "-sl" ]; then # output the building logs to terminal (ShowLog)
bool_SHOW_BUILD_LOGS="y"
elif [ "$arg" = "-lr" ]; then # Log build Result to file
bool_LOG_RESULT="y"
elif [ "$arg" = "-sh" ]; then # install Shell Hook for failing builds (only valid if NOT building locally)
bool_SHELL_HOOK="y"
elif [ "$arg" = "-po" ]; then # Prepare build folder Only but do not build
bool_PREPARE_ONLY="y"
elif [ "$arg" = "-d" ]; then # build with Debug symbols (used in hook scripts)
bool_DEBUG_MODE="y"
elif [ "$arg" = "-ip" ]; then # build using Internal Pbuilder (experimental)
bool_INTERNAL_PBUILDER="y"
elif [ "$MOD_GIVEN" = "" ]; then # module to be built
MOD_GIVEN="$arg"
fi
bool_INVALID_PARAMETERS="n"
while [ $# -gt 0 ]; do
case "$1" in
-d) # build with Debug symbols (used in hook scripts)
bool_DEBUG_MODE="y"
;;
-g) # select code to build from Git repo (-g) or from local build copy
bool_BUILD_FROM_GIT="y"
;;
-l) # build module Locally instead of in a clean chroot environment
bool_BUILD_LOCALLY="y"
;;
-lr) # Log build Result to file
bool_LOG_RESULT="y"
;;
-po) # Prepare build folder Only but do not build
bool_PREPARE_ONLY="y"
;;
-sh) # install Shell Hook for failing builds (only valid if NOT building locally)
bool_SHELL_HOOK="y"
;;
-sl) # output the building logs to terminal (ShowLog)
bool_SHOW_BUILD_LOGS="y"
;;
*) # module to be built
if [ -z "$MOD_NAME" ]; then
MOD_NAME="$1"
else
bool_INVALID_PARAMETERS="y"
fi
esac
shift
done
MOD_NAME=$MOD_GIVEN # the actal module to be built
if [ "$bool_INVALID_PARAMETERS" != "n" ]; then
echo "Invalid arguments."
MOD_NAME="N/A"
do_exit 1
fi
echo -e "${CLightCyan}#### Processing module \"$MOD_GIVEN\" ####${CNone}"
echo -e "${CLightCyan}#### Processing module \"$MOD_NAME\" ####${CNone}"
if [ "$MOD_NAME" = "" ]; then
echo "Please specify the module to build"
@ -161,13 +177,10 @@ if [ "$MOD_NAME" = "" ]; then
fi
# Shell hook is only valid if not building locally
# Internal pbuilder option has no meaning if we are building locally
if [ "bool_BUILD_LOCALLY" = "y" ]; then
bool_SHELL_HOOK="n"
bool_INTERNAL_PBUILDER="n"
fi
export bool_SHELL_HOOK
export bool_INTERNAL_PBUILDER
# Local option variables
# - sign packages

@ -8,12 +8,6 @@ function run_pdebuild()
PBUILDER_SHELL_HOOK="$PBUILDER_HOOK_DIR/C10shell"
PBUILDER_DEPS_HOOK="$PBUILDER_HOOK_DIR/D05deps"
# Local option variables
# - internal pbuilder
OPT_INTERNAL_PBUILDER=""
if [ "$bool_INTERNAL_PBUILDER" = "y" ]; then
OPT_INTERNAL_PBUILDER="--use-pdebuild-internal"
fi
# Sign packages optino
OPT_SIGN_PKG_PBUILDER=""
if [ ! -z "$GPG_SIGN_KEYID" ]; then
@ -82,7 +76,7 @@ END_D05_03
if [ ${DEB_BUILD_PARALLEL+x} ]; then
OPT_BUILD_PARALLEL="DEB_BUILD_PARALLEL=$DEB_BUILD_PARALLEL"
fi
eval pdebuild $OPT_INTERNAL_PBUILDER $OPT_SIGN_PKG_PBUILDER \
eval pdebuild $OPT_SIGN_PKG_PBUILDER \
--architecture $ARCHITECTURE \
--buildresult \"$MOD_DEB_PATH\" \
--pbuilderroot \"sudo $OPT_BUILD_PARALLEL DISTRO_NAME=$DISTRO_NAME ARCHITECTURE=$ARCHITECTURE\" \
@ -108,4 +102,4 @@ END_D05_03
#----------------------------
# The actual code is inside a function to allow the pdebuild return value to be
# correctly passed back to the calling script in all cases (root and non root users)
run_pdebuild
run_pdebuild

Loading…
Cancel
Save