aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2022-04-16 16:25:47 -0300
committerHisham Muhammad <hisham@gobolinux.org>2022-04-16 16:25:47 -0300
commit19eedb476cbcd88606f4699fb1a57fb365b31251 (patch)
tree884b87814817d746937ac2ea55307d5770da9c17
parentfbd3566a312e647cde57b5d774533731e1aa844d (diff)
downloadluarocks-19eedb476cbcd88606f4699fb1a57fb365b31251.tar.gz
luarocks-19eedb476cbcd88606f4699fb1a57fb365b31251.tar.bz2
luarocks-19eedb476cbcd88606f4699fb1a57fb365b31251.zip
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.
-rwxr-xr-xmakedist22
-rw-r--r--src/luarocks/core/cfg.lua4
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
17version=$1 17version=$1
18shift 18shift
19 19
20#-------------------------------------------------------------------------------
20if ! [ "$version" = "dev" ] 21if ! [ "$version" = "dev" ]
21then 22then
22 23
24# e.g. if $version is "2.3.0", $xyversion is "2.3"
25xyversion=${version%.*}
26
23ROCKSPEC="luarocks-$version-1.rockspec" 27ROCKSPEC="luarocks-$version-1.rockspec"
24 28
25if [ "$1" = "branch" ] 29if [ "$1" = "branch" ]
@@ -47,9 +51,7 @@ then
47 sed -i 's/program_version = "[^"]*"/program_version = "'$version'"/' src/luarocks/core/cfg.lua 51 sed -i 's/program_version = "[^"]*"/program_version = "'$version'"/' src/luarocks/core/cfg.lua
48 sed -i 's/version: [0-9.]*/version: '$version'./' appveyor.yml 52 sed -i 's/version: [0-9.]*/version: '$version'./' appveyor.yml
49 sed -i 's/LUAROCKS_VER: [0-9.]*/LUAROCKS_VER: '$version'/' appveyor.yml 53 sed -i 's/LUAROCKS_VER: [0-9.]*/LUAROCKS_VER: '$version'/' appveyor.yml
50 program_series=${version%.*} 54 sed -i 's/vars.VERSION = "[0-9.]*"/vars.VERSION = "'$xyversion'"/' install.bat
51 sed -i 's/program_series = "[0-9.]*"/program_series = "'$program_series'"/' src/luarocks/core/cfg.lua
52 sed -i 's/vars.VERSION = "[0-9.]*"/vars.VERSION = "'$program_series'"/' install.bat
53 echo "===============================================================================" 55 echo "==============================================================================="
54 git diff 56 git diff
55 echo "===============================================================================" 57 echo "==============================================================================="
@@ -98,22 +100,14 @@ grep -q "LUAROCKS_VER: $version" appveyor.yml || {
98 exit 1 100 exit 1
99} 101}
100 102
101# e.g. if $version is "2.3.0", $program_series is "2.3" 103grep -q "vars.VERSION = \"$xyversion\"" install.bat || {
102program_series=${version%.*}
103
104grep -q "program_series = \"$program_series\"" src/luarocks/core/cfg.lua || {
105 echo
106 echo "program_series in src/luarocks/core/cfg.lua is incorrect. Please fix it."
107 exit 1
108}
109
110grep -q "vars.VERSION = \"$program_series\"" install.bat || {
111 echo 104 echo
112 echo "vars.VERSION in install.bat is incorrect. Please fix it." 105 echo "vars.VERSION in install.bat is incorrect. Please fix it."
113 exit 1 106 exit 1
114} 107}
115 108
116fi 109fi # if ! [ "$version" = "dev" ]
110#-------------------------------------------------------------------------------
117 111
118out="luarocks-$version" 112out="luarocks-$version"
119rm -rf "$out" 113rm -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")
21-------------------------------------------------------------------------------- 21--------------------------------------------------------------------------------
22 22
23local program_version = "dev" 23local program_version = "dev"
24local program_series = "3.0"
25local major_version = (program_version:match("([^.]%.[^.])")) or program_series
26 24
27local is_windows = package.config:sub(1,1) == "\\" 25local is_windows = package.config:sub(1,1) == "\\"
28 26
@@ -604,8 +602,6 @@ function cfg.init(detected, warning)
604 end 602 end
605 603
606 cfg.program_version = program_version 604 cfg.program_version = program_version
607 cfg.program_series = program_series
608 cfg.major_version = major_version
609 605
610 if hardcoded.IS_BINARY then 606 if hardcoded.IS_BINARY then
611 cfg.is_binary = true 607 cfg.is_binary = true