mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 15:34:18 +08:00
Add commit-hash.sh for recipe troubleshooting
Signed-off-by: Ojus Chugh <ojuschugh@gmail.com>
This commit is contained in:
parent
499530768a
commit
925e957c85
@ -1,15 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script show the current Git branch and commit of the recipe source
|
||||
# This script shows the current Git commit hash of system recipes at recipes/core
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
set -e
|
||||
|
||||
# Check if recipes/core directory exists
|
||||
if [ ! -d "recipes/core" ]
|
||||
then
|
||||
echo "Usage: $0 recipe_name"
|
||||
echo " Print the commit hash for recipe_name"
|
||||
echo "Error: recipes/core directory not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
recipe_path="$(target/release/find_recipe $1)"
|
||||
# Iterate through all system recipes in recipes/core
|
||||
for recipe_dir in recipes/core/*/
|
||||
do
|
||||
recipe_name=$(basename "$recipe_dir")
|
||||
source_dir="$recipe_dir/source"
|
||||
|
||||
cd "$recipe_path"/source
|
||||
git branch -v
|
||||
# Check if source directory exists and is a git repository
|
||||
if [ -d "$source_dir" ] && [ -d "$source_dir/.git" ]
|
||||
then
|
||||
# Get the commit hash
|
||||
commit_hash=$(cd "$source_dir" && git rev-parse HEAD)
|
||||
echo "$recipe_name: $commit_hash"
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user