Skip to content
Snippets Groups Projects
Commit f7be19b7 authored by Nicolas Richart's avatar Nicolas Richart
Browse files

more debug capabilities

parent e8b63271
No related branches found
No related tags found
No related merge requests found
Pipeline #259582 canceled
...@@ -69,15 +69,32 @@ get_name_dep(){ ...@@ -69,15 +69,32 @@ get_name_dep(){
} }
get_all_dependent(){
jq --arg h "$1" -c '.concrete_specs
| to_entries
| .[]
| select(.value.dependencies | length != 0)
| select(.value.dependencies[] | select(.hash | match($h)))
| {
name: .value.name,
key: .key,
version: .value.version,
compiler: (.value.compiler | "\(.version)"),
target: (.value.arch.target | if type == "object" then .name else . end)
}' $2
}
usage() { usage() {
echo "-h [hash]" echo "-h [hash]"
echo "-n [name]" echo "-n [name]"
echo "-f [file]" echo "-f [file]"
} }
OPTSTRING=":h:n:f:a" OPTSTRING=":h:n:f:a:d"
all=0 all=0
dependent=0
hash="" hash=""
name="" name=""
file="" file=""
...@@ -92,6 +109,9 @@ while getopts ${OPTSTRING} opt; do ...@@ -92,6 +109,9 @@ while getopts ${OPTSTRING} opt; do
n) n)
name=${OPTARG} name=${OPTARG}
;; ;;
d)
dependent=1
;;
a) a)
all=1 all=1
;; ;;
...@@ -108,22 +128,30 @@ while getopts ${OPTSTRING} opt; do ...@@ -108,22 +128,30 @@ while getopts ${OPTSTRING} opt; do
esac esac
done done
if [ "x$file" == "x" ] if [ "x$file" = "x" ]
then then
echo "No file specified" echo "No file specified"
usage usage
exit 1 exit 1
fi fi
echo "name ($name), hash ($hash), file($file), all($all)" #echo "name ($name), hash ($hash), file($file), all($all)"
if [ "x$hash" != "x" ] if [ $dependent -eq 1 ]
then then
if [ $all -eq 1 ] if [ "x$hash" != "x" ]
then
get_all_dependent $hash $file
fi
else
if [ "x$hash" != "x" ]
then then
get_all_dep $hash $file if [ $all -eq 1 ]
else then
get_hash_dep $hash $file get_all_dep $hash $file
else
get_hash_dep $hash $file
fi
fi fi
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment