Commit 3e6a7f21 authored by lorianderson's avatar lorianderson

Merge pull request #15 from cablelabs/fix-branch-logic

Fix branch logic to checkout ruih/master for most repos, and master for our repos.
parents 089b508b b79538a3
......@@ -10,19 +10,18 @@ function libToolize {
find . -name '*-uninstalled.pc' -exec sed -i -e 's/\.libs\/\(libgst.\+\).so$/\1\.la/' {} \;
}
function setBranch {
local result="${DEFAULT_BRANCH}"
#if no branch was specified
if [ -z "${DEFAULT_BRANCH}" ]; then
#if usestream was specified but there is no upstream module, use ruih
if $USE_UPSTREAM ; then
if [[ "${NO_UPSTREAM_MODULES[@]}" == *"$module"* ]]; then
result=ruih/master
else
result=master
fi
# if usestream was not specified, use ruih
function getBranch {
local result
# Use the option from --branch if it was given explicitly
if [[ -n "$BRANCH" ]]; then
result="$BRANCH"
else
# In upstream repos, the default branch is master
if $USE_UPSTREAM || [[ "${NO_UPSTREAM_MODULES[@]}" == *"$module"* ]]; then
result=master
# In our repos, the default branch is ruih/master
else
result=ruih/master
fi
......@@ -30,8 +29,7 @@ function setBranch {
echo $result
}
unset DEFAULT_BRANCH
unset BRANCH
DELIBTOOLIZE=true
LIBTOOL_CHANGE_ONLY=false
INSTALL_DEPS=true
......@@ -70,7 +68,7 @@ while true; do
echo " our repos (you probably don't want to do this)."
exit;;
-v | --verbose ) VERBOSE=true; shift ;;
--branch ) shift; DEFAULT_BRANCH=$1 ; shift ;;
--branch ) shift; BRANCH=$1 ; shift ;;
--disable-libtool ) shift; DELIBTOOLIZE=true ;;
--enable-libtool ) shift; DELIBTOOLIZE=false ;;
--libtool-only ) LIBTOOL_CHANGE_ONLY=true ; shift ;;
......@@ -187,7 +185,7 @@ for module in ${GST_MODULES[@]} ; do
git clone "git://anongit.freedesktop.org/git/gstreamer/$module"
cd $module
fi
MODULE_BRANCH=$(setBranch $module)
MODULE_BRANCH=$(getBranch $module)
echo "Checking out branch $MODULE_BRANCH"
git checkout $MODULE_BRANCH || errors="$errors\nUnable to checkout branch: $MODULE_BRANCH for repo $module"
elif $UPDATE_MODULES ; then
......@@ -200,7 +198,7 @@ for module in ${GST_MODULES[@]} ; do
echo "Fetching origin for [$module]"
git fetch origin || errors="$errors\nUnable to update remote: origin"
MODULE_BRANCH=$(setBranch $module)
MODULE_BRANCH=$(getBranch $module)
# -p means "don't remove merges"
# requires the branch to be previously checked out
......@@ -212,9 +210,9 @@ for module in ${GST_MODULES[@]} ; do
fi
else
cd $module
if [ -n "$DEFAULT_BRANCH" ] ; then
echo "Checking out branch $DEFAULT_BRANCH"
git checkout $DEFAULT_BRANCH || errors="$errors\nUnable to checkout branch: $DEFAULT_BRANCH for repo $module"
if [ -n "$BRANCH" ] ; then
echo "Checking out branch $BRANCH"
git checkout $BRANCH || errors="$errors\nUnable to checkout branch: $BRANCH for repo $module"
fi
fi
if [[ ! "${NO_UPSTREAM_MODULES[@]}" == *"$module"* ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment