2
0

make-release 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/bash -e
  2. #
  3. # QEMU Release Script
  4. #
  5. # Copyright IBM, Corp. 2012
  6. #
  7. # Authors:
  8. # Anthony Liguori <aliguori@us.ibm.com>
  9. #
  10. # This work is licensed under the terms of the GNU GPLv2 or later.
  11. # See the COPYING file in the top-level directory.
  12. function subproject_dir() {
  13. if test ! -f "subprojects/$1.wrap"; then
  14. error "scripts/archive-source.sh should only process wrap subprojects"
  15. fi
  16. # Print the directory key of the wrap file, defaulting to the
  17. # subproject name. The wrap file is in ini format and should
  18. # have a single section only. There should be only one section
  19. # named "[wrap-*]", which helps keeping the script simple.
  20. local dir
  21. dir=$(sed -n \
  22. -e '/^\[wrap-[a-z][a-z]*\]$/,/^\[/{' \
  23. -e '/^directory *= */!b' \
  24. -e 's///p' \
  25. -e 'q' \
  26. -e '}' \
  27. "subprojects/$1.wrap")
  28. echo "${dir:-$1}"
  29. }
  30. if [ $# -ne 2 ]; then
  31. echo "Usage:"
  32. echo " $0 gitrepo version"
  33. exit 0
  34. fi
  35. # Only include wraps that are invoked with subproject()
  36. SUBPROJECTS="libvfio-user keycodemapdb berkeley-softfloat-3
  37. berkeley-testfloat-3 arbitrary-int-1-rs bilge-0.2-rs
  38. bilge-impl-0.2-rs either-1-rs itertools-0.11-rs proc-macro2-1-rs
  39. proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs
  40. syn-2-rs unicode-ident-1-rs"
  41. src="$1"
  42. version="$2"
  43. destination=qemu-${version}
  44. git clone --single-branch -b "v${version}" -c advice.detachedHead=false \
  45. "${src}" ${destination}
  46. pushd ${destination}
  47. git submodule update --init --single-branch
  48. meson subprojects download $SUBPROJECTS
  49. (cd roms/seabios && git describe --tags --long --dirty > .version)
  50. (cd roms/skiboot && ./make_version.sh > .version)
  51. # Fetch edk2 submodule's submodules, since it won't have access to them via
  52. # the tarball later.
  53. #
  54. # A more uniform way to handle this sort of situation would be nice, but we
  55. # don't necessarily have much control over how a submodule handles its
  56. # submodule dependencies, so we continue to handle these on a case-by-case
  57. # basis for now.
  58. (cd roms/edk2 && \
  59. git submodule update --init --depth 1 -- \
  60. ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \
  61. BaseTools/Source/C/BrotliCompress/brotli \
  62. CryptoPkg/Library/OpensslLib/openssl \
  63. MdeModulePkg/Library/BrotliCustomDecompressLib/brotli)
  64. popd
  65. exclude=(--exclude=.git)
  66. # include the tarballs in subprojects/packagecache but not their expansion
  67. for sp in $SUBPROJECTS; do
  68. if grep -xqF "[wrap-file]" subprojects/$sp.wrap; then
  69. exclude+=(--exclude=subprojects/"$(subproject_dir $sp)")
  70. fi
  71. done
  72. tar "${exclude[@]}" -cJf ${destination}.tar.xz ${destination}
  73. rm -rf ${destination}