osmo-build-dep: offload branch checkout to osmo-deps.sh

In osmo-deps.sh, add second arg $branch, and also name the first one (i.e.
$project). Use the passed branch or 'origin/master' by default.

In osmo-build-dep.sh, it's not necessary to do a second 'git rev-parse HEAD',
osmo-deps.sh already does it.

Change-Id: I598c41a12352acea6e49a321ad2f665f6ea07a44
This commit is contained in:
Neels Hofmeyr 2017-10-27 22:31:14 +02:00
parent f42a1cfa50
commit 7c5e34cba0
2 changed files with 7 additions and 9 deletions

View File

@ -40,12 +40,8 @@ set -x
mkdir -p "$deps" mkdir -p "$deps"
cd "$deps" cd "$deps"
osmo-deps.sh "$project" osmo-deps.sh "$project" "$branch"
cd "$project" cd "$project"
if [ -n "$branch" ]; then
git checkout "$branch"
fi
git rev-parse HEAD # log current HEAD
autoreconf --install --force autoreconf --install --force
./configure --prefix="$inst" $cfg ./configure --prefix="$inst" $cfg

View File

@ -1,12 +1,14 @@
#!/bin/sh #!/bin/sh
set -ex set -ex
project="$1"
branch="${2:-origin/master}"
if ! test -d $1; if ! test -d "$project";
then then
git clone git://git.osmocom.org/$1 $1 git clone "git://git.osmocom.org/$project" "$project"
fi fi
cd $1 cd "$project"
git fetch origin git fetch origin
# Cleanup should already have happened during a global osmo-clean-workspace.sh, # Cleanup should already have happened during a global osmo-clean-workspace.sh,
@ -14,5 +16,5 @@ git fetch origin
# the dep subdir separately: # the dep subdir separately:
osmo-clean-workspace.sh osmo-clean-workspace.sh
git reset --hard origin/master git reset --hard "$branch"
git rev-parse HEAD git rev-parse HEAD