From db1af813ff06199f05bfbdb8d24a13c875dd6000 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 3 Apr 2016 07:41:17 +0100 Subject: [PATCH] build: Add git hash in /etc/os-release for all builds --- scripts/image | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/image b/scripts/image index e66e3c03a8..2eb24121a4 100755 --- a/scripts/image +++ b/scripts/image @@ -33,12 +33,13 @@ $SCRIPTS/build populatefs:host BUILD_DATE=`date +%Y%m%d%H%M%S` -if [ "$LIBREELEC_VERSION" = devel ]; then +GIT_HASH=$(git rev-parse HEAD) + +if [ "$LIBREELEC_VERSION" = "devel" ]; then if ! GIT_BUILD=$(git rev-list --count HEAD 2>/dev/null) then GIT_BUILD=$(git rev-list HEAD | wc -l) fi - GIT_HASH=$(git rev-parse HEAD) GIT_ABBREV=$(git log -1 --pretty=format:%h) DEVEL_VERSION=$LIBREELEC_VERSION LIBREELEC_VERSION=$LIBREELEC_VERSION-$BUILD_DATE-r$GIT_BUILD-g$GIT_ABBREV @@ -100,9 +101,7 @@ fi echo -e "PRETTY_NAME=\"$DISTRONAME ($([ "$OFFICIAL" = "yes" ] && echo "official" || echo "community")) - Version: $LIBREELEC_VERSION\"" >> $INSTALL/etc/os-release echo -e "HOME_URL=\"http://www.libreelec.tv\"" >> $INSTALL/etc/os-release echo -e "BUG_REPORT_URL=\"https://github.com/LibreELEC/LibreELEC.tv\"" >> $INSTALL/etc/os-release - if [ -n "$GIT_HASH" ]; then - echo -e "BUILD_ID=\"$GIT_HASH\"" >> $INSTALL/etc/os-release - fi + echo -e "BUILD_ID=\"$GIT_HASH\"" >> $INSTALL/etc/os-release echo -e "OPENELEC_ARCH=\"$PROJECT.$TARGET_ARCH\"" >> $INSTALL/etc/os-release echo -e "LIBREELEC_ARCH=\"$PROJECT.$TARGET_ARCH\"" >> $INSTALL/etc/os-release if [ "$OFFICIAL" = "yes" ]; then @@ -118,7 +117,7 @@ fi echo "$GREETING3" >> $INSTALL/etc/issue echo "$GREETING4" >> $INSTALL/etc/issue echo "$DISTRONAME ($([ "$OFFICIAL" = "yes" ] && echo "official" || echo "community")) Version: $LIBREELEC_VERSION" >> $INSTALL/etc/issue - if [ -n "$GIT_HASH" ]; then + if [ "$DEVEL_VERSION" = "devel" ] ; then echo "$DISTRONAME git: $GIT_HASH" >> $INSTALL/etc/issue fi