From: Hannu Nyman Date: Fri, 11 Mar 2016 12:09:39 +0000 (+0200) Subject: luci-base: Include Openwrt build revision in displayed version string X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f1190e2d07f76735e0927704de7a5cf8b37998d0;p=oweals%2Fluci.git luci-base: Include Openwrt build revision in displayed version string The version string displayed in the footer and the overview page contains both LuCI and Openwrt versions. But due to differences in the contents of /etc/openwrt_release the exact Openwrt revision r..... may be missing: * In trunk that revision is included in the DISTRIB_DESCRIPTION field that is displayed in Luci as the Openwrt version. * In release branches, that field contains the release number like 15.05. Revision number is always present in DISTRIB_REVISION field, so add the revision from that field in case the revision is not already present in the string. Signed-off-by: Hannu Nyman (cherry picked from commit 50451c4ac53c853cbf2837e7bfbbc1268a440180) --- diff --git a/modules/luci-base/src/mkversion.sh b/modules/luci-base/src/mkversion.sh index 33c7a3ffe..e3ef97448 100755 --- a/modules/luci-base/src/mkversion.sh +++ b/modules/luci-base/src/mkversion.sh @@ -8,6 +8,12 @@ module "luci.version" if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then distname = "" distversion = _G.DISTRIB_DESCRIPTION + if _G.DISTRIB_REVISION then + distrevision = _G.DISTRIB_REVISION + if not distversion:find(distrevision) then + distversion = distversion .. " " .. distrevision + end + end else distname = "OpenWrt" distversion = "Development Snapshot"