Skip to content
Snippets Groups Projects
Commit f02f520d authored by Michael Vines's avatar Michael Vines
Browse files

Workspaces created from AU tags are now identified

Change-Id: Ic165faaa2593584246e1cc35c2c33352b6c84e24
parent f11902a7
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
# #
# Attempt to identify the Android tree in use. On success one or more # Attempt to identify the tree in use. On success one or more
# tree identifiers are output to stdout. # tree identifiers are output to stdout.
# #
# Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. # Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
...@@ -36,20 +36,26 @@ if [[ ! ( -f build/envsetup.sh ) ]]; then ...@@ -36,20 +36,26 @@ if [[ ! ( -f build/envsetup.sh ) ]]; then
exit 1 exit 1
fi fi
TREEID=
if [[ -f .repo/manifest.xml ]] ; then if [[ -f .repo/manifest.xml ]] ; then
# Tokenize <default revision="x_y_z"/> by '_' mergeBranch=$(repo info -l .repo/manifest 2>/dev/null | sed -ne 's/^Manifest merge branch: \(.*\)$/\1/p')
TOKENS=$(repo info -l .repo/manifest 2>/dev/null | sed -e '/merge/!d ; s/^.*branch:// ; s/.*\///; s/.*b2g_//g;')
# Drop 'ref/tags/' if present
MANIFEST_ID= mergeBranch=$(basename $mergeBranch)
for T in $TOKENS; do
if [ -z $MANIFEST_ID ]; then # Check for an AU tag and extract the corresponding branch name
MANIFEST_ID=$T mergeBranch=${mergeBranch#AU_LINUX_GECKO_}
else mergeBranch=${mergeBranch%.[0-9][0-9].[0-9][0-9].[0-9][0-9].[0-9][0-9][0-9].[0-9][0-9][0-9]}
MANIFEST_ID=${MANIFEST_ID}_$T
fi # Old-style branch names are lowercase
TREEID="$MANIFEST_ID $TREEID" if [[ $mergeBranch =~ ^B2G_ ]]; then
done mergeBranch=${mergeBranch,,}
fi
# Drop b2g_ prefix from old-style branch names
mergeBranch=${mergeBranch#b2g_}
echo $mergeBranch all
else
echo all
fi fi
echo $TREEID all
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment