From 19eedb476cbcd88606f4699fb1a57fb365b31251 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sat, 16 Apr 2022 16:25:47 -0300 Subject: Configurations for program_series and major_version are unused They look like useless maintenance burden, and I seriously doubt anyone uses those in their config files. In any case, they're easy to derive from cfg.program_version. --- makedist | 22 ++++++++-------------- src/luarocks/core/cfg.lua | 4 ---- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/makedist b/makedist index 8abde3c4..2a7b3e25 100755 --- a/makedist +++ b/makedist @@ -17,9 +17,13 @@ make clean || exit 1 version=$1 shift +#------------------------------------------------------------------------------- if ! [ "$version" = "dev" ] then +# e.g. if $version is "2.3.0", $xyversion is "2.3" +xyversion=${version%.*} + ROCKSPEC="luarocks-$version-1.rockspec" if [ "$1" = "branch" ] @@ -47,9 +51,7 @@ then sed -i 's/program_version = "[^"]*"/program_version = "'$version'"/' src/luarocks/core/cfg.lua sed -i 's/version: [0-9.]*/version: '$version'./' appveyor.yml sed -i 's/LUAROCKS_VER: [0-9.]*/LUAROCKS_VER: '$version'/' appveyor.yml - program_series=${version%.*} - sed -i 's/program_series = "[0-9.]*"/program_series = "'$program_series'"/' src/luarocks/core/cfg.lua - sed -i 's/vars.VERSION = "[0-9.]*"/vars.VERSION = "'$program_series'"/' install.bat + sed -i 's/vars.VERSION = "[0-9.]*"/vars.VERSION = "'$xyversion'"/' install.bat echo "===============================================================================" git diff echo "===============================================================================" @@ -98,22 +100,14 @@ grep -q "LUAROCKS_VER: $version" appveyor.yml || { exit 1 } -# e.g. if $version is "2.3.0", $program_series is "2.3" -program_series=${version%.*} - -grep -q "program_series = \"$program_series\"" src/luarocks/core/cfg.lua || { - echo - echo "program_series in src/luarocks/core/cfg.lua is incorrect. Please fix it." - exit 1 -} - -grep -q "vars.VERSION = \"$program_series\"" install.bat || { +grep -q "vars.VERSION = \"$xyversion\"" install.bat || { echo echo "vars.VERSION in install.bat is incorrect. Please fix it." exit 1 } -fi +fi # if ! [ "$version" = "dev" ] +#------------------------------------------------------------------------------- out="luarocks-$version" rm -rf "$out" diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 79ae0417..5b406121 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -21,8 +21,6 @@ local vers = require("luarocks.core.vers") -------------------------------------------------------------------------------- local program_version = "dev" -local program_series = "3.0" -local major_version = (program_version:match("([^.]%.[^.])")) or program_series local is_windows = package.config:sub(1,1) == "\\" @@ -604,8 +602,6 @@ function cfg.init(detected, warning) end cfg.program_version = program_version - cfg.program_series = program_series - cfg.major_version = major_version if hardcoded.IS_BINARY then cfg.is_binary = true -- cgit v1.2.3-55-g6feb