add package again

This commit is contained in:
Sem van der Hoeven
2023-04-19 10:14:50 +00:00
parent f6b74583c7
commit 35e28ca6d4
28 changed files with 1269 additions and 5 deletions

View File

@@ -27,5 +27,13 @@ _colcon_package_bash_source_script() {
# source sh script of this package
_colcon_package_bash_source_script "$_colcon_package_bash_COLCON_CURRENT_PREFIX/share/beacon_positioning/package.sh"
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced scripts
COLCON_CURRENT_PREFIX="$_colcon_package_bash_COLCON_CURRENT_PREFIX"
# source bash hooks
_colcon_package_bash_source_script "$COLCON_CURRENT_PREFIX/share/beacon_positioning/local_setup.bash"
unset COLCON_CURRENT_PREFIX
unset _colcon_package_bash_source_script
unset _colcon_package_bash_COLCON_CURRENT_PREFIX

View File

@@ -0,0 +1,5 @@
source;share/beacon_positioning/local_setup.bash
source;share/beacon_positioning/local_setup.dsv
source;share/beacon_positioning/local_setup.ps1
source;share/beacon_positioning/local_setup.sh
source;share/beacon_positioning/local_setup.zsh

View File

@@ -106,3 +106,10 @@ function colcon_package_source_powershell_script {
}
# a powershell script is able to determine its own path
# the prefix is two levels up from the package specific share directory
$env:COLCON_CURRENT_PREFIX=(Get-Item $PSCommandPath).Directory.Parent.Parent.FullName
colcon_package_source_powershell_script "$env:COLCON_CURRENT_PREFIX\share/beacon_positioning/local_setup.ps1"
Remove-Item Env:\COLCON_CURRENT_PREFIX

View File

@@ -49,4 +49,38 @@ _colcon_prepend_unique_value() {
unset _listname
}
# since a plain shell script can't determine its own path when being sourced
# either use the provided COLCON_CURRENT_PREFIX
# or fall back to the build time prefix (if it exists)
_colcon_package_sh_COLCON_CURRENT_PREFIX="/home/ubuntu/ros2_ws/install/beacon_positioning"
if [ -z "$COLCON_CURRENT_PREFIX" ]; then
if [ ! -d "$_colcon_package_sh_COLCON_CURRENT_PREFIX" ]; then
echo "The build time path \"$_colcon_package_sh_COLCON_CURRENT_PREFIX\" doesn't exist. Either source a script for a different shell or set the environment variable \"COLCON_CURRENT_PREFIX\" explicitly." 1>&2
unset _colcon_package_sh_COLCON_CURRENT_PREFIX
return 1
fi
COLCON_CURRENT_PREFIX="$_colcon_package_sh_COLCON_CURRENT_PREFIX"
fi
unset _colcon_package_sh_COLCON_CURRENT_PREFIX
# function to source another script with conditional trace output
# first argument: the path of the script
# additional arguments: arguments to the script
_colcon_package_sh_source_script() {
if [ -f "$1" ]; then
if [ -n "$COLCON_TRACE" ]; then
echo "# . \"$1\""
fi
. "$@"
else
echo "not found: \"$1\"" 1>&2
fi
}
# source sh hooks
_colcon_package_sh_source_script "$COLCON_CURRENT_PREFIX/share/beacon_positioning/local_setup.sh"
unset _colcon_package_sh_source_script
unset COLCON_CURRENT_PREFIX
# do not unset _colcon_prepend_unique_value since it might be used by non-primary shell hooks

View File

@@ -38,5 +38,13 @@ colcon_zsh_convert_to_array() {
_colcon_package_zsh_source_script "$_colcon_package_zsh_COLCON_CURRENT_PREFIX/share/beacon_positioning/package.sh"
unset convert_zsh_to_array
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced scripts
COLCON_CURRENT_PREFIX="$_colcon_package_zsh_COLCON_CURRENT_PREFIX"
# source zsh hooks
_colcon_package_zsh_source_script "$COLCON_CURRENT_PREFIX/share/beacon_positioning/local_setup.zsh"
unset COLCON_CURRENT_PREFIX
unset _colcon_package_zsh_source_script
unset _colcon_package_zsh_COLCON_CURRENT_PREFIX