laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38219?usp=email )
Change subject: deps/update.sh: split update cmds from Makefile
......................................................................
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(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
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
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38219?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ifab1158000ccb39f0b384bbd81841e417ed24f37
Gerrit-Change-Number: 38219
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>