summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMiguel Flores Silverio <floresmigu3l@gmail.com>2016-06-21 13:12:16 -0700
committerLaura Abbott <labbott@fedoraproject.org>2016-06-22 17:53:33 -0700
commitfb65b02dcfa012909c25c04910d3c8a5aaa686e8 (patch)
tree08138bb59784f019e9f1eee44493c087f70ecb17 /scripts
parent7d2c2f2d91793b5da452bee9bea4fa32051c8608 (diff)
downloadkernel-fb65b02dcfa012909c25c04910d3c8a5aaa686e8.tar.gz
kernel-fb65b02dcfa012909c25c04910d3c8a5aaa686e8.tar.xz
kernel-fb65b02dcfa012909c25c04910d3c8a5aaa686e8.zip
Set LINUX_GIT in .bashrc for generate-git-snapshot.sh
The script requires LINUX_GIT to be set, preferably, in your local .bashrc. I added a quick check to see if .bashrc exists and check it first to see if LINUX_GIT is set there. [labbott: Tweaked commit text] Signed-off-by: Miguel Flores Silverio <floresmigu3l@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-git-snapshot.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/generate-git-snapshot.sh b/scripts/generate-git-snapshot.sh
index 3da20a1b1..972fd2148 100755
--- a/scripts/generate-git-snapshot.sh
+++ b/scripts/generate-git-snapshot.sh
@@ -1,14 +1,26 @@
#!/bin/sh
+# This script allows for the generation of a git snapshot between the upstream
+# git tree and the current tree.
#
-# Set LINUX_GIT to point to an upstream Linux git tree in your .bashrc or wherever.
+# Prerequisites:
+# Set LINUX_GIT to point to an upstream Linux git tree in your .bashrc
+# or wherever.
-[ ! -d "$LINUX_GIT" ] && echo "error: set \$LINUX_GIT to point at upstream git tree" && exit 1
+# 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//)
+ 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\ //)