diff options
Diffstat (limited to 'debian/_buildscripts/local/scripts/build_module.sh')
-rwxr-xr-x | debian/_buildscripts/local/scripts/build_module.sh | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/debian/_buildscripts/local/scripts/build_module.sh b/debian/_buildscripts/local/scripts/build_module.sh index 7862e5fe9..63d2a4574 100755 --- a/debian/_buildscripts/local/scripts/build_module.sh +++ b/debian/_buildscripts/local/scripts/build_module.sh @@ -74,7 +74,7 @@ for arg in $@; do 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 + elif [ "$arg" = "-ip" ]; then # build using Internal Pbuilder (experimental) bool_INTERNAL_PBUILDER="y" elif [ "$MOD_NAME" = "" ]; then # module to be built MOD_NAME="$arg" @@ -86,8 +86,8 @@ if [ "$MOD_NAME" = "" ]; then do_exit 3 fi -# Check if module is an extra dependency (i.e. from the nightly build dependency PPA) -if [[ $MOD_NAME =~ ^edeps/ ]]; then +# Check if module is an extra dependency +if [[ $MOD_NAME =~ ^$CFG_EXTRA_DEPS_DIR/ ]]; then bool_EXTRADEP_MOD="y" fi @@ -111,6 +111,11 @@ if [ ! -z "$GPG_SIGN_KEYID" ]; then OPT_SIGN_PKG_LOCAL="-k$GPG_SIGN_KEYID" OPT_SIGN_PKG_PBUILDER="--auto-debsign --debsign-k $GPG_SIGN_KEYID" fi +# - show logs +OPT_SHOW_LOGS="&>" +if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then + OPT_SHOW_LOGS=" | tee " +fi # Log start @@ -239,10 +244,11 @@ if [ "$bool_COPY_MOD_SRC" = "y" ]; then if [ -d "$MOD_BUILD_PATH" ]; then rm -R "$MOD_BUILD_PATH" fi - if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then - dpkg-source --no-copy --no-check -x `find "$MOD_GIT_PATH" -name '*.dsc'` "$MOD_BUILD_PATH" - else - dpkg-source --no-copy --no-check -x `find "$MOD_GIT_PATH" -name '*.dsc'` "$MOD_BUILD_PATH" &>/dev/null + eval dpkg-source --no-copy --no-check -x `find "$MOD_GIT_PATH" -name '*.dsc'` \ + \"$MOD_BUILD_PATH\" $OPT_SHOW_LOGS/dev/null + # Make sure patches are not reapplied in future local builds. This could stop pdebuild from working. + if [ -f "$MOD_BUILD_PATH/debian/patches/series" ]; then + cp /dev/null "$MOD_BUILD_PATH/debian/patches/series" fi else echo "There must be one and only one .dsc file in \"$MOD_GIT_PATH\"" @@ -383,11 +389,7 @@ cd "$MOD_BUILD_PATH" if [ "$bool_BUILD_LOCALLY" = "y" ]; then ## Build module locally echo -e "${CYellow}> Building locally${CNone}" - if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then - dpkg-buildpackage $OPT_SIGN_PKG_LOCAL | tee "$BUILDING_LOG_FILE" - else - dpkg-buildpackage $OPT_SIGN_PKG_LOCAL &>"$BUILDING_LOG_FILE" - fi + eval dpkg-buildpackage $OPT_SIGN_PKG_LOCAL $OPT_SHOW_LOGS\"$BUILDING_LOG_FILE\" build_retval=$? # else @@ -412,11 +414,10 @@ else fi # echo -e "${CYellow}> Building using pbuilder${CNone}" - if [ "$bool_SHOW_BUILD_LOGS" = "y" ]; then - pdebuild $OPT_INTERNAL_PBUILDER $OPT_SIGN_PKG_PBUILDER --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$DISTRO_NAME ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" - else - pdebuild $OPT_INTERNAL_PBUILDER $OPT_SIGN_PKG_PBUILDER --architecture $ARCHITECTURE --buildresult "$MOD_DEB_PATH" --pbuilderroot "sudo DIST=$DISTRO_NAME ARCH=$ARCHITECTURE" --logfile "$BUILDING_LOG_FILE" &>"$BUILDING_LOG_FILE" - fi + eval pdebuild $OPT_INTERNAL_PBUILDER $OPT_SIGN_PKG_PBUILDER \ + --architecture $ARCHITECTURE --buildresult \"$MOD_DEB_PATH\" \ + --pbuilderroot \"sudo DIST=$DISTRO_NAME ARCH=$ARCHITECTURE\" \ + --logfile \"$BUILDING_LOG_FILE\" $OPT_SHOW_LOGS\"$BUILDING_LOG_FILE\" build_retval=$? umount "$PBUILDER_REPO" fi |