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>
This commit is contained in:
Miguel Flores Silverio 2016-06-21 13:12:16 -07:00 committed by Laura Abbott
parent 7d2c2f2d91
commit fb65b02dcf

View File

@ -1,8 +1,20 @@
#!/bin/sh #!/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//) VER=$(grep patch sources | head -n1 | awk '{ print $2 }' | sed s/patch-// | sed s/-git.*// | sed s/.xz//)