#!/usr/bin/env bash
set -euo pipefail

root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)
manifest="${root}/dependencies/dependencies.txt"

test -f "${manifest}"

required_entries=(
  "Ubuntu 22.04"
  "ROS2 Humble"
  "ament_cmake"
  "ament_cmake_gtest"
  "rclcpp"
  "rosidl_default_generators"
  "rosidl_default_runtime"
  "launch_ros"
  "build-essential"
  "file"
  "libcurl4-openssl-dev"
  "nlohmann-json3-dev"
  "Bun 1.3.14"
  "MTranServer 4.0.33"
  "f5672a9"
  "records.json"
  "en -> zh-Hans"
  "decompressedHash"
  "auto_install.sh does not install ROS2"
  "colcon build is run by the user"
)

for required in "${required_entries[@]}"; do
  grep -Fq "${required}" "${manifest}"
done
