summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-01-24 13:48:57 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-01-25 15:21:36 +0000
commit78e1cd38b6aa391989e4905ea128ab9ceea90d3b (patch)
tree248b37ca473d47bd41a0245f9d21879c40eae732
parent3317d635ff9c968cff095e9b882da2b323f9a6c6 (diff)
downloadqtrepotools-78e1cd38b6aa391989e4905ea128ab9ceea90d3b.tar.gz
Add the qt-sync-to script
By popular demand, add the shell script that calls the QtSynchronizeRepo cmake script. The script synchronizes submodules that the specified module's revision depends on, as per dependencies.yaml entries. E.g. calling $ git qt-sync-to qtmultimedia will check qtbase, qtdeclarative, qtsvg, ... out as per the dependencies entries, resulting in a consistent top level source tree up to qtmultimedia. Change-Id: I2b20439c49b7973e4e405bfdc6336aadf5dcfbc2 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
-rwxr-xr-xbin/git-sync-to24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/git-sync-to b/bin/git-sync-to
new file mode 100755
index 0000000..e9300e7
--- /dev/null
+++ b/bin/git-sync-to
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+while [ ! -f cmake/QtSynchronizeRepo.cmake ]
+do
+ cd ..
+ if [ $? -gt 0 ]
+ then
+ >&2 echo "This git command needs to be run within a Qt supermodule clone"
+ exit 1
+ fi
+done
+
+module="$1"
+shift
+revision="$1"
+shift
+
+if [ ! -d $module ]
+then
+ >&2 echo "Can't find worktree for the reference module '$module'"
+ exit 2
+fi
+
+cmake -DSYNC_TO_MODULE="$module" -DSYNC_TO_BRANCH="$revision" "$@" -P cmake/QtSynchronizeRepo.cmake