colliding file names - chunhualiao/public-docs GitHub Wiki

rose:colliding header files

cd /Users/liao6/workspace/rose || exit 1

# Temporary files
ALL_HEADERS="all_headers.txt"
COLLIDING_NAMES="colliding_names.txt"
REPORT="collision_report.txt"

# Step 1: Find all .h and .hpp files
find . -type f \( -iname "*.h" -o -iname "*.hpp" \) > "$ALL_HEADERS"

# Step 2: Get lowercase base names of all headers
awk -F/ '{print tolower($NF)}' "$ALL_HEADERS" | sort | uniq -d > "$COLLIDING_NAMES"

# Step 3: Print colliding groups and output to report
{
  echo "==== Case-insensitive filename collisions detected ===="
  while read -r name; do
    echo ""
    echo "⚠️ Collision for filename (case-insensitive): $name"
    grep -i "/$name$" "$ALL_HEADERS"
  done < "$COLLIDING_NAMES"
} | tee "$REPORT"

# Done
echo ""
echo "✅ Report saved to: $REPORT"