- major rework of update_repositories.sh script, which now supports multiple branches and provide better feedback to user. - added support for pre-built extra dependency packages. A user can now use Slavek Banko's binary packages instead of building the extra dependency locally. This removes a quite tedious process during the setup of the building environment. - bug fixes and more user friendly folder names. - improved README to cover the complete process until TDE installation. Special thanks to Gregory Guy <zadig83@laposte.net> for testing and feedback done so far. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>pull/3/head
parent
02dbbffa60
commit
eeaccbeddb
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./internals/_build_set_common.sh
|
||||
|
||||
#----------------------------
|
||||
set_log_start
|
||||
|
||||
if [[ "$USE_PREBUILD_EXTRA_DEPS" = "y" ]]; then
|
||||
echo -e "${CBrown}#### Use of pre-built extra dependency packages is currently configured. Nothing to do. ####\n${CNone}"
|
||||
echo "Use of pre-built extra dependency packages is currently configured. Nothing to do." >>"$LOG_BUILD_RESULT_FILENAME"
|
||||
else
|
||||
build_module "edeps/gettext-kde"
|
||||
build_module "edeps/fireflies"
|
||||
build_module "edeps/imlib"
|
||||
build_module "edeps/opensync"
|
||||
build_module "edeps/libbeagle"
|
||||
build_module "edeps/pcsc-lite-nodbus"
|
||||
build_module "edeps/lcms"
|
||||
build_module "edeps/wv2"
|
||||
build_module "edeps/jasper"
|
||||
build_module "edeps/openslp-dfsg"
|
||||
fi
|
||||
|
||||
set_log_end
|
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./internals/_build_set_common.sh
|
||||
|
||||
#----------------------------
|
||||
set_log_start
|
||||
|
||||
build_module "applications/koffice"
|
||||
build_module "applications/koffice-i18n"
|
||||
build_module "applications/keximdb"
|
||||
build_module "applications/konversation"
|
||||
build_module "applications/kooldock"
|
||||
build_module "applications/kopete-otr"
|
||||
build_module "applications/kpicosim"
|
||||
build_module "applications/kpilot"
|
||||
build_module "applications/kplayer"
|
||||
|
||||
set_log_end
|
||||
|
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./internals/_build_set_common.sh
|
||||
|
||||
#----------------------------
|
||||
set_log_start
|
||||
|
||||
build_module "tde-i18n"
|
||||
if [[ "$USE_PREBUILD_EXTRA_DEPS" != "y" ]]; then
|
||||
build_module "edeps/compiz-trinity"
|
||||
build_module "edeps/libcompizconfig-trinity"
|
||||
build_module "edeps/compiz-fusion-bcop-trinity"
|
||||
build_module "edeps/compiz-fusion-plugins-main-trinity"
|
||||
build_module "edeps/compiz-fusion-plugins-extra-trinity"
|
||||
build_module "edeps/compizconfig-python-trinity"
|
||||
fi
|
||||
build_module "applications/compizconfig-backend-tdeconfig"
|
||||
|
||||
set_log_end
|
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$USE_PREBUILD_EXTRA_DEPS" != "y" ]]; then
|
||||
./00_extradeps.sh
|
||||
fi
|
||||
./01_base_01.sh
|
||||
./02_base_02.sh
|
||||
./03_base_03.sh
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
./10_others_01.sh
|
||||
./11_others_02.sh
|
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load common code and initialization
|
||||
. ./internals/_build_common.sh
|
||||
init_common
|
||||
|
||||
_BUILDALL_TIMER=2
|
||||
_BUILDALL_TIME="--/--:--:--:---"
|
||||
|
||||
|
||||
#----------------------------
|
||||
# do_exit for set building
|
||||
function do_exit()
|
||||
{
|
||||
cd "$SCRIPT_DIR"
|
||||
if [ $1 -eq 0 ]; then
|
||||
echo -e "${CGray}#### Building process for TDE completed ####${CNone}"
|
||||
else
|
||||
echo -e "${CGray}#### Building process for TDE interrupted ($1) ####${CNone}"
|
||||
fi
|
||||
exit $1
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
function set_log_start()
|
||||
{
|
||||
echo -e "${CGray}#### Starting building process for TDE ####${CNone}"
|
||||
echo
|
||||
echo "********** TDE **********" >>"$LOG_BUILD_RESULT_FILENAME"
|
||||
exec_time_start $_BUILDALL_TIMER
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
function set_log_end()
|
||||
{
|
||||
exec_time_stop $_BUILDALL_TIMER "_BUILDALL_TIME"
|
||||
echo " [$_BUILDALL_TIME] All TDE " >>"$LOG_BUILD_RESULT_FILENAME"
|
||||
echo >>"$LOG_BUILD_RESULT_FILENAME"
|
||||
do_exit 0
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Build TDE
|
||||
#----------------------------
|
||||
set_log_start
|
||||
|
||||
./91_build_base.sh
|
||||
./92_build_applications.sh
|
||||
./93_build_others.sh
|
||||
|
||||
set_log_end
|
@ -0,0 +1,248 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -a
|
||||
|
||||
#----------------------------
|
||||
# Color table
|
||||
# Black 0;30 Dark Gray 1;30
|
||||
# Blue 0;34 Light Blue 1;34
|
||||
# Green 0;32 Light Green 1;32
|
||||
# Cyan 0;36 Light Cyan 1;36
|
||||
# Red 0;31 Light Red 1;31
|
||||
# Purple 0;35 Light Purple 1;35
|
||||
# Brown 0;33 Yellow 1;33
|
||||
# Light Gray 0;37 White 1;37
|
||||
# No Color 0
|
||||
#----------------------------
|
||||
CBlack='\e[0;30m'
|
||||
CDarkGray='\e[1;30m'
|
||||
CBlue='\e[0;34m'
|
||||
CLightBlue='\e[1;34m'
|
||||
CGreen='\e[0;32m'
|
||||
CLightGreen='\e[1;32m'
|
||||
CCyan='\e[0;36m'
|
||||
CLightCyan='\e[1;36m'
|
||||
CRed='\e[0;31m'
|
||||
CLightRed='\e[1;31m'
|
||||
CPurple='\e[0;35m'
|
||||
CLightPurple='\e[1;35m'
|
||||
CBrown='\e[0;33m'
|
||||
CYellow='\e[1;33m'
|
||||
CGray='\e[0;37m'
|
||||
CWhite='\e[1;37m'
|
||||
CNone='\e[0m'
|
||||
|
||||
set +a
|
||||
|
||||
#----------------------------
|
||||
# Echo a colored string to tty and tee-append it to a file without color codes
|
||||
# Parameters:
|
||||
# $1 - string to echo
|
||||
# $2 - log filename
|
||||
# $3 - if "y" create a new file.
|
||||
function echo_and_tee()
|
||||
{
|
||||
if [ "$3" = "y" ]; then
|
||||
echo -e "$1" | tee /dev/tty | sed -r "s|\x1b\[[0-9]+(;[0-9]+)?m||g" >"$2"
|
||||
else
|
||||
echo -e "$1" | tee /dev/tty | sed -r "s|\x1b\[[0-9]+(;[0-9]+)?m||g" >>"$2"
|
||||
fi
|
||||
}
|
||||
|
||||
#----------------------------
|
||||
function _set_path_varables()
|
||||
{
|
||||
# Set useful path variables
|
||||
set -a
|
||||
REPO_DIR="$TDE_DIR/$CFG_GIT_DIR"
|
||||
REPO_TDE="$TDE_DIR/$CFG_GIT_DIR/tde"
|
||||
REPO_TDE_MAIN="$REPO_TDE/main"
|
||||
REPO_TDE_PACKAGING="$TDE_DIR/$CFG_GIT_DIR/tde-packaging/$DISTRO/$DISTRO_NAME"
|
||||
REPO_EXTRA_DEPENDENCIES="$TDE_DIR/$CFG_GIT_DIR/$CFG_EXTRA_DEPS_DIR"
|
||||
|
||||
BUILD_DIR="$TDE_DIR/$CFG_BUILD_DIR"
|
||||
TDE_BUILD_DIR="$TDE_DIR/$CFG_BUILD_DIR/build"
|
||||
TDE_DEBS_DIR="$TDE_DIR/$CFG_BUILD_DIR/debs"
|
||||
|
||||
HOOK_DIR="$TDE_DIR/$CFG_GIT_DIR/$CFG_HOOKS_DIR"
|
||||
|
||||
SCRIPT_LOG_DIR="$TDE_DIR/$CFG_SCRIPT_LOG_DIR"
|
||||
LOG_BUILD_RESULT_FILENAME="$SCRIPT_LOG_DIR/build_result.log" # Common build logfile
|
||||
LOG_UPDATE_REPO_FILENAME="$SCRIPT_LOG_DIR/update_repo.log" # Update repository logfile
|
||||
set +a
|
||||
}
|
||||
|
||||
#----------------------------
|
||||
function init_common()
|
||||
{
|
||||
# Check script folder
|
||||
export SCRIPT_DIR=$(dirname $(readlink -f "$0"))
|
||||
|
||||
# Prevent the script to be run from TDE packaging repo
|
||||
REPO_URL=$(git config --get remote.origin.url 2>/dev/null)
|
||||
if [ ! -z "$REPO_URL" ] && [ -z "${REPO_URL##*tde-packaging}" ]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo "This script cannot be run from the TDE packaging repository."
|
||||
echo "Please follow the instructions provided, then rerun this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Read config settings
|
||||
CFG_FILE=$SCRIPT_DIR/_config.sh
|
||||
if [ -f "$CFG_FILE" ]; then
|
||||
. "$CFG_FILE"
|
||||
_set_path_varables
|
||||
else
|
||||
echo -e "${CLightRed} --- NOTE ---${CNone}"
|
||||
echo -e "Creating TDE build configuration file from template as ${CLightPurple}$CFG_FILE${CNone}."
|
||||
echo "Please check and modify as required, then rerun this script."
|
||||
cp "$SCRIPT_DIR/internals/_config_template.sh" "$CFG_FILE"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Make sure we have selected a supported distribution
|
||||
DISTS_FILE="$SCRIPT_DIR/internals/distro_list.txt"
|
||||
if [ ! -f "$DISTS_FILE" ]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo "Could not find the list of supported distributions."
|
||||
echo -e "Please check the file ${CLightPurple}$DISTS_FILE${CNone} exists, then rerun this script."
|
||||
exit 3
|
||||
fi
|
||||
# -- Need to use a "here string" otherwise if the DISTRO_FOUND value is modified
|
||||
# -- inside the while loop, this would not remember after the loop.
|
||||
DISTRO_FOUND="n"
|
||||
while read l_distro l_version l_name l_rel_suffix; do
|
||||
if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then
|
||||
DISTRO_FOUND="y"
|
||||
export DISTRO_VERSION="$l_version"
|
||||
export REL_SUFFIX="$l_rel_suffix"
|
||||
break
|
||||
fi
|
||||
done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$")
|
||||
if [ "$DISTRO_FOUND" != "y" ]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo -e "The specified distribution (${CYellow}$DISTRO $DISTRO_NAME${CNone}) is not supported."
|
||||
echo -e "Something is wrong with your configuration (${CLightPurple}$CFG_FILE${CNone})"
|
||||
echo -e "or with the list of supported distributions (${CLightPurple}$DISTS_FILE${CNone})."
|
||||
echo -e "Please check the ${CLightCyan}DISTRO${CNone} and ${CLightCyan}DISTRO_NAME${CNone} variables, then rerun this script."
|
||||
exit 4
|
||||
fi
|
||||
|
||||
# TDE root folder must exist
|
||||
if [ ! -d "$TDE_DIR" ]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo "A valid TDE root folder could not be located. Something is wrong with your configuration"
|
||||
echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}"
|
||||
echo -e "Please check and modify the ${CLightCyan}TDE_DIR${CNone} variable as required, then rerun this script."
|
||||
exit 5
|
||||
fi
|
||||
|
||||
# Search for main TDE repo
|
||||
CURR_DIR=""
|
||||
[ -d "$REPO_TDE_MAIN" ] && cd "$REPO_TDE_MAIN" &>/dev/null && \
|
||||
CURR_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
if [ -z "$CURR_DIR" ]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo "The main TDE repo could not be located. Something is wrong with your configuration"
|
||||
echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}"
|
||||
echo -e "Please check and modify the ${CLightCyan}TDE_DIR${CNone} variable as required, then rerun this script."
|
||||
exit 6
|
||||
fi
|
||||
|
||||
# Search for TDE packaging repo
|
||||
CURR_DIR=""
|
||||
[ -d "$REPO_TDE_PACKAGING" ] && cd "$REPO_TDE_PACKAGING" &>/dev/null && \
|
||||
CURR_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
if [ -z "$CURR_DIR" ]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo "The TDE packaging repo could not be located. Something is wrong with your configuration"
|
||||
echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}"
|
||||
echo -e "Please check and modify the ${CLightCyan}TDE_DIR${CNone} variable as required, then rerun this script."
|
||||
exit 7
|
||||
fi
|
||||
|
||||
# Check branch configuration
|
||||
# - branch existance
|
||||
cd "$REPO_TDE"
|
||||
BRANCHES=()
|
||||
REMOTE_BRANCHES=(`git branch --remote | grep -v "HEAD" | sed "s|origin/||g"`)
|
||||
for br in $UPDATE_BRANCHES; do
|
||||
branch=`echo "$br" | sed -e "s|^[[:space:]]*||" -e "s|[[:space:]]*$||"`
|
||||
found=0
|
||||
for rem_br in "${REMOTE_BRANCHES[@]}"; do
|
||||
if [[ "$rem_br" == "$branch" ]]; then
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ found -eq 1 ]]; then
|
||||
BRANCHES+=($branch)
|
||||
else
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo -e "Invalid branch specified (${CYellow}$branch${CNone}). Something is wrong with your configuration"
|
||||
echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}"
|
||||
echo -e "Please check and modify the ${CLightCyan}UPDATE_BRANCHES${CNone} variable as required, then rerun this script."
|
||||
exit 8
|
||||
fi
|
||||
done
|
||||
if [ ${#BRANCHES[@]} -eq 0 ]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo -e "No valid branch was specified. Something is wrong with your configuration"
|
||||
echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}"
|
||||
echo -e "Please check and modify the ${CLightCyan}UPDATE_BRANCHES${CNone} variable as required, then rerun this script."
|
||||
exit 9
|
||||
fi
|
||||
export BRANCHES
|
||||
# - default branch
|
||||
DEFAULT_REPO_BRANCH=${OVERRIDE_DEFAULT_REPO_BRANCH:-"$DEFAULT_REPO_BRANCH"}
|
||||
found=0
|
||||
for branch in "${BRANCHES[@]}"; do
|
||||
if [[ "$DEFAULT_REPO_BRANCH" == "$branch" ]]; then
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ found -ne 1 ]]; then
|
||||
echo -e "${CLightRed} --- ERROR ---${CNone}"
|
||||
echo -e "Invalid default repo branch specified (${CYellow}$DEFAULT_REPO_BRANCH${CNone}). Something is wrong with your configuration"
|
||||
echo -e "in the config file ${CLightPurple}$CFG_FILE${CNone}"
|
||||
echo -e "Please check and modify the ${CLightCyan}DEFAULT_REPO_BRANCH${CNone} variable as required, then rerun this script."
|
||||
exit 10
|
||||
fi
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Save execution start time
|
||||
# Parameters:
|
||||
# $1 - timer number
|
||||
function exec_time_start()
|
||||
{
|
||||
_ET_start_var="_ET_start_$1"
|
||||
eval "$_ET_start_var=`date +%s.%N`"
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Save execution stop time and set $2 to the execution time
|
||||
# in the format: dd/hh:mm:ss.mmm
|
||||
# Parameters:
|
||||
# $1 - timer number
|
||||
# $2 - result variable name
|
||||
function exec_time_stop()
|
||||
{
|
||||
_ET_start_var="_ET_start_$1"
|
||||
_ET_stop_var="_ET_stop_$1"
|
||||
eval "$_ET_stop_var=`date +%s.%N`"
|
||||
_ET_diff=`echo "${!_ET_stop_var} - ${!_ET_start_var}" | bc`
|
||||
_ET_days=`echo "$_ET_diff/86400" | bc`
|
||||
_ET_diff_day=`echo "$_ET_diff-86400*$_ET_days" | bc`
|
||||
_ET_hours=`echo "$_ET_diff_day/3600" | bc`
|
||||
_ET_diff_hour=`echo "$_ET_diff_day-3600*$_ET_hours" | bc`
|
||||
_ET_mins=`echo "$_ET_diff_hour/60" | bc`
|
||||
_ET_secs=`echo "$_ET_diff_hour-60*$_ET_mins" | bc`
|
||||
local _resultvar=$2
|
||||
eval "$_resultvar=`printf \"%02d/%02d:%02d:%06.3f\" $_ET_days $_ET_hours $_ET_mins $_ET_secs`"
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -a
|
||||
|
||||
#----------------------------
|
||||
# Repo information
|
||||
#----------------------------
|
||||
TDE_DIR="" # TDE root folder
|
||||
UPDATE_BRANCHES="master" # Space separated list. Available choices: master, r14.0.x
|
||||
DEFAULT_REPO_BRANCH="master" # After update in completed, switch repo to this branch. Must be
|
||||
# one of the branches specified in UPDATE_BRANCHES
|
||||
|
||||
#----------------------------
|
||||
# Build information
|
||||
#----------------------------
|
||||
TDE_RELEASE="14.1.0" # TDE release number
|
||||
DISTRO="debian" # Distro family
|
||||
DISTRO_NAME="buster" # Distro name of specific version
|
||||
ARCHITECTURE="amd64" # Build for this architecture
|
||||
USE_PREBUILD_EXTRA_DEPS="y" # If == "y", use pre-built extra dependency packages
|
||||
BUILD_DEFAULT_OPTIONS="-g -lr" # Default building options (pbuilder)
|
||||
GPG_SIGN_KEYID="" # Use this GPG key to sign packages. If null, packages will not be signed
|
||||
|
||||
#----------------------------
|
||||
# Base directories
|
||||
#----------------------------
|
||||
CFG_SCRIPT_LOG_DIR="0_logs"
|
||||
CFG_GIT_DIR="1_git"
|
||||
CFG_BUILD_DIR="2_build"
|
||||
CFG_REPO_DIR="3_repo"
|
||||
CFG_EXTRA_DEPS_DIR="edeps" # Relative to CFG_GIT_DIR folder
|
||||
CFG_HOOKS_DIR="hooks" # Relative to CFG_GIT_DIR folder
|
||||
|
||||
set +a
|
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# List of repositories for extra dependency packages
|
||||
EDEPS_REPO="
|
||||
master http://mirror.xcer.cz/trinity-tb deps
|
||||
r14.0.x http://mirror.xcer.cz/trinity-sb deps-r14
|
||||
"
|
@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./internals/_build_set_common.sh
|
||||
|
||||
#----------------------------
|
||||
set_log_start
|
||||
|
||||
build_module "dependencies/libr"
|
||||
build_module "edeps/gettext-kde"
|
||||
build_module "dependencies/akode"
|
||||
build_module "edeps/fireflies"
|
||||
build_module "edeps/imlib"
|
||||
build_module "edeps/opensync"
|
||||
build_module "edeps/libbeagle"
|
||||
build_module "edeps/pcsc-lite-nodbus"
|
||||
build_module "edeps/lcms"
|
||||
build_module "edeps/wv2"
|
||||
build_module "edeps/jasper"
|
||||
build_module "edeps/openslp-dfsg"
|
||||
|
||||
set_log_end
|
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./internals/_build_set_common.sh
|
||||
|
||||
#----------------------------
|
||||
set_log_start
|
||||
|
||||
build_module "tde-i18n"
|
||||
build_module "edeps/compiz-trinity"
|
||||
build_module "edeps/libcompizconfig-trinity"
|
||||
build_module "edeps/compiz-fusion-bcop-trinity"
|
||||
build_module "edeps/compiz-fusion-plugins-main-trinity"
|
||||
build_module "edeps/compiz-fusion-plugins-extra-trinity"
|
||||
build_module "edeps/compizconfig-python-trinity"
|
||||
build_module "applications/compizconfig-backend-tdeconfig"
|
||||
|
||||
set_log_end
|
@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
./00_extradeps.sh
|
||||
./01_base_01.sh
|
||||
./02_base_02.sh
|
||||
./03_base_03.sh
|
@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
./09_others_01.sh
|
||||
./10_others_02.sh
|
@ -1,89 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load common code and initialization
|
||||
. ./internals/_build_common.sh
|
||||
init_common
|
||||
|
||||
_BUILDALL_TIMER=2
|
||||
_BUILDALL_TIME="--/--:--:--:---"
|
||||
|
||||
parm_SKIP_FETCH="n" # if "y" skips N packages from the list
|
||||
parm_SKIP_N=0 # this argument represents the number of packages to skip
|
||||
SKIP_cnt=0
|
||||
|
||||
|
||||
#----------------------------
|
||||
# do_exit for set building
|
||||
function do_exit()
|
||||
{
|
||||
cd "$SCRIPT_DIR"
|
||||
if [ $1 -eq 0 ]; then
|
||||
echo -e "${CGray}#### Building process for TDE completed ####${CNone}"
|
||||
else
|
||||
echo -e "${CGray}#### Building process for TDE interrupted ($1) ####${CNone}"
|
||||
fi
|
||||
exit $1
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
function set_log_start()
|
||||
{
|
||||
echo -e "${CGray}#### Starting building process for TDE ####${CNone}"
|
||||
echo
|
||||
echo "********** TDE **********" >>"$LOG_RESULT_FILENAME"
|
||||
exec_time_start $_BUILDALL_TIMER
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
function set_log_end()
|
||||
{
|
||||
exec_time_stop $_BUILDALL_TIMER "_BUILDALL_TIME"
|
||||
echo " [$_BUILDALL_TIME] All TDE " >>"$LOG_RESULT_FILENAME"
|
||||
echo >>"$LOG_RESULT_FILENAME"
|
||||
do_exit 0
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
function build_set()
|
||||
{
|
||||
if [ $parm_SKIP_N -gt 0 -a $SKIP_cnt -lt $parm_SKIP_N ]; then
|
||||
SKIP_cnt=$((SKIP_cnt+1))
|
||||
else
|
||||
./build_module.sh -g -lr "$@"
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Check command line arguments
|
||||
#----------------------------
|
||||
for arg in $@; do
|
||||
if [ "$parm_SKIP_FETCH" = "y" ]; then
|
||||
parm_SKIP_N=$arg
|
||||
parm_SKIP_FETCH="n"
|
||||
elif [ "$arg" = "-s" ]; then # skip first N packages
|
||||
parm_SKIP_FETCH="y"
|
||||
fi
|
||||
done
|
||||
if [ "$parm_SKIP_FETCH" = "y" ]; then
|
||||
echo "Invalid command line arguments ($@)"
|
||||
do_exit 3
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Build TDE
|
||||
#----------------------------
|
||||
set_log_start
|
||||
for setname in `find . -maxdepth 1 -type f -iname '[01]*' | sort`; do
|
||||
if [ $parm_SKIP_N -gt 0 -a $SKIP_cnt -lt $parm_SKIP_N ]; then
|
||||
SKIP_cnt=$((SKIP_cnt+1))
|
||||
else
|
||||
$setname
|
||||
fi
|
||||
done
|
||||
set_log_end
|
@ -1,162 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
#----------------------------
|
||||
#----------------------------
|
||||
# Color table
|
||||
# Black 0;30 Dark Gray 1;30
|
||||
# Blue 0;34 Light Blue 1;34
|
||||
# Green 0;32 Light Green 1;32
|
||||
# Cyan 0;36 Light Cyan 1;36
|
||||
# Red 0;31 Light Red 1;31
|
||||
# Purple 0;35 Light Purple 1;35
|
||||
# Brown 0;33 Yellow 1;33
|
||||
# Light Gray 0;37 White 1;37
|
||||
# No Color 0
|
||||
set -a
|
||||
CBlack='\e[0;30m'
|
||||
CDarkGray='\e[1;30m'
|
||||
CBlue='\e[0;34m'
|
||||
CLightBlue='\e[1;34m'
|
||||
CGreen='\e[0;32m'
|
||||
CLightGreen='\e[1;32m'
|
||||
CCyan='\e[0;36m'
|
||||
CLightCyan='\e[1;36m'
|
||||
CRed='\e[0;31m'
|
||||
CLightRed='\e[1;31m'
|
||||
CPurple='\e[0;35m'
|
||||
CLightPurple='\e[1;35m'
|
||||
CBrown='\e[0;33m'
|
||||
CYellow='\e[1;33m'
|
||||
CGray='\e[0;37m'
|
||||
CWhite='\e[1;37m'
|
||||
CNone='\e[0m'
|
||||
set +a
|
||||
|
||||
#----------------------------
|
||||
function init_common()
|
||||
{
|
||||
# Check script folder
|
||||
export SCRIPT_DIR=$(dirname $(readlink -f "$0"))
|
||||
|
||||
# Prevent the script to be run from TDE packaging repo
|
||||
REPO_URL=$(git config --get remote.origin.url 2>/dev/null)
|
||||
if [ ! -z "$REPO_URL" ] && [ -z "${REPO_URL##*tde-packaging}" ]; then
|
||||
echo -e "${CYellow} --- ERROR ---${CNone}"
|
||||
echo "This script cannot be run from the TDE packaging repository."
|
||||
echo "Please follow the instructions provided, then rerun this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Read config settings
|
||||
CFG_FILE=$SCRIPT_DIR/_config.sh
|
||||
if [ -f "$CFG_FILE" ]; then
|
||||
. "$CFG_FILE"
|
||||
else
|
||||
echo -e "${CYellow} --- NOTE ---${CNone}"
|
||||
echo "Creating TDE build configuration file from template as $CFG_FILE."
|
||||
echo "Please check and modify as required, then rerun this script."
|
||||
cp "$SCRIPT_DIR/internals/_config_template.sh" "$CFG_FILE"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# TDE root folder must exist
|
||||
if [ ! -d "$TDE_DIR" ]; then
|
||||
echo -e "${CYellow} --- ERROR ---${CNone}"
|
||||
echo "A valid TDE root folder could not be located. Something is wrong with your configuration"
|
||||
echo "in the config file $CFG_FILE"
|
||||
echo "Please check and modify the TDE_DIR variable as required, then rerun this script."
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# Search for main TDE repo
|
||||
cd "$TDE_DIR/$CFG_GIT_TDE_MAIN" &>/dev/null
|
||||
CURR_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
if [ -z "$CURR_DIR" ]; then
|
||||
echo -e "${CYellow} --- ERROR ---${CNone}"
|
||||
echo "Main TDE repo could not be located. Something is wrong with your configuration"
|
||||
echo "in the config file $CFG_FILE"
|
||||
echo "Please check and modify the TDE_DIR variable as required, then rerun this script."
|
||||
exit 4
|
||||
fi
|
||||
|
||||
# Search for TDE packaging repo
|
||||
cd "$TDE_DIR/$CFG_GIT_TDE_PACKAGING" &>/dev/null
|
||||
CURR_DIR=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
if [ -z "$CURR_DIR" ]; then
|
||||
echo -e "${CYellow} --- ERROR ---${CNone}"
|
||||
echo "TDE packaging repo could not be located. Something is wrong with your configuration"
|
||||
echo "in the config file $CFG_FILE"
|
||||
echo "Please check and modify the TDE_DIR variable as required, then rerun this script."
|
||||
exit 5
|
||||
fi
|
||||
|
||||
# Make sure we have selected a supported distribution
|
||||
DISTS_FILE=$SCRIPT_DIR/internals/distro_list.txt
|
||||
if [ ! -f "$DISTS_FILE" ]; then
|
||||
echo -e "${CYellow} --- NOTE ---${CNone}"
|
||||
echo "Could not find the list of supported distributions."
|
||||
echo "Please check the file $DISTS_FILE exists, then rerun this script."
|
||||
exit 6
|
||||
fi
|
||||
export DISTRO_FOUND=${DISTRO_FOUND:-"n"}
|
||||
if [ "$DISTRO_FOUND" != "y" ]; then
|
||||
# Need to use a "here string" otherwise if the DISTRO_FOUND value is modified
|
||||
# inside the while loop, this would not remember after the loop.
|
||||
while read l_distro l_version l_name l_rel_suffix; do
|
||||
if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then
|
||||
export DISTRO_FOUND="y"
|
||||
export DISTRO_VERSION="$l_version"
|
||||
export REL_SUFFIX="$l_rel_suffix"
|
||||
break
|
||||
fi
|
||||
done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$")
|
||||
fi
|
||||
if [ "$DISTRO_FOUND" != "y" ]; then
|
||||
echo -e "${CYellow} --- NOTE ---${CNone}"
|
||||
echo "The specified distribution ($DISTRO $DISTRO_NAME) is not supported."
|
||||
echo "Something is wrong with your configuration ($CFG_FILE)"
|
||||
echo "or with the list of supported distributions ($DISTS_FILE)."
|
||||
echo "Please check the DISTRO and DISTRO_NAME variables, then rerun this script."
|
||||
exit 7
|
||||
fi
|
||||
|
||||
export SCRIPT_LOG_DIR=$TDE_DIR/$CFG_SCRIPT_LOG_DIR
|
||||
export LOG_RESULT_FILENAME="$SCRIPT_LOG_DIR/build_result.log" # Log result into the common build logfile
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Save execution start time
|
||||
# Parameters:
|
||||
# $1 - timer number
|
||||
function exec_time_start()
|
||||
{
|
||||
_ET_start_var="_ET_start_$1"
|
||||
eval "$_ET_start_var=`date +%s.%N`"
|
||||
}
|
||||
|
||||
|
||||
#----------------------------
|
||||
# Save execution stop time and set $2 to the execution time
|
||||
# in the format: dd/hh:mm:ss.mmm
|
||||
# Parameters:
|
||||
# $1 - timer number
|
||||
# $2 - result variable name
|
||||
function exec_time_stop()
|
||||
{
|
||||
_ET_start_var="_ET_start_$1"
|
||||
_ET_stop_var="_ET_stop_$1"
|
||||
eval "$_ET_stop_var=`date +%s.%N`"
|
||||
_ET_diff=`echo "${!_ET_stop_var} - ${!_ET_start_var}" | bc`
|
||||
_ET_days=`echo "$_ET_diff/86400" | bc`
|
||||
_ET_diff_day=`echo "$_ET_diff-86400*$_ET_days" | bc`
|
||||
_ET_hours=`echo "$_ET_diff_day/3600" | bc`
|
||||
_ET_diff_hour=`echo "$_ET_diff_day-3600*$_ET_hours" | bc`
|
||||
_ET_mins=`echo "$_ET_diff_hour/60" | bc`
|
||||
_ET_secs=`echo "$_ET_diff_hour-60*$_ET_mins" | bc`
|
||||
local _resultvar=$2
|
||||
eval "$_resultvar=`printf \"%02d/%02d:%02d:%06.3f\" $_ET_days $_ET_hours $_ET_mins $_ET_secs`"
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -a
|
||||
|
||||
#----------------------------
|
||||
# Build information
|
||||
#----------------------------
|
||||
TDE_RELEASE="14.1.0" # TDE release number
|
||||
DISTRO="debian" # Distro family
|
||||
DISTRO_NAME="buster" # Distro name of specific version
|
||||
ARCHITECTURE="amd64" # Build for this architecture
|
||||
USE_LOCAL_BUILD_NUMBER="n" # If == "y", use local build numbering for modules
|
||||
BUILD_NUMBER="b001" # TDE build number
|
||||
BUILD_DATE="" # Module build date (automatic if "" or fixed otherwise, ex 20171201)
|
||||
BUILD_DEFAULT_OPTIONS="-g -lr" # Default building options (pbuilder)
|
||||
GPG_SIGN_KEYID="" # Use this GPG key to sign packages. If null, packages will not be signed
|
||||
|
||||
#----------------------------
|
||||
# Base directories
|
||||
#----------------------------
|
||||
# TDE root folder
|
||||
TDE_DIR=""
|
||||
# Relative paths
|
||||
CFG_SCRIPT_LOG_DIR="0_logs"
|
||||
CFG_GIT_DIR="1_git"
|
||||
CFG_BUILD_DIR="2_build"
|
||||
CFG_REPO_DIR="3_repo"
|
||||
CFG_EXTRA_DEPS_DIR="edeps" # Relative to CFG_GIT_DIR folder
|
||||
CFG_HOOKS_DIR="hooks" # Relative to CFG_GIT_DIR folder
|
||||
# Composite paths
|
||||
CFG_GIT_TDE_MAIN="$CFG_GIT_DIR/tde/main"
|
||||
CFG_GIT_TDE_PACKAGING="$CFG_GIT_DIR/tde-packaging/$DISTRO/$DISTRO_NAME"
|
||||
CFG_GIT_EXTRA_DEPENDENCIES="$CFG_GIT_DIR/$CFG_EXTRA_DEPS_DIR"
|
||||
CFG_HOOK_DIR="$CFG_GIT_DIR/$CFG_HOOKS_DIR"
|
||||
|
||||
#----------------------------
|
||||
# Build output directories
|
||||
#----------------------------
|
||||
CFG_TDE_BUILD_DIR="$CFG_BUILD_DIR/build"
|
||||
CFG_TDE_DEBS_DIR="$CFG_BUILD_DIR/debs"
|
||||
|
||||
#----------------------------
|
||||
set +a
|
@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#----------------------------
|
||||
# Update TDE main repository
|
||||
echo -e "\n---- Updating main TDE GIT repo ----\n"
|
||||
|
||||
cd "$TDE_DIR/$CFG_GIT_DIR/tde"
|
||||
if [[ ! -e .git ]] || [[ -z "`git rev-parse --git-dir 2>/dev/null`" ]]; then
|
||||
echo "Current directory does not contain a .git folder. Exiting..."
|
||||
cd $SCRIPT_DIR
|
||||
exit 1
|
||||
fi
|
||||
|
||||
branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"`
|
||||
if [[ -z "$branch" ]] || [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then
|
||||
echo "There is not active upstream branch. Exiting..."
|
||||
cd $SCRIPT_DIR
|
||||
exit 1
|
||||
fi
|
||||
|
||||
touch /var/lock/update-tde-git-submodules
|
||||
|
||||
PARENTDIR=$PWD
|
||||
echo "---- Main repo ----"
|
||||
git pull --rebase
|
||||
if [[ ! -z "`git status --porcelain --ignore-submodules`" ]]; then
|
||||
git reset --hard HEAD
|
||||
git clean -dxff
|
||||
fi
|
||||
|
||||
exec 3< submodules
|
||||
while read <&3
|
||||
do
|
||||
cd $PARENTDIR
|
||||
DIR2UPDATE=$REPLY
|
||||
if [[ $DIR2UPDATE != "" ]]; then
|
||||
echo -e "\n---- Submodule $DIR2UPDATE ----"
|
||||
cd $PARENTDIR/$DIR2UPDATE/..
|
||||
cd `git rev-parse --show-toplevel`
|
||||
if [[ -z "`grep \"^Updated: $PWD$\" /var/lock/update-tde-git-submodules`" ]]; then
|
||||
echo "Updated: $PWD" >>/var/lock/update-tde-git-submodules
|
||||
git submodule init
|
||||
git submodule update
|
||||
fi
|
||||
cd $PARENTDIR/$DIR2UPDATE
|
||||
if [[ ! -z "`git status --porcelain --ignore-submodules`" ]]; then
|
||||
git reset --hard HEAD
|
||||
git clean -dxff
|
||||
fi
|
||||
git checkout $branch
|
||||
git pull --rebase
|
||||
cd ..
|
||||
cd `git rev-parse --show-toplevel`
|
||||
fi
|
||||
done
|
||||
exec 3>&-
|
||||
|
||||
rm /var/lock/update-tde-git-submodules
|
||||
|
||||
|
||||
#------------------------------
|
||||
# Update TDE-packaging repository
|
||||
echo -e "\n----------------------------------------"
|
||||
echo -e "\n--- Updating TDE-packaging GIT repo ----\n"
|
||||
|
||||
cd "$TDE_DIR/$CFG_GIT_DIR/tde-packaging"
|
||||
git pull --rebase
|
||||
|
||||
|
||||
#------------------------------
|
||||
# Done
|
||||
cd $SCRIPT_DIR
|
@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load common code
|
||||
. ./internals/_build_common.sh
|
||||
init_common
|
||||
|
||||
#----------------------------
|
||||
# Run real update script
|
||||
if [ ! -d "$SCRIPT_LOG_DIR" ]; then
|
||||
echo -e "\"$SCRIPT_LOG_DIR\" folder is missing. Check your config or create it."
|
||||
exit 1
|
||||
fi
|
||||
echo "Update in progress..."
|
||||
. ./internals/_update_repositories.sh &>"$SCRIPT_LOG_DIR/update-repos.log"
|
||||
echo "Update completed."
|
||||
|
@ -0,0 +1,188 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load common code
|
||||
. ./internals/_build_common.sh
|
||||
init_common
|
||||
|
||||
UPDATE_LOCK_FILENAME="/var/lock/TDE_update_repo_lock" # Lock file for incremental update
|
||||
|
||||
#----------------------------
|
||||
# Update a given module from the upstream repo
|
||||
# Parameters:
|
||||
# $1 - module folder
|
||||
# $2 - operation type
|
||||
# $3 - branch to update
|
||||
function _do_update()
|
||||
{
|
||||
local MOD_PATH=$1
|
||||
local OP_TYPE=$2
|
||||
local BRANCH=$3
|
||||
local RESULT=""
|
||||
|
||||
case "$OP_TYPE" in
|
||||
"update")
|
||||
if [[ -z `grep "^$BRANCH - $MOD_PATH$" "$UPDATE_LOCK_FILENAME"` ]]; then
|
||||
cd "$MOD_PATH" &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
# Clean up any possible uncommitted changes
|
||||
if [[ ! -z "`git status --porcelain $GIT_IGNORE_SUBMODULES`" ]]; then
|
||||
git reset --hard HEAD &>/dev/null
|
||||
git clean -dxff &>/dev/null
|
||||
fi
|
||||
# Make sure the local branch exists and is a tracking branch
|
||||
if [[ -z `git branch | grep -E "\b$BRANCH\b"` ]]; then
|
||||
eval git checkout -b \"$BRANCH\" \"origin/$BRANCH\" $OPT_VERBOSE_LOG
|
||||
else
|
||||
eval git checkout \"$BRANCH\" $OPT_VERBOSE_LOG
|
||||
fi
|
||||
if [[ ! -z `git branch -v | grep -E "^\*\s+$BRANCH"` ]]; then
|
||||
if [[ -z `git branch -vv | grep "origin/$BRANCH"` ]]; then
|
||||
git branch -u "origin/$BRANCH" &>/dev/null #$
|
||||
git reset --hard "origin/$BRANCH" &>/dev/null
|
||||
fi
|
||||
fi
|
||||
# Update
|
||||
eval git reset --hard HEAD $OPT_VERBOSE_LOG
|
||||
eval git clean -dxff $OPT_VERBOSE_LOG
|
||||
eval git fetch $OPT_VERBOSE_LOG
|
||||
if [[ $(git rev-parse HEAD) != $(git rev-parse "origin/$BRANCH") ]]; then
|
||||
eval git pull --rebase $GIT_NO_RECURSE_SUBMODULES $OPT_VERBOSE_LOG
|
||||
if [[ `git rev-parse HEAD` == `git rev-parse "origin/$BRANCH"` ]]; then
|
||||
RESULT="${CLightGreen}[ UPDATE ]"
|
||||
else
|
||||
RESULT="${CLightRed}[ FAIL ]"
|
||||
fi
|
||||
else
|
||||
RESULT="[ OK ]"
|
||||
fi
|
||||
else
|
||||
RESULT="${CLightRed}[ FAIL ]"
|
||||
fi
|
||||
echo "$BRANCH - $MOD_PATH" >> "$UPDATE_LOCK_FILENAME"
|
||||
else
|
||||
RESULT="${CBrown}[ SKIP ]"
|
||||
fi
|
||||
;;
|
||||
|
||||
"switch-to")
|
||||
cd "$MOD_PATH" &>/dev/null
|
||||
eval git checkout \"$BRANCH\" $OPT_VERBOSE_LOG
|
||||
if [[ ! -z `git branch -v | grep -E "^\*\s+$BRANCH"` ]]; then
|
||||
RESULT="[ OK ]"
|
||||
else
|
||||
RESULT="${CLightRed}[ FAIL ]"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
RESULT="[ INV-OP ]"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo_and_tee "$RESULT $MOD_PATH${CNone}" "$LOG_UPDATE_REPO_FILENAME"
|
||||
}
|
||||
|
||||
#----------------------------
|
||||
# Update a given module and all submodules from the upstream repo
|
||||
# Parameters:
|
||||
# $1 - module folder
|
||||
# $2 - operation type
|
||||
# $3 - branch to update
|
||||
function _update_module()
|
||||
{
|
||||
local MOD_PATH=$1
|
||||
local OP_TYPE=$2
|
||||
local BRANCH=$3
|
||||
# Current module
|
||||
_do_update "$@"
|
||||
# Submodules
|
||||
local SUBMOD_LIST="$MOD_PATH/.gitmodules"
|
||||
if [[ -e "$SUBMOD_LIST" ]]; then
|
||||
sed -n "s|^\[submodule \"\([^\"]*\)\"\]$|\1|p" <$SUBMOD_LIST |\
|
||||
while read -r SUBMOD_PATH; do
|
||||
cd "$MOD_PATH" &>/dev/null
|
||||
if [[ -z "`git config --get submodule.$SUBMOD_PATH.url`" ]]; then
|
||||
eval git submodule init -- \"$SUBMOD_PATH\" $OPT_VERBOSE_LOG
|
||||
fi
|
||||
if [[ ! -e "$MOD_PATH/$SUBMOD_PATH/.git" ]]; then
|
||||
eval git submodule update -- \"$SUBMOD_PATH\" $OPT_VERBOSE_LOG
|
||||
fi
|
||||
_update_module "$MOD_PATH/$SUBMOD_PATH" "$OP_TYPE" "$BRANCH"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
#----------------------------
|
||||
# Check command line arguments and set options
|
||||
bool_INCREMENTAL="n"
|
||||
bool_VERBOSE_LOG="n"
|
||||
for arg in $@; do
|
||||
if [ "$arg" = "-i" ]; then # continue from last updated module (Incremental)
|
||||
bool_INCREMENTAL="y"
|
||||
elif [ "$arg" = "-v" ]; then # display and log git command output
|
||||
bool_VERBOSE_LOG="y"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$bool_INCREMENTAL" = "y" ]; then
|
||||
[ ! -f "$UPDATE_LOCK_FILENAME" ] && bool_INCREMENTAL="n"
|
||||
else
|
||||
[ -f "$UPDATE_LOCK_FILENAME" ] && rm "$UPDATE_LOCK_FILENAME"
|
||||
fi
|
||||
|
||||
OPT_VERBOSE_LOG="&>/dev/null"
|
||||
if [[ "$bool_VERBOSE_LOG" = "y" ]]; then
|
||||
OPT_VERBOSE_LOG=" |& tee -a \"$LOG_UPDATE_REPO_FILENAME\""
|
||||
fi
|
||||
|
||||
#----------------------------
|
||||
# Check git abilities
|
||||
GIT_IGNORE_SUBMODULES=""
|
||||
if [[ -n "`git status --help 2>/dev/null|grep -- '--ignore-submodules'`" ]]; then
|
||||
GIT_IGNORE_SUBMODULES="--ignore-submodules"
|
||||
fi
|
||||
GIT_NO_RECURSE_SUBMODULES=""
|
||||
if [[ -n "`git pull --help |grep -- '--\[no-\]recurse-submodules'`" ]]; then
|
||||
GIT_NO_RECURSE_SUBMODULES="--no-recurse-submodules"
|
||||
fi
|
||||
|
||||
# Start update
|
||||
if [ "$bool_INCREMENTAL" != "y" ]; then
|
||||
echo "TDE repositories update started" > "$UPDATE_LOCK_FILENAME"
|
||||
fi
|
||||
|
||||
# Branch update
|
||||
_LAST_BRANCH=""
|
||||
for branch in "${BRANCHES[@]}"; do
|
||||
_LAST_BRANCH="$branch"
|
||||
echo_and_tee "${CLightCyan}---------------------------------------${CNone}" "$LOG_UPDATE_REPO_FILENAME" "y"
|
||||
echo_and_tee "${CLightCyan} Updating branch ${CYellow}$branch ${CNone}" "$LOG_UPDATE_REPO_FILENAME"
|
||||
echo_and_tee "${CLightCyan}---------------------------------------${CNone}" "$LOG_UPDATE_REPO_FILENAME"
|
||||
|
||||
# Update TDE main repository
|
||||
_update_module "$REPO_TDE" "update" "$branch"
|
||||
|
||||
# Update TDE packaging repository
|
||||
_update_module "$TDE_DIR/$CFG_GIT_DIR/tde-packaging" "update" "$branch"
|
||||
|
||||
echo_and_tee "" "$LOG_UPDATE_REPO_FILENAME"
|
||||
done
|
||||
|
||||
# Switch to specified branch if necessary
|
||||
if [[ "$DEFAULT_REPO_BRANCH" != "$_LAST_BRANCH" ]]; then
|
||||
echo_and_tee "${CLightCyan}---------------------------------------${CNone}" "$LOG_UPDATE_REPO_FILENAME" "y"
|
||||
echo_and_tee "${CLightCyan} Switching to branch ${CYellow}$DEFAULT_REPO_BRANCH ${CNone}" "$LOG_UPDATE_REPO_FILENAME"
|
||||
echo_and_tee "${CLightCyan}---------------------------------------${CNone}" "$LOG_UPDATE_REPO_FILENAME"
|
||||
|
||||
# Switch TDE main repository
|
||||
_update_module "$REPO_TDE" "switch-to" "$DEFAULT_REPO_BRANCH"
|
||||
|
||||
# Switch TDE packaging repository
|
||||
_update_module "$TDE_DIR/$CFG_GIT_DIR/tde-packaging" "switch-to" "$DEFAULT_REPO_BRANCH"
|
||||
|
||||
echo_and_tee "" "$LOG_UPDATE_REPO_FILENAME"
|
||||
fi
|
||||
|
||||
# Update completed
|
||||
[ -f "$UPDATE_LOCK_FILENAME" ] && rm "$UPDATE_LOCK_FILENAME"
|
||||
cd $SCRIPT_DIR
|
Loading…
Reference in new issue