OSDN Git Service

Include the upstream toybox version in "toybox --version".
authorElliott Hughes <enh@google.com>
Thu, 11 Feb 2016 04:00:09 +0000 (20:00 -0800)
committerElliott Hughes <enh@google.com>
Thu, 11 Feb 2016 21:47:59 +0000 (13:47 -0800)
SHAs have their uses, but upstream version numbers are better for getting
a quick ballpark figure for the version.

Before:
  afc66714a4e3-android

After:
  0.7.0-afc66714a4e3-android

(cherry picked from commit 35c9c63120a40f4cfe119f5670d914ac5e69c0f6)

Change-Id: I631b220135560023aa114d2fd6c324633afb8dcc

Android.mk

index f2167ef..8c112ce 100644 (file)
@@ -212,7 +212,10 @@ LOCAL_CFLAGS += \
     -ffunction-sections -fdata-sections \
     -fno-asynchronous-unwind-tables \
 
-toybox_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
+toybox_upstream_version := $(shell awk 'match($$0, /TOYBOX_VERSION.*"(.*)"/, ary) {print ary[1]}' $(LOCAL_PATH)/main.c)
+toybox_sha := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)
+
+toybox_version := $(toybox_upstream_version)-$(toybox_sha)-android
 LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
 
 LOCAL_CLANG := true