Files
xen/tools/misc/mktarball
T
Ian Jackson bdfdf244f5 mktarball: For qemu upstream, use their scripts/archive-source.sh
qemu upstream uses git submodules.  git archive does not work with git
submodules (and could not work properly with them, because this is one
of the many things it is inherently impossible to do correctly with
git submodules).

qemu upstream have worked around this by providing a rather scary
shell script which attempts to do roughly the right thing.  It's close
enough that we can use it with only minor precautions.

Unfortunately this does mean that `mktarball' now executes the qemu
source code it was using, rather than merely shuffling it about, as it
did previously.  I think this is a less bad ill than copying (and,
effectively, forking) the scary script.

CC: Wei Liu <wei.liu2@citrix.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>
CC: Juergen Gross <jgross@suse.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
2018-04-17 18:21:30 +01:00

55 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
#
# mktarball: Make a release tarball (including xen, qemu, and qemu-traditional)
#
# Takes 2 arguments, the path to the dist directory and the version
set -ex
function git_archive_into {
mkdir -p "$2"
git --git-dir="$1"/.git \
archive --format=tar HEAD | \
tar Cxf "$2" -
}
if [[ -z "$1" || -z "$2" ]] ; then
echo "usage: $0 path-to-XEN_ROOT xen-version"
exit 1
fi
xen_root="$1"
desc="$2"
tdir="$xen_root/dist/tmp.src-tarball"
rm -rf $tdir
mkdir -p $tdir
git_archive_into $xen_root $tdir/xen-$desc
# We can't use git_archive_into with qemu upstream because it uses
# git-submodules. git-submodules are an inherently broken git feature
# which should never be used in any circumstance. Unfortunately, qemu
# upstream uses them. Relevantly for us, git archive does not work
# properly when there are submodules.
(
cd $xen_root/tools/qemu-xen-dir-remote
# if it's not clean, the qemu script will call `git stash' !
git --no-pager diff --stat HEAD
scripts/archive-source.sh $tdir/xen-$desc/tools/qemu-xen.tar
cd $tdir/xen-$desc/tools
mkdir qemu-xen
tar <qemu-xen.tar Cxf qemu-xen -
rm qemu-xen.tar
)
git_archive_into $xen_root/tools/qemu-xen-traditional-dir-remote $tdir/xen-$desc/tools/qemu-xen-traditional
git_archive_into $xen_root/extras/mini-os-remote $tdir/xen-$desc/extras/mini-os
GZIP=-9v tar cz -f $xen_root/dist/xen-$desc.tar.gz -C $tdir xen-$desc
echo "Source tarball in $xen_root/dist/xen-$desc.tar.gz"