build: add mkversion.sh helper script

contrib: (re-)generate version.lua at build time
libs/core: use version.lua
themes: adept header to version.lua, fix css for openwrt.org
This commit is contained in:
Jo-Philipp Wich 2009-01-17 16:35:02 +00:00
parent f2148a5c65
commit 89c8f98b12
8 changed files with 54 additions and 10 deletions

21
build/mkversion.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
local variant
if [ "${4%%/*}" = "branches" ]; then
variant="LuCI ${4##*[-/]} Branch"
elif [ "${4%%/*}" = "tags" ]; then
variant="LuCI ${4##*[-/]} Release"
else
variant="LuCI Trunk"
fi
cat <<EOF > $1
module "luci.version"
distname = "${2:-OpenWrt}"
distversion = "${3:-Development Snapshot}"
luciname = "$variant"
luciversion = "${5:-svn}"
EOF

View file

@ -106,6 +106,11 @@ endef
define Package/luci-core/install define Package/luci-core/install
$(call Package/luci/install/template,$(1),libs/core) $(call Package/luci/install/template,$(1),libs/core)
$(PKG_BUILD_DIR)/build/mkversion.sh $(1)/usr/lib/lua/luci/version.lua \
"OpenWrt Firmware" \
"$(OPENWRTVERSION)" \
"$(PKG_BRANCH)" \
"$(PKG_VERSION)"
endef endef
define Package/luci-core/config define Package/luci-core/config

View file

@ -23,7 +23,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
]]-- ]]--
local require = require
module "luci" module "luci"
__version__ = "0.9" local v = require "luci.version"
__appname__ = "LuCI"
__version__ = v.luciversion or "0.9"
__appname__ = v.luciname or "LuCI"

View file

@ -0,0 +1,12 @@
--[[
LuCI - Lua Configuration Interface
Version definition - do not edit this file
]]--
module "luci.version"
distname = "Host System"
distversion = "SDK"
luciname = "LuCI"
luciversion = "SVN"

View file

@ -59,9 +59,9 @@ require("luci.http").prepare_content("application/xhtml+xml")
</p> </p>
<div id="header"> <div id="header">
<h1><%=luci.config.brand.firmware%></h1> <h1><%=luci.version.distname%></h1>
<p> <p>
(<%=luci.config.brand.distro%>) | : <%=luci.version.distversion%> |
<%:load%>: <%=load1%> <%=load5%> <%=load15%> | <%:load%>: <%=load1%> <%=load5%> <%=load15%> |
<%:hostname%>: <%=hostname%> <%:hostname%>: <%=hostname%>
</p> </p>

View file

@ -61,9 +61,9 @@ require("luci.http").prepare_content("application/xhtml+xml")
</p> </p>
<div id="header"> <div id="header">
<h1><%=luci.config.brand.firmware%></h1> <h1><%=luci.version.distname%></h1>
<p> <p>
<%=luci.config.brand.distro%><br /> <%=luci.version.distversion%><br />
<%:load%>: <%=load1%> <%=load5%> <%=load15%><br /> <%:load%>: <%=load1%> <%=load5%> <%=load15%><br />
<%:hostname%>: <%=hostname%> <%:hostname%>: <%=hostname%>
</p> </p>

View file

@ -9,6 +9,7 @@ body {
background-position: bottom center; background-position: bottom center;
background-repeat: repeat-x; background-repeat: repeat-x;
color: #ffffff; color: #ffffff;
height: 100%;
} }
body { body {

View file

@ -59,9 +59,9 @@ require("luci.http").prepare_content("application/xhtml+xml")
</p> </p>
<div id="header"> <div id="header">
<h1><%=luci.config.brand.firmware%></h1> <h1><%=luci.version.distname%></h1>
<p> <p>
<%=luci.config.brand.distro%><br /> <%=luci.version.distversion%><br />
<%:load%>: <%=load1%> <%=load5%> <%=load15%><br /> <%:load%>: <%=load1%> <%=load5%> <%=load15%><br />
<%:hostname%>: <%=hostname%> <%:hostname%>: <%=hostname%>
</p> </p>