-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
rockspecs/lpugl-0.0.1-1.rockspec → rockspecs/lpugl-0.0.2-1.rockspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
rockspecs/lpugl_cairo-0.0.1-1.rockspec → rockspecs/lpugl_cairo-0.0.2-1.rockspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
rockspecs/lpugl_opengl-0.0.1-1.rockspec → rockspecs/lpugl_opengl-0.0.2-1.rockspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/lua | ||
|
||
os.setlocale("C") | ||
|
||
local format = string.format | ||
local lfs = require("lfs") | ||
|
||
local version = ... | ||
assert(version:match("^%d+%.%d+%.%d+$"), format("invalid version %q", version)) | ||
|
||
for fileName in lfs.dir(".") do | ||
local p1, v, p2 = fileName:match("^(lpugl.*%-)(%d+%.%d+%.%d+)(%-%d+%.rockspec)$") | ||
if p1 then | ||
local newName = p1..version..p2 | ||
print(format("%-30s -> %s", fileName, newName)) | ||
local out = {} | ||
local matched = false | ||
local inFile = io.open(fileName, "r") | ||
for line in inFile:lines() do | ||
local l1, l2 = line:match("^(%s*version%s*%=%s*\")%d+%.%d+%.%d+(%-%d+\"%s*)$") | ||
if l1 then | ||
assert(not matched) | ||
matched = true | ||
out[#out+1] = l1..version..l2 | ||
else | ||
out[#out+1] = line | ||
end | ||
end | ||
out[#out+1] = "" | ||
inFile:close() | ||
assert(matched) | ||
local newFile, err = io.open(newName, "w") | ||
assert(newFile, err) | ||
newFile:write(table.concat(out, "\n")) | ||
newFile:close() | ||
if fileName ~= newName then | ||
os.remove(fileName) | ||
end | ||
end | ||
end |