summaryrefslogtreecommitdiff
path: root/kvm
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-06-02 18:27:20 +0300
committerMarcelo Tosatti <mtosatti@redhat.com>2010-06-04 13:46:09 -0300
commitd81e05c864ea1d503c1b073e7c878f435fea85dd (patch)
tree427383cec52d140c00488ae7d5d5422db12cdf17 /kvm
parentba0561d7a48a7e3f644ec8e763b662ec7cf8ac3f (diff)
make-release: make mtime, owner, group consistent
Files from git have modification time set to one of commit, and owner/group to root. Making it so for generated files as well makes it easier to generate an identical tarball from git. Setting owner/group to root is especially important because otherwise you must have a user/group with same name to generate an identical tarball. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm')
-rwxr-xr-xkvm/scripts/make-release9
1 files changed, 7 insertions, 2 deletions
diff --git a/kvm/scripts/make-release b/kvm/scripts/make-release
index fdc402b4c..e8051f4df 100755
--- a/kvm/scripts/make-release
+++ b/kvm/scripts/make-release
@@ -1,7 +1,7 @@
#!/bin/bash -e
usage() {
- echo "usage: $0 [--upload] [--formal] commit [name] [tarball]"
+ echo "usage: $0 [--upload] [--formal] commit [name] [tarball] [user]"
exit 1
}
@@ -51,17 +51,22 @@ cd "$(dirname "$0")"/../..
mkdir -p "$(dirname "$tarball")"
git archive --prefix="$name/" --format=tar "$commit" > "$tarball"
+mtime=`git show --format=%ct "$commit" --`
+tarargs="--owner=root --group=root --mtime=@$mtime"
+
mkdir -p "$tmpdir"
git cat-file -p "${commit}:roms" | awk ' { print $4, $3 } ' \
> "$tmpdir/EXTERNAL_DEPENDENCIES"
tar -rf "$tarball" --transform "s,^,$name/," -C "$tmpdir" \
+ $tarargs \
"EXTERNAL_DEPENDENCIES"
rm -rf "$tmpdir"
if [[ -n "$formal" ]]; then
mkdir -p "$tmpdir"
echo "$name" > "$tmpdir/KVM_VERSION"
- tar -rf "$tarball" --transform "s,^,$name/," -C "$tmpdir" "KVM_VERSION"
+ tar -rf "$tarball" --transform "s,^,$name/," -C "$tmpdir" "KVM_VERSION" \
+ $tarargs
rm -rf "$tmpdir"
fi