Re: [PATCH] scritpt to generate git snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/13/2016 03:23 PM, Miguel Flores Silverio wrote:
Signed-off-by: Miguel Flores Silverio <floresmigu3l@xxxxxxxxx>

There is already a scripts/generate-git-snapshot.sh. I don't know how you
managed to send a new copy.

If there are changes, can you just send an incremental patch?

---
 scripts/generate-git-snapshot.sh | 41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100755 scripts/generate-git-snapshot.sh

diff --git a/scripts/generate-git-snapshot.sh b/scripts/generate-git-snapshot.sh
new file mode 100755
index 0000000..82772a5
--- /dev/null
+++ b/scripts/generate-git-snapshot.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+# This scripts allow for the generation of a git snapshot between the upstream git
+# tree ( Linus' version of the kernel ) and the fedora kernel.
+
+# Look to see if LINUX_GIT is set in local .bashrc
+if[ -f ~/.bashrc ]
+then
+    source ~/.bashrc
+fi
+
+if [ ! -d "$LINUX_GIT" ]; then
+    echo "error: set \$LINUX_GIT to point at upstream git tree"
+    exit 1
+fi
+
+VER=$(grep patch sources | head -n1 | awk '{ print $2 }' | sed s/patch-// | sed s/-git.*// | sed s/.xz//)
+
+if [ -z "$VER" ] ;
+then
+	VER=$(grep linux sources | head -1 | awk '{ print $2 }' | sed s/linux-// | sed s/.tar.xz//)
+fi
+
+OLDGIT=$(grep gitrev kernel.spec | head -n1 | sed s/%define\ gitrev\ //)
+export NEWGIT=$(($OLDGIT+1))
+
+pushd $LINUX_GIT
+
+git diff v$VER.. > /tmp/patch-$VER-git$NEWGIT
+xz -9 /tmp/patch-$VER-git$NEWGIT
+DESC=$(git describe)
+git rev-list --max-count=1 HEAD > /tmp/gitrev
+popd
+
+mv /tmp/patch-$VER-git$NEWGIT.xz .
+mv /tmp/gitrev .
+
+perl -p -i -e 's|%global baserelease.*|%global baserelease 0|' kernel.spec
+
+perl -p -i -e 's|%define gitrev.*|%define gitrev $ENV{'NEWGIT'}|' kernel.spec
+
+rpmdev-bumpspec -c "Linux $DESC" kernel.spec
--
2.7.4

_______________________________________________
kernel mailing list
kernel@xxxxxxxxxxxxxxxxxxxxxxx
https://lists.fedoraproject.org/admin/lists/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux