Add magic support for direct operation on files
Things that work now: (in any combinations) - `./build.sh debian` - `./build.sh debian:sid` - `./build.sh ../library/debian` - `./build.sh ../library/debian:sid`
This commit is contained in:
parent
143ac14d2a
commit
4b6f49153d
19
build.sh
19
build.sh
|
|
@ -106,18 +106,29 @@ mkdir -p "$latestLogDir"
|
||||||
|
|
||||||
# gather all the `repo:tag` combos to build
|
# gather all the `repo:tag` combos to build
|
||||||
for repoTag in "${repos[@]}"; do
|
for repoTag in "${repos[@]}"; do
|
||||||
echo "$repoTag" >> "$logDir/repos.txt"
|
repo="${repoTag%%:*}"
|
||||||
|
tag="${repoTag#*:}"
|
||||||
|
[ "$repo" != "$tag" ] || tag=
|
||||||
|
|
||||||
|
if [ -f "$repo" ]; then
|
||||||
|
repoFile="$repo"
|
||||||
|
repo="$(basename "$repoFile")"
|
||||||
|
repoTag="${repo}${tag:+:$tag}"
|
||||||
|
else
|
||||||
|
repoFile="$library/$repo"
|
||||||
|
fi
|
||||||
|
|
||||||
|
repoFile="$(readlink -f "$repoFile")"
|
||||||
|
echo "$repoTag ($repoFile)" >> "$logDir/repos.txt"
|
||||||
|
|
||||||
if [ "${repoGitRepo[$repoTag]}" ]; then
|
if [ "${repoGitRepo[$repoTag]}" ]; then
|
||||||
queue+=( "$repoTag" )
|
queue+=( "$repoTag" )
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
repo="${repoTag%:*}"
|
|
||||||
|
|
||||||
# parse the repo library file
|
# parse the repo library file
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
repoTagLines=( $(cat "$library/$repo" | grep -vE '^#|^\s*$') )
|
repoTagLines=( $(cat "$repoFile" | grep -vE '^#|^\s*$') )
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
tags=()
|
tags=()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue