diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2020-09-25 15:47:32 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2020-09-25 15:47:58 -0300 |
commit | 8499d5afd71e86bf3487f3c28ba509cc8b1cc823 (patch) | |
tree | 295c1c8fc646831236faac5144216ef5cb30783d | |
parent | 726998af923b353a858624bdb718a77c0d653a75 (diff) | |
download | luarocks-8499d5afd71e86bf3487f3c28ba509cc8b1cc823.tar.gz luarocks-8499d5afd71e86bf3487f3c28ba509cc8b1cc823.tar.bz2 luarocks-8499d5afd71e86bf3487f3c28ba509cc8b1cc823.zip |
makedist: fix argument handling
-rwxr-xr-x | makedist | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -14,15 +14,17 @@ fi | |||
14 | 14 | ||
15 | make clean || exit 1 | 15 | make clean || exit 1 |
16 | 16 | ||
17 | version=$1 | ||
18 | shift | ||
19 | |||
17 | if [ "$1" != "dev" ] | 20 | if [ "$1" != "dev" ] |
18 | then | 21 | then |
19 | 22 | ||
20 | ROCKSPEC="luarocks-$1-1.rockspec" | 23 | ROCKSPEC="luarocks-$version-1.rockspec" |
21 | 24 | ||
22 | if [ "$1" = "branch" ] | 25 | if [ "$1" = "branch" ] |
23 | then | 26 | then |
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 | ||
69 | grep -q "LuaRocks version $1" "configure" || { | 71 | grep -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 | ||
75 | grep -q "\"$1-1\"" "$ROCKSPEC" || { | 77 | grep -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 | ||
81 | grep -q "program_version = \"$1\"" src/luarocks/core/cfg.lua || { | 83 | grep -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 | ||
87 | grep -q "version: $1\\." appveyor.yml || { | 89 | grep -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 | ||
93 | grep -q "LUAROCKS_VER: $1" appveyor.yml || { | 95 | grep -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" |
100 | program_series=${1%.*} | 102 | program_series=${version%.*} |
101 | 103 | ||
102 | grep -q "program_series = \"$program_series\"" src/luarocks/core/cfg.lua || { | 104 | grep -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 | ||
114 | fi | 116 | fi |
115 | 117 | ||
116 | out="luarocks-$1" | 118 | out="luarocks-$version" |
117 | rm -rf "$out" | 119 | rm -rf "$out" |
118 | mkdir "$out" | 120 | mkdir "$out" |
119 | 121 | ||