summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-08-26 14:11:30 +0200
committerKarel Kočí <cynerd@email.cz>2018-08-26 14:11:30 +0200
commit7b1aef260402f538e3c60c83bfb79f9f41fcbf7a (patch)
treea8c06c31d45714d103bd4805bbe6561cd9104535 /scripts
downloadlaminar-cnf-7b1aef260402f538e3c60c83bfb79f9f41fcbf7a.tar.gz
laminar-cnf-7b1aef260402f538e3c60c83bfb79f9f41fcbf7a.tar.bz2
laminar-cnf-7b1aef260402f538e3c60c83bfb79f9f41fcbf7a.zip
Add initial configuration
This is just initial test for turris3x-omnia
Diffstat (limited to 'scripts')
-rw-r--r--scripts/utils23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/utils b/scripts/utils
new file mode 100644
index 0000000..b88d4a4
--- /dev/null
+++ b/scripts/utils
@@ -0,0 +1,23 @@
+# vim: ft=sh
+
+# Simple echo wrapper for stage marking
+echo_stage() {
+ echo "========== $@ =========="
+}
+
+# Fetch git repository to WORKSPACE and create workspace in current directory
+# First agument has to be a source URL
+# Second argument is name of directory to which will be directory cloned in.
+# Second argument is optional and should be branch name (master is used if not
+# provided).
+git_fetch() {
+ local BRANCH="$3"
+ [ -n "$BRANCH" ] || BRANCH=master
+ local GITARGS="--git-dir='$WORKSPACE/$2' --bare"
+ if [ ! -d "$WORKSPACE/$2" ]; then
+ git clone --bare "$1" "$WORKSPACE/$2"
+ else
+ git $GITARGS fetch --prune --prune-tags --force "$1" "$BRANCH:$BRANCH"
+ fi
+ git $GITARGS worktree add --detach $2 $BRANCH
+}