<commit_before>#!/bin/sh

# This file fixes the permissions of the home directory so that it matches the host user's ID.
# It also enables multicast and changes directories before executing the input from docker run.

# Adapted from: http://chapeau.freevariable.com/2014/08/docker-uid.html

export ORIGPASSWD=$(cat /etc/passwd | grep <PASSWORD>)
export ORIG_UID=$(echo $ORIGPASSWD | cut -f3 -d:)
export ORIG_GID=$(echo $ORIGPASSWD | cut -f4 -d:)

export UID=${UID:=$ORIG_UID}
export GID=${GID:=$ORIG_GID}

ORIG_HOME=$(echo $ORIGPASSWD | cut -f6 -d:)

echo "Fixing permissions..."
sed -i -e "s/:$ORIG_UID:$ORIG_GID:/:$UID:$GID:/" /etc/passwd
sed -i -e "s/rosbuild:x:$ORIG_GID:/rosbuild:x:$GID:/" /etc/group

chown -R ${UID}:${GID} "${ORIG_HOME}"
echo "done."

echo "Enabling multicast..."
ifconfig eth0 multicast
echo "done."

if [ "$CI_USE_CONNEXT" = "true" ]; then
  echo "Installing Connext..."
  dpkg -i /tmp/librticonnextdds51_5.1.0-4_amd64.deb
  dpkg -i /tmp/librticonnextdds51-dev_5.1.0-4_amd64.deb
  dpkg -i /tmp/rticonnextdds-tools_5.1.0-4_amd64.deb
  dpkg -i /tmp/librticonnextdds-messaging51_5.1.0-3_amd64.deb
  dpkg -i /tmp/librticonnextdds-messaging51-dev_5.1.0-3_amd64.deb
  echo "done."
else
  echo "NOT installing Connext."
fi

cd /home/rosbuild/ci_scripts

exec sudo -H -u rosbuild -E -- /bin/sh -c "$*"<commit_msg>fix CI_USE_CONNEXT<commit_after>#!/bin/sh

# This file fixes the permissions of the home directory so that it matches the host user's ID.
# It also enables multicast and changes directories before executing the input from docker run.

# Adapted from: http://chapeau.freevariable.com/2014/08/docker-uid.html

export ORIGPASSWD=$(cat /etc/passwd | grep <PASSWORD>)
export ORIG_UID=$(echo $ORIGPASSWD | cut -f3 -d:)
export ORIG_GID=$(echo $ORIGPASSWD | cut -f4 -d:)

export UID=${UID:=$ORIG_UID}
export GID=${GID:=$ORIG_GID}

ORIG_HOME=$(echo $ORIGPASSWD | cut -f6 -d:)

echo "Fixing permissions..."
sed -i -e "s/:$ORIG_UID:$ORIG_GID:/:$UID:$GID:/" /etc/passwd
sed -i -e "s/rosbuild:x:$ORIG_GID:/rosbuild:x:$GID:/" /etc/group

chown -R ${UID}:${GID} "${ORIG_HOME}"
echo "done."

echo "Enabling multicast..."
ifconfig eth0 multicast
echo "done."

case "${CI_ARGS}" in
  *--connext*)
    echo "Installing Connext..."
    dpkg -i /tmp/librticonnextdds51_5.1.0-4_amd64.deb
    dpkg -i /tmp/librticonnextdds51-dev_5.1.0-4_amd64.deb
    dpkg -i /tmp/rticonnextdds-tools_5.1.0-4_amd64.deb
    dpkg -i /tmp/librticonnextdds-messaging51_5.1.0-3_amd64.deb
    dpkg -i /tmp/librticonnextdds-messaging51-dev_5.1.0-3_amd64.deb
    echo "done."
    ;;
  *)
    echo "NOT installing Connext."
    ;;
esac

cd /home/rosbuild/ci_scripts

exec sudo -H -u rosbuild -E -- /bin/sh -c "$*"
{'fraction_non_alphanumeric': 0.1614100185528757, 'fraction_numerical': 0.03562152133580705, 'mean_word_length': 3.7886323268206037, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1197226', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1106, 'n_words': 256}