File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package = " mtmsg"
2- version = " 0.4.1 -1"
2+ version = " 0.4.2 -1"
33local versionNumber = version :gsub (" ^(.*)-.-$" , " %1" )
44source = {
55 url = " https://github.com/osch/lua-mtmsg/archive/v" .. versionNumber .. " .zip" ,
@@ -42,8 +42,11 @@ build = {
4242 " src/util.c" ,
4343 " src/async_util.c" ,
4444 " src/mtmsg_compat.c" ,
45+ " src/receiver_capi_impl.c" ,
46+ " src/notify_capi_impl.c" ,
47+ " src/sender_capi_impl.c" ,
4548 },
4649 defines = { " MTMSG_VERSION=" .. versionNumber },
4750 },
4851 }
49- }
52+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/lua
2+
3+ os.setlocale (" C" )
4+
5+ local format = string.format
6+ local lfs = require (" lfs" )
7+
8+ local version = ...
9+ assert (version :match (" ^%d+%.%d+%.%d+$" ), format (" invalid version %q" , version ))
10+
11+ for fileName in lfs .dir (" ." ) do
12+ local p1 , v , p2 = fileName :match (" ^(mtmsg%-)(%d+%.%d+%.%d+)(%-%d+%.rockspec)$" )
13+ if p1 then
14+ local newName = p1 .. version .. p2
15+ print (format (" %-30s -> %s" , fileName , newName ))
16+ local out = {}
17+ local matched = false
18+ local inFile = io.open (fileName , " r" )
19+ for line in inFile :lines () do
20+ local l1 , l2 = line :match (" ^(%s*version%s*%=%s*\" )%d+%.%d+%.%d+(%-%d+\" %s*)$" )
21+ if l1 then
22+ assert (not matched )
23+ matched = true
24+ out [# out + 1 ] = l1 .. version .. l2
25+ else
26+ out [# out + 1 ] = line
27+ end
28+ end
29+ out [# out + 1 ] = " "
30+ inFile :close ()
31+ assert (matched )
32+ local newFile , err = io.open (newName , " w" )
33+ assert (newFile , err )
34+ newFile :write (table.concat (out , " \n " ))
35+ newFile :close ()
36+ if fileName ~= newName then
37+ os.remove (fileName )
38+ end
39+ end
40+ end
You can’t perform that action at this time.
0 commit comments