Skip to content

Commit f311a99

Browse files
committed
Release v34-2
1 parent 819b8f9 commit f311a99

10 files changed

+36
-32
lines changed

GNUmakefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ specl_verbose_1 = --verbose --formatter=report
2222

2323
include Makefile
2424

25-
MKROCKSPECS = $(ROCKSPEC_ENV) $(LUA) $(srcdir)/mkrockspecs.lua
25+
ROCKSPEC_ENV = $(LUA_ENV)
26+
MKROCKSPECS = $(ROCKSPEC_ENV) $(LUA) $(srcdir)/mkrockspecs.lua
2627
ROCKSPEC_TEMPLATE = $(srcdir)/$(PACKAGE)-rockspec.lua
2728

2829
luarocks-config.lua:
@@ -41,7 +42,7 @@ GIT ?= git
4142

4243
tag-release:
4344
$(GIT) diff --exit-code && \
44-
$(GIT) tag -f -a -m "Release tag" v$(VERSION)
45+
$(GIT) tag -f -a -m "Release tag" v$(VERSION)-2
4546

4647
define unpack-distcheck-release
4748
rm -rf $(PACKAGE)-$(VERSION)/ && \
@@ -58,24 +59,24 @@ check-in-release: distcheck
5859
cd ../$(PACKAGE)-release && \
5960
$(unpack-distcheck-release) && \
6061
$(GIT) add . && \
61-
$(GIT) commit -a -m "Release v$(VERSION)" && \
62-
$(GIT) tag -f -a -m "Full source release tag" release-v$(VERSION)
62+
$(GIT) commit -a -m "Release v$(VERSION)-2" && \
63+
$(GIT) tag -f -a -m "Full source release tag" release-v$(VERSION)-2
6364

6465

6566
## To test the release process without publishing upstream, use:
6667
## make release WOGER=: GIT_PUBLISH=:
6768
GIT_PUBLISH ?= $(GIT)
6869
WOGER ?= woger
6970

70-
WOGER_ENV = LUA_INIT= LUA_PATH='$(abs_srcdir)/?-git-1.rockspec'
71+
WOGER_ENV = LUA_INIT= LUA_PATH='$(abs_srcdir)/?-git-2.rockspec'
7172
WOGER_OUT = $(WOGER_ENV) $(LUA) -l$(PACKAGE) -e
7273

7374
release: rockspecs
7475
$(MAKE) tag-release && \
7576
$(MAKE) check-in-release && \
7677
$(GIT_PUBLISH) push && $(GIT_PUBLISH) push --tags && \
7778
LUAROCKS_CONFIG=$(abs_srcdir)/luarocks-config.lua luarocks \
78-
--tree=$(abs_srcdir)/luarocks build $(PACKAGE)-$(VERSION)-1.rockspec && \
79+
--tree=$(abs_srcdir)/luarocks build $(PACKAGE)-$(VERSION)-2.rockspec && \
7980
$(WOGER) lua \
8081
package=$(PACKAGE) \
8182
package_name=$(PACKAGE_NAME) \

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ AM_DEFAULT_VERBOSITY = 0
160160
AUTOCONF = ${SHELL} /Users/gary/Devo/stdlib-release/build-aux/missing autoconf
161161
AUTOHEADER = ${SHELL} /Users/gary/Devo/stdlib-release/build-aux/missing autoheader
162162
AUTOMAKE = ${SHELL} /Users/gary/Devo/stdlib-release/build-aux/missing automake-1.13
163-
AWK = gawk
163+
AWK = awk
164164
CYGPATH_W = echo
165165
DEFS = -DPACKAGE_NAME=\"stdlib\" -DPACKAGE_TARNAME=\"stdlib\" -DPACKAGE_VERSION=\"34\" -DPACKAGE_STRING=\"stdlib\ 34\" -DPACKAGE_BUGREPORT=\"rrt@sc3d.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"stdlib\" -DVERSION=\"34\"
166166
ECHO_C = \c

mkrockspecs.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ end
3232

3333
for f, spec in pairs (loadfile ("rockspecs.lua") ()) do
3434
if f ~= "default" then
35-
local specfile = package_name.."-"..(f ~= "" and f:lower ().."-" or "")..version.."-1.rockspec"
35+
local specfile = package_name.."-"..(f ~= "" and f:lower ().."-" or "")..version.."-2.rockspec"
3636
h = io.open (specfile, "w")
3737
assert (h)
3838
flavour = f -- a global, visible in loadfile

rockspecs.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local version_dashed = version:gsub ("%.", "-")
1010

1111
local default = {
1212
package = package_name,
13-
version = version.."-1",
13+
version = version.."-2",
1414
source = {
1515
url = "git://github.com/rrthomas/lua-stdlib.git",
1616
},

specs/getopt_spec.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ specify getopt:
1212
}
1313
}
1414
15-
function test (cmdLine, undefined_opts)
16-
local nonOpts, opts, errors = getopt.getOpt (cmdLine, prog.options, undefined_opts)
15+
function test (cmdLine, stop_at_nonopt)
16+
local nonOpts, opts, errors = getopt.getOpt (cmdLine, prog.options, stop_at_nonopt)
1717
if #errors == 0 then
1818
return { options = opts, args = nonOpts }
1919
else
@@ -35,9 +35,9 @@ specify getopt:
3535
args = {} })
3636
- it diagnoses unrecognized options:
3737
expect (test {"-foo"}).should_contain "unrecognized option `-foo'"
38-
- it allows unrecognized options if told to:
39-
expect (test ({"-foo"}, true)).should_equal (
40-
{ options = { foo = {1}}, args = {} })
38+
- it stops option parsing at the first non-option if told to:
39+
expect (test ({"foo", "-bar"}, true)).should_equal (
40+
{ options = {}, args = {"foo", "-bar"} })
4141

4242
- "describe getopt.usageInfo":
4343
- context when specifying options:

src/files/getopt.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ <h2>Functions</h2>
172172
<table class="function_list">
173173

174174
<tr>
175-
<td class="name" nowrap><a href="#getOpt">getOpt</a>&nbsp;(argIn, options, undefined_options)</td>
175+
<td class="name" nowrap><a href="#getOpt">getOpt</a>&nbsp;(argIn, options, stop_at_nonopt)</td>
176176
<td class="summary">Perform argument processing </td>
177177
</tr>
178178

@@ -182,7 +182,7 @@ <h2>Functions</h2>
182182
</tr>
183183

184184
<tr>
185-
<td class="name" nowrap><a href="#processArgs">processArgs</a>&nbsp;(prog, undefined_opts)</td>
185+
<td class="name" nowrap><a href="#processArgs">processArgs</a>&nbsp;(prog, ...)</td>
186186
<td class="summary">Simple getOpt wrapper.</td>
187187
</tr>
188188

@@ -214,7 +214,7 @@ <h2><a name="functions"></a>Functions</h2>
214214

215215

216216

217-
<dt><a name="getOpt"></a><strong>getOpt</strong>&nbsp;(argIn, options, undefined_options)</dt>
217+
<dt><a name="getOpt"></a><strong>getOpt</strong>&nbsp;(argIn, options, stop_at_nonopt)</dt>
218218
<dd>
219219
Perform argument processing
220220

@@ -231,7 +231,7 @@ <h3>Parameters</h3>
231231
</li>
232232

233233
<li>
234-
undefined_options: if true, allow and collect undefined options
234+
stop_at_nonopt: if true, stop option processing at first non-option
235235
</li>
236236

237237
</ul>
@@ -285,7 +285,7 @@ <h3>Parameters</h3>
285285

286286

287287

288-
<dt><a name="processArgs"></a><strong>processArgs</strong>&nbsp;(prog, undefined_opts)</dt>
288+
<dt><a name="processArgs"></a><strong>processArgs</strong>&nbsp;(prog, ...)</dt>
289289
<dd>
290290
Simple getOpt wrapper. If the caller didn't supply their own already, adds <code>--version</code>/<code>-V</code> and <code>--help</code>/<code>-h</code> options automatically; stops program if there was an error, or if <code>--help</code> or <code>--version</code> was used.
291291

@@ -298,7 +298,7 @@ <h3>Parameters</h3>
298298
</li>
299299

300300
<li>
301-
undefined_opts: if true, allow and collect undefined options
301+
...: extra arguments for getOpt
302302
</li>
303303

304304
</ul>

src/getopt.lua

+12-9
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ local M = {
4444
--- Perform argument processing
4545
-- @param argIn list of command-line args
4646
-- @param options options table
47-
-- @param undefined_options if true, allow and collect undefined options
47+
-- @param stop_at_nonopt if true, stop option processing at first non-option
4848
-- @return table of remaining non-options
4949
-- @return table of option key-value list pairs
5050
-- @return table of error messages
51-
local function getOpt (argIn, options, undefined_options)
51+
local function getOpt (argIn, options, stop_at_nonopt)
5252
local noProcess = nil
5353
local argOut, optOut, errors = {[0] = argIn[0]}, {}, {}
5454
-- get an argument for option opt
@@ -74,7 +74,7 @@ local function getOpt (argIn, options, undefined_options)
7474

7575
local function parseOpt (opt, arg)
7676
local o = options.name[opt]
77-
if undefined_options or o ~= nil then
77+
if o ~= nil then
7878
o = o or {name = {opt}}
7979
optOut[o.name[1]] = optOut[o.name[1]] or {}
8080
table.insert (optOut[o.name[1]], getArg (o, opt, arg, optOut[o.name[1]]))
@@ -87,9 +87,12 @@ local function getOpt (argIn, options, undefined_options)
8787
table.remove (argIn, 1)
8888
local _, _, dash, opt = string.find (v, "^(%-%-?)([^=-][^=]*)")
8989
local _, _, arg = string.find (v, "=(.*)$")
90+
if not dash and stop_at_nonopt then
91+
noProcess = true
92+
end
9093
if v == "--" then
91-
noProcess = 1
92-
elseif dash == nil or noProcess then -- non-option
94+
noProcess = true
95+
elseif not dash or noProcess then -- non-option
9396
table.insert (argOut, v)
9497
else -- option
9598
parseOpt (opt, arg)
@@ -242,12 +245,12 @@ end
242245
-- stops program if there was an error, or if <code>--help</code> or
243246
-- <code>--version</code> was used.
244247
-- @param prog table of named parameters
245-
-- @param undefined_opts if true, allow and collect undefined options
246-
local function processArgs (prog, undefined_opts)
247-
local totArgs = #arg
248+
-- @param ... extra arguments for getOpt
249+
local function processArgs (prog, ...)
250+
local totArgs = #_G.arg
248251
local errors
249252
prog.options = makeOptions (prog.options)
250-
_G.arg, M.opt, errors = getOpt (arg, prog.options, undefined_opts)
253+
_G.arg, M.opt, errors = getOpt (_G.arg, prog.options, ...)
251254
local opt = M.opt
252255
if (opt.version or opt.help) and prog.banner then
253256
io.writelines (prog.banner)

stdlib-34-1.rockspec renamed to stdlib-34-2.rockspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "34-1"
1+
version = "34-2"
22
source = {
33
branch = "release-v34",
44
url = "git://github.com/rrthomas/lua-stdlib.git",

stdlib-git-1.rockspec renamed to stdlib-git-2.rockspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "git-1"
1+
version = "git-2"
22
source = {
33
url = "git://github.com/rrthomas/lua-stdlib.git",
44
}

stdlib.rockspec.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package="stdlib"
2-
version="@VERSION@-1"
2+
version="@VERSION@-2"
33
source = {
44
url = "git://github.com/rrthomas/lua-stdlib.git",
55
branch = "release-v@VERSION@",

0 commit comments

Comments
 (0)