aboutsummaryrefslogtreecommitdiff
path: root/scripts/archive-source.sh
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-06-13 10:00:18 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-06-13 10:00:18 +0100
commitfe18911af739d292ad2e62c6699a705a08302fca (patch)
treec4f58c4ec8f7328a175a6b99dac5e82c2716227a /scripts/archive-source.sh
parenta050901d4b40092dc356b59912c6df39e389c7b9 (diff)
parentab4752ec8d9b0b19ab80915016b739350418a078 (diff)
Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-gdbstub-cputlb-120619-3' into staging
Various fixes and updates: - editor config tweak for shell scripts - iotest updates (still not default for make check) - various docker updates - gcc/ubsan updates for travis - some clean-ups for tests/vm (no serial autoinstall) - semihosting fix for Coverity - fixes for cputlb in 64-on-32 cases - gdbstub re-factor + maintainership update # gpg: Signature made Wed 12 Jun 2019 17:55:04 BST # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-testing-gdbstub-cputlb-120619-3: (40 commits) gdbstub: Implement qemu physical memory mode gdbstub: Clear unused variables in gdb_handle_packet gdbstub: Implement target halted (? pkt) with new infra gdbstub: Implement generic set/query (Q/q pkt) with new infra gdbstub: Implement v commands with new infra gdbstub: Implement step (s pkt) with new infra gdbstub: Implement file io (F pkt) with new infra gdbstub: Implement read all registers (g pkt) with new infra gdbstub: Implement write all registers (G pkt) with new infra gdbstub: Implement read memory (m pkt) with new infra gdbstub: Implement write memory (M pkt) with new infra gdbstub: Implement get register (p pkt) with new infra gdbstub: Implement set register (P pkt) with new infra gdbstub: Implement breakpoint commands (Z/z pkt) with new infra gdbstub: Implement set_thread (H pkt) with new infra gdbstub: Implement continue with signal (C pkt) with new infra gdbstub: Implement continue (c pkt) with new infra gdbstub: Implement thread_alive (T pkt) with new infra gdbstub: Implement deatch (D pkt) with new infra gdbstub: Add infrastructure to parse cmd packets ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/archive-source.sh')
-rwxr-xr-xscripts/archive-source.sh72
1 files changed, 31 insertions, 41 deletions
diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
index 8b89948260..ca94e49978 100755
--- a/scripts/archive-source.sh
+++ b/scripts/archive-source.sh
@@ -19,16 +19,25 @@ if test $# -lt 1; then
fi
tar_file=$(realpath "$1")
-list_file="${tar_file}.list"
-vroot_dir="${tar_file}.vroot"
+sub_tdir=$(mktemp -d "${tar_file%.tar}.sub.XXXXXXXX")
+sub_file="${sub_tdir}/submodule.tar"
# 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 slirp ui/keycodemapdb tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"
+sub_deinit=""
-trap "status=$?; rm -rf \"$list_file\" \"$vroot_dir\"; exit \$status" 0 1 2 3 15
+function cleanup() {
+ local status=$?
+ rm -rf "$sub_tdir"
+ if test "$sub_deinit" != ""; then
+ git submodule deinit $sub_deinit
+ fi
+ exit $status
+}
+trap "cleanup" 0 1 2 3 15
if git diff-index --quiet HEAD -- &>/dev/null
then
@@ -36,45 +45,26 @@ then
else
HEAD=$(git stash create)
fi
-git clone --shared . "$vroot_dir"
-test $? -ne 0 && error "failed to clone into '$vroot_dir'"
-for sm in $submodules; do
- if test -d "$sm/.git"
- then
- git clone --shared "$sm" "$vroot_dir/$sm"
- test $? -ne 0 && error "failed to clone submodule $sm"
- fi
-done
-
-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"
+git archive --format tar $HEAD > "$tar_file"
+test $? -ne 0 && error "failed to archive qemu"
for sm in $submodules; do
- git submodule update --init $sm
- test $? -ne 0 && error "failed to init submodule $sm"
+ status="$(git submodule status "$sm")"
+ smhash="${status#[ +-]}"
+ smhash="${smhash%% *}"
+ case "$status" in
+ -*)
+ sub_deinit="$sub_deinit $sm"
+ git submodule update --init "$sm"
+ test $? -ne 0 && error "failed to update submodule $sm"
+ ;;
+ +*)
+ echo "WARNING: submodule $sm is out of sync"
+ ;;
+ esac
+ (cd $sm; git archive --format tar --prefix "$sm/" $smhash) > "$sub_file"
+ test $? -ne 0 && error "failed to archive submodule $sm ($smhash)"
+ tar --concatenate --file "$tar_file" "$sub_file"
+ test $? -ne 0 && error "failed append submodule $sm to $tar_file"
done
-
-if test -n "$submodules"; then
- {
- git ls-files || error "git ls-files failed"
- for sm in $submodules; do
- (cd $sm; git ls-files) | sed "s:^:$sm/:"
- if test "${PIPESTATUS[*]}" != "0 0"; then
- error "git ls-files in submodule $sm failed"
- fi
- done
- } | grep -x -v $(for sm in $submodules; do echo "-e $sm"; done) > "$list_file"
-else
- git ls-files > "$list_file"
-fi
-
-if test $? -ne 0; then
- error "failed to generate list file"
-fi
-
-tar -cf "$tar_file" -T "$list_file" || error "failed to create tar file"
-
exit 0