aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2020-09-25 15:47:32 -0300
committerHisham Muhammad <hisham@gobolinux.org>2020-09-25 15:47:58 -0300
commit8499d5afd71e86bf3487f3c28ba509cc8b1cc823 (patch)
tree295c1c8fc646831236faac5144216ef5cb30783d
parent726998af923b353a858624bdb718a77c0d653a75 (diff)
downloadluarocks-8499d5afd71e86bf3487f3c28ba509cc8b1cc823.tar.gz
luarocks-8499d5afd71e86bf3487f3c28ba509cc8b1cc823.tar.bz2
luarocks-8499d5afd71e86bf3487f3c28ba509cc8b1cc823.zip
makedist: fix argument handling
-rwxr-xr-xmakedist24
1 files changed, 13 insertions, 11 deletions
diff --git a/makedist b/makedist
index c28e9247..94090a1f 100755
--- a/makedist
+++ b/makedist
@@ -14,15 +14,17 @@ fi
14 14
15make clean || exit 1 15make clean || exit 1
16 16
17version=$1
18shift
19
17if [ "$1" != "dev" ] 20if [ "$1" != "dev" ]
18then 21then
19 22
20ROCKSPEC="luarocks-$1-1.rockspec" 23ROCKSPEC="luarocks-$version-1.rockspec"
21 24
22if [ "$1" = "branch" ] 25if [ "$1" = "branch" ]
23then 26then
24 shift 27 shift
25 version=$1
26 28
27 if git show $version &> /dev/null 29 if git show $version &> /dev/null
28 then 30 then
@@ -33,7 +35,7 @@ then
33 git reset 35 git reset
34 git checkout . 36 git checkout .
35 git checkout -B $version 37 git checkout -B $version
36 ROCKSPEC="luarocks-$1-1.rockspec" 38 ROCKSPEC="luarocks-$version-1.rockspec"
37 currentrockspec=$(ls luarocks-*.rockspec) 39 currentrockspec=$(ls luarocks-*.rockspec)
38 if [ "$currentrockspec" != "$ROCKSPEC" ] && ! [ -e "$ROCKSPEC" ] 40 if [ "$currentrockspec" != "$ROCKSPEC" ] && ! [ -e "$ROCKSPEC" ]
39 then 41 then
@@ -66,38 +68,38 @@ fi
66 echo "$ROCKSPEC is missing. Please check rockspec version is correct." 68 echo "$ROCKSPEC is missing. Please check rockspec version is correct."
67} 69}
68 70
69grep -q "LuaRocks version $1" "configure" || { 71grep -q "LuaRocks version $version" "configure" || {
70 echo 72 echo
71 echo "version in configure is incorrect. Please fix it." 73 echo "version in configure is incorrect. Please fix it."
72 exit 1 74 exit 1
73} 75}
74 76
75grep -q "\"$1-1\"" "$ROCKSPEC" || { 77grep -q "\"$version-1\"" "$ROCKSPEC" || {
76 echo 78 echo
77 echo "version in rockspec is incorrect. Please fix it." 79 echo "version in rockspec is incorrect. Please fix it."
78 exit 1 80 exit 1
79} 81}
80 82
81grep -q "program_version = \"$1\"" src/luarocks/core/cfg.lua || { 83grep -q "program_version = \"$version\"" src/luarocks/core/cfg.lua || {
82 echo 84 echo
83 echo "program_version in src/luarocks/core/cfg.lua is incorrect. Please fix it." 85 echo "program_version in src/luarocks/core/cfg.lua is incorrect. Please fix it."
84 exit 1 86 exit 1
85} 87}
86 88
87grep -q "version: $1\\." appveyor.yml || { 89grep -q "version: $version\\." appveyor.yml || {
88 echo 90 echo
89 echo "version in appveyor.yml is incorrect. Please fix it." 91 echo "version in appveyor.yml is incorrect. Please fix it."
90 exit 1 92 exit 1
91} 93}
92 94
93grep -q "LUAROCKS_VER: $1" appveyor.yml || { 95grep -q "LUAROCKS_VER: $version" appveyor.yml || {
94 echo 96 echo
95 echo "LUAROCKS_VER in appveyor.yml is incorrect. Please fix it." 97 echo "LUAROCKS_VER in appveyor.yml is incorrect. Please fix it."
96 exit 1 98 exit 1
97} 99}
98 100
99# e.g. if $1 is "2.3.0", $program_series is "2.3" 101# e.g. if $version is "2.3.0", $program_series is "2.3"
100program_series=${1%.*} 102program_series=${version%.*}
101 103
102grep -q "program_series = \"$program_series\"" src/luarocks/core/cfg.lua || { 104grep -q "program_series = \"$program_series\"" src/luarocks/core/cfg.lua || {
103 echo 105 echo
@@ -113,7 +115,7 @@ grep -q "vars.VERSION = \"$program_series\"" install.bat || {
113 115
114fi 116fi
115 117
116out="luarocks-$1" 118out="luarocks-$version"
117rm -rf "$out" 119rm -rf "$out"
118mkdir "$out" 120mkdir "$out"
119 121