5f8c7ab0f8
* branch-stx.sh is a first cut at creating milestone/release branches in StarlingX repos. It includes branch creation and tagging the initial branch point, and for Gerrit-based repos it creates a review to update the .gitreview file to default to the new branch. * getrepo.sh extracts repository names from given remotes to eliminate the need to maintain that list separately. Change-Id: I5d73c32ec0f14520d3531d8b4cbce0ce4111396e Signed-off-by: Dean Troyer <dtroyer@gmail.com>
28 lines
754 B
Bash
Executable File
28 lines
754 B
Bash
Executable File
#!/bin/bash
|
|
# getrepo - Get the list of starlingx and stx-staging repos
|
|
# getrepo.sh [ <manifest-file> [<remote-name>] ... ]
|
|
|
|
IN_FILE=${1:-default.xml}
|
|
[[ $# -gt 1 ]] && shift
|
|
REMOTES=$*
|
|
|
|
# Extract the list of repo names from a repo manifest for the given remote
|
|
# get_repo <manifest-file> <git-remote-name>
|
|
function get_repos {
|
|
local manifest=$1
|
|
local remote=$2
|
|
for i in $(xmllint --xpath '//project[@remote="'$remote'"]/@name' $manifest); do
|
|
echo $i
|
|
done | sed -e 's/^name="//' -e 's/"$//'
|
|
}
|
|
|
|
for r in $REMOTES; do
|
|
remote=$(xmllint --xpath 'string(manifest/remote[@name="'$r'"]/@fetch)' $IN_FILE)
|
|
repos=$(
|
|
for i in $(get_repos $IN_FILE $r); do
|
|
echo $remote/$i
|
|
done
|
|
)
|
|
echo $repos
|
|
done
|