Skip to content
Snippets Groups Projects
Commit 42fe82ac authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Workspaces created from AU tags are now identified"

parents f11902a7 f02f520d
No related branches found
No related merge requests found
#!/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.
#
# Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
......@@ -36,20 +36,26 @@ if [[ ! ( -f build/envsetup.sh ) ]]; then
exit 1
fi
TREEID=
if [[ -f .repo/manifest.xml ]] ; then
# Tokenize <default revision="x_y_z"/> by '_'
TOKENS=$(repo info -l .repo/manifest 2>/dev/null | sed -e '/merge/!d ; s/^.*branch:// ; s/.*\///; s/.*b2g_//g;')
MANIFEST_ID=
for T in $TOKENS; do
if [ -z $MANIFEST_ID ]; then
MANIFEST_ID=$T
else
MANIFEST_ID=${MANIFEST_ID}_$T
fi
TREEID="$MANIFEST_ID $TREEID"
done
mergeBranch=$(repo info -l .repo/manifest 2>/dev/null | sed -ne 's/^Manifest merge branch: \(.*\)$/\1/p')
# Drop 'ref/tags/' if present
mergeBranch=$(basename $mergeBranch)
# Check for an AU tag and extract the corresponding branch name
mergeBranch=${mergeBranch#AU_LINUX_GECKO_}
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]}
# Old-style branch names are lowercase
if [[ $mergeBranch =~ ^B2G_ ]]; then
mergeBranch=${mergeBranch,,}
fi
# Drop b2g_ prefix from old-style branch names
mergeBranch=${mergeBranch#b2g_}
echo $mergeBranch all
else
echo all
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