diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index 8104ba75..6e9ef861 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -40,12 +40,8 @@ set -x mkdir -p "$deps" cd "$deps" -osmo-deps.sh "$project" +osmo-deps.sh "$project" "$branch" cd "$project" -if [ -n "$branch" ]; then - git checkout "$branch" -fi -git rev-parse HEAD # log current HEAD autoreconf --install --force ./configure --prefix="$inst" $cfg diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh index c256a6a7..92cf0416 100755 --- a/scripts/osmo-deps.sh +++ b/scripts/osmo-deps.sh @@ -1,12 +1,14 @@ #!/bin/sh set -ex +project="$1" +branch="${2:-origin/master}" -if ! test -d $1; +if ! test -d "$project"; then - git clone git://git.osmocom.org/$1 $1 + git clone "git://git.osmocom.org/$project" "$project" fi -cd $1 +cd "$project" git fetch origin # Cleanup should already have happened during a global osmo-clean-workspace.sh, @@ -14,5 +16,5 @@ git fetch origin # the dep subdir separately: osmo-clean-workspace.sh -git reset --hard origin/master +git reset --hard "$branch" git rev-parse HEAD