Skip to content

Instantly share code, notes, and snippets.

@thibaultcha
Last active June 21, 2018 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thibaultcha/038786e9c0d9c07fdad6dcff4a1a2c60 to your computer and use it in GitHub Desktop.
Save thibaultcha/038786e9c0d9c07fdad6dcff4a1a2c60 to your computer and use it in GitHub Desktop.
Extract licenses of installed LuaRocks modules to CSV
#!/bin/awk -f
BEGIN {
while ("luarocks list --porcelain" | getline) {
i = 0
name = ""
license = ""
homepage = ""
c = "luarocks show " $1
while (c | getline) {
if (++i == 2) {
name = $1
} else if ($0 ~ /^License/) {
license = $2
} else if ($0 ~ /^Homepage/) {
homepage = $2
}
}
printf "%s,%s,%s\n", name, license, homepage
}
}
$ ./luarocks-licenses.awk
ansicolors,MIT,https://github.com/kikito/ansicolors.lua
busted,MIT,http://olivinelabs.com/busted/
date,MIT,https://github.com/Tieske/date
dkjson,MIT/X11,http://dkolf.de/src/dkjson-lua.fsl/
etlua,MIT,https://github.com/leafo/etlua
inspect,MIT,https://github.com/kikito/inspect.lua
lapis,MIT,http://leafo.net/lapis
loadkit,MIT,https://github.com/leafo/loadkit
LPeg,MIT/X11,http://www.inf.puc-rio.br/~roberto/lpeg.html
lua-cjson,MIT,http://www.kyne.com.au/~mark/software/lua-cjson.php
lua-term,MIT/X11,https://github.com/hoelzro/lua-term
lua_cliargs,MIT,https://github.com/amireh/lua_cliargs
LuaFileSystem,MIT/X11,
luaossl,MIT/X11,http://25thandclement.com/~william/projects/luaossl.html
LuaRocks,MIT/X11,http://www.luarocks.org
LuaSocket,MIT,http://luaforge.net/projects/luasocket/
luassert,MIT,http://olivinelabs.com/busted/
luasystem,MIT,http://olivinelabs.com/luasystem/
mediator_lua,MIT,http://olivinelabs.com/mediator_lua/
mimetypes,MIT/X11,https://bitbucket.org/leafstorm/lua-mimetypes/
penlight,MIT/X11,http://stevedonovan.github.com/Penlight
pgmoon,MIT,https://github.com/leafo/pgmoon
say,MIT,http://olivinelabs.com/busted/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment