aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-10-17 10:03:33 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-10-17 10:03:33 +0100
commita4faa26857694fa87d96d15ad5b6afa8fbc2c900 (patch)
tree07c06b223e68703a2fef35a21d535a9f39e99897 /scripts
parente24cdd07216890d24468cdcbdd5a3e60b3e9f23b (diff)
parent2ff408de9c080f2fb5a94ebf6a209c6180c64933 (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20171016-pull-request' into staging
ui: use keycodemapdb for key code mappings, part one (v2) ui: add qemu-keymap, update reverse keymaps (for qemu -k $map) ui: fix for vte 0.50 ui: gtk texture fix # gpg: Signature made Mon 16 Oct 2017 14:12:49 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/ui-20171016-pull-request: gtk: fix wrong id between texture and framebuffer ui/gtk: Fix deprecation of vte_terminal_copy_clipboard pc-bios/keymaps: keymaps update Add pc-bios/keymaps/Makefile tools: add qemu-keymap ui: don't export qemu_input_event_new_key ui: convert key events to QKeyCodes immediately ui: convert common input code to keycodemapdb ui: add keycodemapdb repository as a GIT submodule docker: don't rely on submodules existing in the main checkout build: automatically handle GIT submodule checkout for dtc Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/archive-source.sh34
-rwxr-xr-xscripts/git-submodule.sh38
2 files changed, 66 insertions, 6 deletions
diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
index c4e7d98f4d..4e63774f9a 100755
--- a/scripts/archive-source.sh
+++ b/scripts/archive-source.sh
@@ -18,15 +18,37 @@ if test $# -lt 1; then
error "Usage: $0 <output tarball>"
fi
-tar_file="$1"
-list_file="$1.list"
-submodules=$(git submodule foreach --recursive --quiet 'echo $name')
+tar_file=`realpath "$1"`
+list_file="${tar_file}.list"
+vroot_dir="${tar_file}.vroot"
-if test $? -ne 0; then
- error "git submodule command failed"
+# We want a predictable list of submodules for builds, that is
+# independent of what the developer currently has initialized
+# in their checkout, because the build environment is completely
+# different to the host OS.
+submodules="dtc ui/keycodemapdb"
+
+trap "status=$?; rm -rf \"$list_file\" \"$vroot_dir\"; exit \$status" 0 1 2 3 15
+
+if git diff-index --quiet HEAD -- &>/dev/null
+then
+ HEAD=HEAD
+else
+ HEAD=`git stash create`
fi
+git clone --shared . "$vroot_dir"
+test $? -ne 0 && error "failed to clone into '$vroot_dir'"
+
+cd "$vroot_dir"
+test $? -ne 0 && error "failed to change into '$vroot_dir'"
+
+git checkout $HEAD
+test $? -ne 0 && error "failed to checkout $HEAD revision"
-trap "status=$?; rm -f \"$list_file\"; exit \$status" 0 1 2 3 15
+for sm in $submodules; do
+ git submodule update --init $sm
+ test $? -ne 0 && error "failed to init submodule $sm"
+done
if test -n "$submodules"; then
{
diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
new file mode 100755
index 0000000000..d8fbc7e47e
--- /dev/null
+++ b/scripts/git-submodule.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# This code is licensed under the GPL version 2 or later. See
+# the COPYING file in the top-level directory.
+
+set -e
+
+substat=".git-submodule-status"
+
+command=$1
+shift
+modules="$@"
+
+if test -z "$modules"
+then
+ test -e $substat || touch $substat
+ exit 0
+fi
+
+if ! test -e ".git"
+then
+ echo "$0: unexpectedly called with submodules but no git checkout exists"
+ exit 1
+fi
+
+case "$command" in
+status)
+ test -f "$substat" || exit 1
+ trap "rm -f ${substat}.tmp" EXIT
+ git submodule status $modules > "${substat}.tmp"
+ diff "${substat}" "${substat}.tmp" >/dev/null
+ exit $?
+ ;;
+update)
+ git submodule update --init $modules 1>/dev/null 2>&1
+ git submodule status $modules > "${substat}"
+ ;;
+esac