[6/8] make.sh: Tidy up Git commands

Message ID 20200211142853.8561-7-michael.tremer@ipfire.org
State Accepted
Commit 36e2e99285e86e46df33933a2783911118a504ce
Headers
Series [1/8] pakfire: Automatically compose $version |

Commit Message

Michael Tremer Feb. 11, 2020, 2:28 p.m. UTC
  No functional changes. Just making them shorter.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 make.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
  

Patch

diff --git a/make.sh b/make.sh
index 34cc35f02..ba393bd65 100755
--- a/make.sh
+++ b/make.sh
@@ -28,15 +28,17 @@  SNAME="ipfire"							# Short name
 VERSION="2.25"							# Version number
 CORE="142"							# Core Level (Filename)
 PAKFIRE_CORE="141"						# Core Level (PAKFIRE)
-GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`			# Git Branch
 SLOGAN="www.ipfire.org"						# Software slogan
 CONFIG_ROOT=/var/ipfire						# Configuration rootdir
 NICE=10								# Nice level
 MAX_RETRIES=1							# prefetch/check loop
 BUILD_IMAGES=1							# Flash and Xen Downloader
 KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
-GIT_TAG=$(git tag | tail -1)					# Git Tag
-GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8)	# Last commit
+
+# Information from Git
+GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"			# Git Branch
+GIT_TAG="$(git tag | tail -1)"					# Git Tag
+GIT_LASTCOMMIT="$(git rev-parse --verify HEAD)"			# Last commit
 
 TOOLCHAINVER=20200108
 
@@ -518,7 +520,7 @@  prepareenv() {
 		SYSTEM_RELEASE="${SYSTEM_RELEASE} - $GIT_BRANCH$GIT_STATUS"
 		;;
 	*)
-		SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build: $GIT_BRANCH/$GIT_LASTCOMMIT$GIT_STATUS"
+		SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build: $GIT_BRANCH/${GIT_LASTCOMMIT:0:8}$GIT_STATUS"
 		;;
 	esac