Skip to content

Commit

Permalink
setup.bash: fix package exceptions, prevent sourcing of different pro…
Browse files Browse the repository at this point in the history
…files
  • Loading branch information
asherikov committed May 8, 2024
1 parent 83a4da0 commit 4403b61
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions profiles/build/common/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ WORKSPACE_DIR=${WORKSPACE_DIR:-"$(pwd)"}
BUILD_PROFILES_DIR=${BUILD_PROFILES_DIR:-"${WORKSPACE_DIR}/profiles/build"}
export WORKSPACE_DIR BUILD_PROFILES_DIR


if [ -z "${BUILD_PROFILE}" ]
then
echo "Profile is not defined"
Expand All @@ -16,6 +15,18 @@ else
export BUILD_PROFILE
fi

if [ -z "${SOURCED_BUILD_PROFILE}" ]
then
SOURCED_BUILD_PROFILE="${BUILD_PROFILE}"
export SOURCED_BUILD_PROFILE
else
if [ "${SOURCED_BUILD_PROFILE}" != "${BUILD_PROFILE}" ]
then
echo "CCWS: cannot source '${BUILD_PROFILE}' profile, '${SOURCED_BUILD_PROFILE}' is already in use."
return 0
fi
fi

if [ -z "${CCWS_ARTIFACTS_DIR}" ]
then
if [ -z "${ARTIFACTS_DIR}" ]
Expand Down Expand Up @@ -341,6 +352,11 @@ ccws_read_exceptions()

if [ -f "${FILE}" ]
then
sed -e 's=^=:${CCWS_SOURCE_DIR}/=' < "${FILE}" | tr -d '\n'
if [ "$1" = "paths" ]
then
sed -e 's=^=:${CCWS_SOURCE_DIR}/=' < "${FILE}" | tr -d '\n'
else
sed -e 's=^=:=' < "${FILE}" | tr -d '\n'
fi
fi
}
2 changes: 1 addition & 1 deletion profiles/build/deb/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BASE_BUILD_PROFILE=${1:-"$BASE_BUILD_PROFILE"}
if [ -z "${BASE_BUILD_PROFILE}" ]
then
echo "Build profile cannot be chosen automatically for 'deb' mixin, make sure BASE_BUILD_PROFILE is set."
false
return 0
fi


Expand Down

0 comments on commit 4403b61

Please sign in to comment.