From 445d4fd926c569e7b9ae28017da86280aaecbae2 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 22 Jun 2023 09:49:04 -0500 Subject: [PATCH] 3rdparty: Add validateBootstrapRepo tool * Fills in a detection gap where HaikuPortsCross might reference packages that no longer exist in haikuports.cross * A handy pre-bootstrap check Change-Id: Id397ecda731a7b7d8fc3d407a4791724494611d7 --- 3rdparty/kallisti5/validateBootstrapRepo | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 3rdparty/kallisti5/validateBootstrapRepo diff --git a/3rdparty/kallisti5/validateBootstrapRepo b/3rdparty/kallisti5/validateBootstrapRepo new file mode 100755 index 0000000000..9db8f48053 --- /dev/null +++ b/3rdparty/kallisti5/validateBootstrapRepo @@ -0,0 +1,50 @@ +#!/bin/bash +# Check if a Bootstrap Jam repository file matches the availability of the contents of haikuports.cross + +if [ $# -ne 1 ]; then + echo "usage: $0 " + exit 1 +fi + +if [ ! -d "$1" ]; then + echo "Error: Unable to read haikuports directory '$1'!" + exit 1 +fi + +HAIKUPORTS="$1" +REPOFILES="build/jam/repositories/HaikuPortsCross" + +if [[ ! -d $REPOFILES ]]; then + echo "Unable to locate ${REPOFILES}! Run me from the haiku source root!" + exit 2 +fi + +RESULT=0 +for f in $(find $REPOFILES -print); do + ARCHITECTURE=$(cat $f | tr '\n' ' ' | awk '{ print $4 } ') + echo "================ Scanning $ARCHITECTURE" + REPO_EXPECT=$(cat $f | grep -v "#" | grep '-' | grep 'bootstrap' | grep -v 'bootstrap_') + for i in $REPO_EXPECT; do + PACKAGE=$(echo $i | cut -d'-' -f1) + if [[ $PACKAGE == *_devel* ]]; then + continue + fi + RECIPE_NAME=$(echo $i | sed 's/\-[0-9]$//g') + RECIPE=$(find $HAIKUPORTS -name ${RECIPE_NAME}.recipe) + if [[ "$RECIPE" == "" ]]; then + echo " $ARCHITECTURE $i... ERROR (Missing recipe $RECIPE_NAME!)" + RESULT=1 + continue + fi + grep "REVISION=$REV" $RECIPE > /dev/null + #echo $RECIPE + if [[ $? -eq 0 ]]; then + echo " $ARCHITECTURE $i... OK" + else + echo " $ARCHITECTURE $i... ERROR (Incorrect revision!)" + RESULT=1 + fi + #echo $i - $PACKAGE + done +done +exit $RESULT