#!/bin/bash

DIR="$1"
shift

for pkg in "$@"; do
    echo "Processing $DIR $pkg"
    export AMENT_PREFIX_PATH="$AMENT_PREFIX_PATH:$DIR/$pkg" && echo "$DIR/$pkg"
    export AMENT_PREFIX_PATH="$AMENT_PREFIX_PATH:$DIR/$pkg/lib/$pkg" && echo "$DIR/$pkg/lib/$pkg"
    export AMENT_PREFIX_PATH="$AMENT_PREFIX_PATH:$DIR/$pkg/share/$pkg" && echo "$DIR/$pkg/share/$pkg"
    export PYTHONPATH="$PYTHONPATH:$DIR/$pkg/local/lib/python3.10/dist-packages" && echo "$DIR/$pkg/local/lib/python3.10/dist-packages"
done