aboutsummaryrefslogtreecommitdiffstats
path: root/tools/make_repo.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
committerKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
commit1eabf5bdb449b0312dfa272884e02cc84175775c (patch)
tree94b4ebcb9443e8e6751e1903ade3c9dc8ec9d678 /tools/make_repo.lua
parent575cd4c57d062a1addc761aa0036b1db752900a9 (diff)
parent8537138d41a6bca5e855040c8928ef2aae59802f (diff)
downloadprosody-1eabf5bdb449b0312dfa272884e02cc84175775c.tar.gz
prosody-1eabf5bdb449b0312dfa272884e02cc84175775c.zip
Merge 0.11->trunk
Diffstat (limited to 'tools/make_repo.lua')
-rw-r--r--tools/make_repo.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/make_repo.lua b/tools/make_repo.lua
new file mode 100644
index 00000000..5b5e6234
--- /dev/null
+++ b/tools/make_repo.lua
@@ -0,0 +1,44 @@
+print("Getting all the available modules")
+if os.execute '[ -e "./downloaded_modules" ]' then
+ os.execute("rm -rf downloaded_modules")
+end
+os.execute("hg clone https://hg.prosody.im/prosody-modules/ downloaded_modules")
+local i, popen = 0, io.popen
+local flag = "mod_"
+if os.execute '[ -e "./repository" ]' then
+ os.execute("mkdir repository")
+end
+local pfile = popen('ls -a "downloaded_modules"')
+for filename in pfile:lines() do
+ i = i + 1
+ if filename:sub(1, #flag) == flag then
+ local file = io.open("repository/"..filename.."-scm-1.rockspec", "w")
+ file:write('package = "'..filename..'"', '\n')
+ file:write('version = "scm-1"', '\n')
+ file:write('source = {', '\n')
+ file:write('\turl = "hg+https://hg.prosody.im/prosody-modules",', '\n')
+ file:write('\tdir = "prosody-modules"', '\n')
+ file:write('}', '\n')
+ file:write('description = {', '\n')
+ file:write('\thomepage = "https://prosody.im/",', '\n')
+ file:write('\tlicense = "MIT"', '\n')
+ file:write('}', '\n')
+ file:write('dependencies = {', '\n')
+ file:write('\t"lua >= 5.1"', '\n')
+ file:write('}', '\n')
+ file:write('build = {', '\n')
+ file:write('\ttype = "builtin",', '\n')
+ file:write('\tmodules = {', '\n')
+ file:write('\t\t["'..filename..'.'..filename..'"] = "'..filename..'/'..filename..'.lua"', '\n')
+ file:write('\t}', '\n')
+ file:write('}', '\n')
+ file:close()
+ end
+end
+pfile:close()
+os.execute("cd repository/ && luarocks-admin make_manifest ./ && chmod -R 644 ./*")
+print("")
+print("Done!. Modules' sources are locally available at ./downloaded_modules")
+print("Repository is available at ./repository")
+print("The repository contains all of prosody modules' respective rockspecs, as well as manifest files and an html Index")
+print("You can now either point your server to this folder, or copy its contents to another configured folder.")