Skip to content

Instantly share code, notes, and snippets.

@thibaultcha
Last active June 21, 2018 22:17
Show Gist options
  • 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