mkversion.sh 536 B

12345678910111213141516171819202122232425
  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. cat <<EOF > $1
  10. local pcall, dofile, _G = pcall, dofile, _G
  11. module "luci.version"
  12. if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then
  13. distname = ""
  14. distversion = _G.DISTRIB_DESCRIPTION
  15. else
  16. distname = "${2:-OpenWrt}"
  17. distversion = "${3:-Development Snapshot}"
  18. end
  19. luciname = "$variant"
  20. luciversion = "${5:-svn}"
  21. EOF