osmith has uploaded this change for review.

View Change

deps/update.sh: split update cmds from Makefile

Move the inline shell commands from the Makefile to a separate script,
so they are easier to edit and maintain. Proper syntax highlighting, no
need for all the backslashes + &&, etc.

Change-Id: Ifab1158000ccb39f0b384bbd81841e417ed24f37
---
M deps/Makefile
A deps/update.sh
2 files changed, 15 insertions(+), 9 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/19/38219/1
diff --git a/deps/Makefile b/deps/Makefile
index 8292020..460c2a6 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -158,15 +158,7 @@
cd $(1) && git remote set-url origin $(2)/$(1) && git fetch
endif
ifneq ($$($(1)_HEAD),$($(1)_commit))
- cd $(1) && \
- git fetch && \
- if git rev-parse "origin/$($(1)_commit)" 2>/dev/null; then \
- set -x && \
- git checkout -q -f "origin/$($(1)_commit)"; \
- else \
- set -x && \
- git checkout -q -f "$($(1)_commit)"; \
- fi
+ ./update.sh "$(1)" "$($(1)_commit)"
endif
endif

diff --git a/deps/update.sh b/deps/update.sh
new file mode 100755
index 0000000..ad12bcb
--- /dev/null
+++ b/deps/update.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+DIR="$1"
+COMMIT="$2"
+
+cd "$DIR"
+git fetch
+
+if git rev-parse "origin/$COMMIT" 2>/dev/null; then
+ set -x
+ git checkout -q -f "origin/$COMMIT"
+else
+ set -x
+ git checkout -q -f "$COMMIT"
+fi

To view, visit change 38219. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ifab1158000ccb39f0b384bbd81841e417ed24f37
Gerrit-Change-Number: 38219
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>