summaryrefslogtreecommitdiffstats
path: root/debian/_buildscripts/local/scripts/_update_repositories-int.sh
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2018-01-05 18:08:33 +0900
committerMichele Calgaro <[email protected]>2018-05-28 14:46:58 +0900
commit1da1d03f8d107bff644797131bc997476d22ecc1 (patch)
tree9fc888e0cb05603dd4ed233a675a67cf4bc575ff /debian/_buildscripts/local/scripts/_update_repositories-int.sh
parent204867aa831b7de0c1faf4321c9767c868d2d577 (diff)
downloadtde-packaging-1da1d03f8d107bff644797131bc997476d22ecc1.tar.gz
tde-packaging-1da1d03f8d107bff644797131bc997476d22ecc1.zip
DEB build script: first commit, still work in progress although
functional. Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'debian/_buildscripts/local/scripts/_update_repositories-int.sh')
-rwxr-xr-xdebian/_buildscripts/local/scripts/_update_repositories-int.sh79
1 files changed, 79 insertions, 0 deletions
diff --git a/debian/_buildscripts/local/scripts/_update_repositories-int.sh b/debian/_buildscripts/local/scripts/_update_repositories-int.sh
new file mode 100755
index 000000000..4efd1bf19
--- /dev/null
+++ b/debian/_buildscripts/local/scripts/_update_repositories-int.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Load common code
+. ./_build_common.sh
+
+#----------------------------
+# Initialization
+init_common
+
+#----------------------------
+# Update TDE main repository
+echo -e "\n---- Updating main TDE GIT repo ----\n"
+
+cd "$TDE_DIR/$CFG_GIT_DIR/tde"
+if [[ ! -e .git ]] || [[ -z "`git rev-parse --git-dir 2>/dev/null`" ]]; then
+ echo "Current directory does not contain a .git folder. Exiting..."
+ cd $SCRIPT_DIR
+ exit 1
+fi
+
+branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"`
+if [[ -z "$branch" ]] || [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then
+ echo "There is not active upstream branch. Exiting..."
+ cd $SCRIPT_DIR
+ exit 1
+fi
+
+touch /var/lock/update-tde-git-submodules
+
+PARENTDIR=$PWD
+echo "---- Main repo ----"
+git pull --rebase
+if [[ ! -z "`git status --porcelain --ignore-submodules`" ]]; then
+ git reset --hard HEAD
+ git clean -dxff
+fi
+
+exec 3< submodules
+while read <&3
+do
+ cd $PARENTDIR
+ DIR2UPDATE=$REPLY
+ if [[ $DIR2UPDATE != "" ]]; then
+ echo -e "\n---- Submodule $DIR2UPDATE ----"
+ cd $PARENTDIR/$DIR2UPDATE/..
+ cd `git rev-parse --show-toplevel`
+ if [[ -z "`grep \"^Updated: $PWD$\" /var/lock/update-tde-git-submodules`" ]]; then
+ echo "Updated: $PWD" >>/var/lock/update-tde-git-submodules
+ git submodule init
+ git submodule update
+ fi
+ cd $PARENTDIR/$DIR2UPDATE
+ if [[ ! -z "`git status --porcelain --ignore-submodules`" ]]; then
+ git reset --hard HEAD
+ git clean -dxff
+ fi
+ git checkout $branch
+ git pull --rebase
+ cd ..
+ cd `git rev-parse --show-toplevel`
+ fi
+done
+exec 3>&-
+
+rm /var/lock/update-tde-git-submodules
+
+
+#------------------------------
+# Update TDE-packaging repository
+echo -e "\n----------------------------------------"
+echo -e "\n--- Updating TDE-packaging GIT repo ----\n"
+
+cd "$TDE_DIR/$CFG_GIT_DIR/tde-packaging"
+git pull --rebase
+
+
+#------------------------------
+# Done
+cd $SCRIPT_DIR