summaryrefslogtreecommitdiffstats
path: root/scripts/generate-git-snapshot.sh
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2012-02-28 11:18:09 -0500
committerDave Jones <davej@redhat.com>2012-02-28 11:18:09 -0500
commitc325fa4fd0f681c012a5635542613a53df9bdfc6 (patch)
tree8e6d7ec917e442a556a038e9ed0b0ecf2b6be475 /scripts/generate-git-snapshot.sh
parent4f646f3602b25445e9e4fd1f073ea5a1f1222834 (diff)
downloadkernel-c325fa4fd0f681c012a5635542613a53df9bdfc6.tar.gz
kernel-c325fa4fd0f681c012a5635542613a53df9bdfc6.tar.xz
kernel-c325fa4fd0f681c012a5635542613a53df9bdfc6.zip
add a script to generate the git snapshot.
Diffstat (limited to 'scripts/generate-git-snapshot.sh')
-rwxr-xr-xscripts/generate-git-snapshot.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/generate-git-snapshot.sh b/scripts/generate-git-snapshot.sh
new file mode 100755
index 000000000..17a9c438f
--- /dev/null
+++ b/scripts/generate-git-snapshot.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Set LINUX_GIT to point to an upstream Linux git tree in your .bashrc or wherever.
+#
+# TODO: Generate the gitN number.
+#
+
+VER=$(grep patch sources | head -n1 | awk '{ print $2 }' | sed s/patch-// | sed s/.xz//)
+
+pushd $LINUX_GIT
+
+git diff v$VER.. > /tmp/patch-$VER-git
+xz -9 /tmp/patch-$VER-git
+DESC=$(git describe)
+popd
+
+mv /tmp/patch-$VER-git.xz .
+
+rpmdev-bumpspec -c "Linux $DESC" kernel.spec