summaryrefslogtreecommitdiffstats
path: root/scripts/generate-git-snapshot.sh
blob: 17a9c438fcb7db0ee48f67a942eb2ca24433936d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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