Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder the tue-install-impl. All main after the functions #748

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.25.13
1.25.14
58 changes: 28 additions & 30 deletions installer/tue-install-impl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,11 @@ function _function_test
# shellcheck disable=SC2048
for func in $*
do
declare -f "$func" > /dev/null || { echo -e "\e[38;1mFunction '$func' missing, resource the setup\e[0m" && function_missing="true"; }
declare -f "${func}" > /dev/null || { tue-install-tee "\e[38;1mFunction '${func}' missing, resource the setup\e[0m" && function_missing="true"; }
done
[[ "$function_missing" == "true" ]] && exit 1
[[ "${function_missing}" == "true" ]] && exit 1
}

_function_test _git_https_or_ssh _git_url_to_repos_dir

TUE_INSTALL_DEPENDENCIES_DIR=$TUE_ENV_DIR/.env/dependencies
TUE_INSTALL_DEPENDENCIES_ON_DIR=$TUE_ENV_DIR/.env/dependencies-on
TUE_INSTALL_INSTALLED_DIR=$TUE_ENV_DIR/.env/installed

mkdir -p "$TUE_INSTALL_DEPENDENCIES_DIR"
mkdir -p "$TUE_INSTALL_DEPENDENCIES_ON_DIR"
mkdir -p "$TUE_INSTALL_INSTALLED_DIR"

TUE_INSTALL_TARGETS_DIR=$TUE_ENV_TARGETS_DIR

TUE_APT_GET_UPDATED_FILE=/tmp/tue_get_apt_get_updated

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

function date_stamp
Expand Down Expand Up @@ -973,11 +959,11 @@ function tue-install-system-now
((i=i+1))
done

if [ ! -f "$TUE_APT_GET_UPDATED_FILE" ]
if [[ ! -f "${TUE_APT_GET_UPDATED_FILE}" ]]
then
# Update once every boot. Or delete the tmp file if you need an update before installing a pkg.
tue-install-pipe sudo apt-get update || tue-install-error "An error occurred while updating apt-get."
touch $TUE_APT_GET_UPDATED_FILE
touch "${TUE_APT_GET_UPDATED_FILE}"
fi

# shellcheck disable=SC2086
Expand All @@ -992,7 +978,7 @@ function tue-install-apt-get-update
{
tue-install-debug "tue-install-apt-get-update"
tue-install-debug "Requiring an update of apt-get before next 'apt-get install'"
rm -f $TUE_APT_GET_UPDATED_FILE
rm -f "${TUE_APT_GET_UPDATED_FILE}"
}

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Expand Down Expand Up @@ -1729,29 +1715,41 @@ do
shift
done


# Create log file
stamp=$(date_stamp)
INSTALL_DETAILS_FILE=/tmp/tue-get-details-$stamp
touch "$INSTALL_DETAILS_FILE"

# Initialize
ROS_PACKAGE_INSTALL_DIR=$TUE_SYSTEM_DIR/src
# Check if the required functions are available
_function_test _git_https_or_ssh _git_url_to_repos_dir

TUE_INSTALL_SCRIPTS_DIR=$TUE_DIR/installer
# Set the directory/file variables
TUE_INSTALL_TARGETS_DIR=${TUE_ENV_TARGETS_DIR}
TUE_APT_GET_UPDATED_FILE=/tmp/tue_get_apt_get_updated
ROS_PACKAGE_INSTALL_DIR=${TUE_SYSTEM_DIR}/src
TUE_INSTALL_SCRIPTS_DIR=${TUE_DIR}/installer

TUE_INSTALL_GENERAL_STATE_DIR=/tmp/tue-installer
if [ ! -d $TUE_INSTALL_GENERAL_STATE_DIR ]
if [[ ! -d ${TUE_INSTALL_GENERAL_STATE_DIR} ]]
then
tue-install-debug "mkdir $TUE_INSTALL_GENERAL_STATE_DIR"
mkdir "$TUE_INSTALL_GENERAL_STATE_DIR"
tue-install-debug "chmod a+rwx $TUE_INSTALL_GENERAL_STATE_DIR"
chmod a+rwx "$TUE_INSTALL_GENERAL_STATE_DIR"
tue-install-debug "mkdir ${TUE_INSTALL_GENERAL_STATE_DIR}"
mkdir "${TUE_INSTALL_GENERAL_STATE_DIR}" # No parents, as it should already exist
tue-install-debug "chmod a+rwx ${TUE_INSTALL_GENERAL_STATE_DIR}"
chmod a+rwx "${TUE_INSTALL_GENERAL_STATE_DIR}"
fi

TUE_INSTALL_STATE_DIR=$TUE_INSTALL_GENERAL_STATE_DIR/$stamp
mkdir -p "$TUE_INSTALL_STATE_DIR"
TUE_INSTALL_STATE_DIR=$TUE_INSTALL_GENERAL_STATE_DIR/${stamp}
mkdir "${TUE_INSTALL_STATE_DIR}" # No parents, as it should already exist

# Make sure the environment state directories exists
TUE_INSTALL_DEPENDENCIES_DIR=${TUE_ENV_DIR}/.env/dependencies
TUE_INSTALL_DEPENDENCIES_ON_DIR=${TUE_ENV_DIR}/.env/dependencies-on
TUE_INSTALL_INSTALLED_DIR=${TUE_ENV_DIR}/.env/installed
mkdir -p "${TUE_INSTALL_DEPENDENCIES_DIR}"
mkdir -p "${TUE_INSTALL_DEPENDENCIES_ON_DIR}"
mkdir -p "${TUE_INSTALL_INSTALLED_DIR}"

# Initialize the installer variables
TUE_INSTALL_GIT_PULL_Q=()

TUE_INSTALL_SYSTEMS=
Expand Down