build: Bail out the build if any lua compilation fails. (Patch from Fon-NG, http...
[project/luci.git] / build / mkversion.sh
1 #!/bin/sh
2 if [ "${4%%/*}" = "branches" ]; then
3 variant="LuCI ${4##*[-/]} Branch"
4 elif [ "${4%%/*}" = "tags" ]; then
5 variant="LuCI ${4##*[-/]} Release"
6 else
7 variant="LuCI Trunk"
8 fi
9
10 cat <<EOF > $1
11 local pcall, dofile, _G = pcall, dofile, _G
12
13 module "luci.version"
14
15 if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then
16 distname = ""
17 distversion = _G.DISTRIB_DESCRIPTION
18 else
19 distname = "${2:-OpenWrt}"
20 distversion = "${3:-Development Snapshot}"
21 end
22
23 luciname = "$variant"
24 luciversion = "${5:-svn}"
25 EOF