-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_dependencies
More file actions
executable file
·32 lines (27 loc) · 1.16 KB
/
Copy pathlist_dependencies
File metadata and controls
executable file
·32 lines (27 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
#
# Output dependencies for an extension or skin.
#
# Usage: ./list_dependencies extensions/Echo
# ./list_dependencies skins/MinervaNeue
#
set -euo pipefail # exit on error, undefined vars, or pipe failures
# Ensure integration/config working copy exists (needed for zuul/dependencies.yaml)
. "$(dirname "$0")"/lib/ensure_config
# Show usage if no argument provided
if [ $# -eq 0 ]; then
echo "Usage: ./list_dependencies extensions/EXTENSION or ./list_dependencies skins/SKIN"
exit 1
fi
# Get the component from the first argument (e.g. "extensions/Echo")
component="$1"
# Strip "extensions/" prefix if present (skins/ is kept as-is)
# dependencies.yaml uses bare names for extensions but "skins/Name" for skins
if [[ "$component" == extensions/* ]]; then
dep_key="${component#extensions/}" # remove "extensions/" prefix
else
dep_key="$component" # keep as-is (e.g. "skins/MinervaNeue")
fi
# Parse dependencies.yaml with awk. See lib/parse_yaml_list.awk for the parsing logic.
# -v key="Name:" passes the dependency key as an awk variable
awk -v key="${dep_key}:" -f "$(dirname "$0")"/lib/parse_yaml_list.awk src/config/zuul/dependencies.yaml