[PATCHv2] generate-git-snapshot.sh

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

 



The script requires  LINUX_GIT to be set, preferably, in your
local .bashrc. I added a quick check to see if .bashrc exits
and check it first to see if LINUX_GIT is set there.

Fixed the comment size to be less the 80 characters per line
and tried to make some of the code fit the same description.

Signed-off-by: Miguel Flores Silverio <floresmigu3l@xxxxxxxxx>
---
 scripts/generate-git-snapshot.sh | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/scripts/generate-git-snapshot.sh b/scripts/generate-git-snapshot.sh
index 3da20a1..972fd21 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\ //)
--
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