annotate share/lua/5.2/luarocks/make_manifest.lua @ 3026:c8ea00fb641d

<shachaf> addquote <mnoqy> the theory\'s probably not bad, but calculus is one of those things that\'s so dang applicable that everyone only ever talks about how to apply it and compute with it and uuuuurgh(barf) <mnoqy> so i stay away from it
author HackBot
date Sun, 02 Jun 2013 04:42:47 +0000
parents d137f631bad5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1132
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
1
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
2 --- Module implementing the luarocks-admin "make_manifest" command.
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
3 -- Compile a manifest file for a repository.
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
4 module("luarocks.make_manifest", package.seeall)
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
5
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
6 local manif = require("luarocks.manif")
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
7 local index = require("luarocks.index")
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
8 local cfg = require("luarocks.cfg")
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
9 local util = require("luarocks.util")
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
10 local deps = require("luarocks.deps")
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
11
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
12 help_summary = "Compile a manifest file for a repository."
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
13
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
14 help = [[
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
15 <argument>, if given, is a local repository pathname.
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
16 ]]
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
17
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
18 --- Driver function for "make_manifest" command.
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
19 -- @param repo string or nil: Pathname of a local repository. If not given,
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
20 -- the default local repository configured as cfg.rocks_dir is used.
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
21 -- @return boolean or (nil, string): True if manifest was generated,
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
22 -- or nil and an error message.
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
23 function run(...)
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
24 local flags, repo = util.parse_flags(...)
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
25
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
26 assert(type(repo) == "string" or not repo)
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
27 repo = repo or cfg.rocks_dir
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
28
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
29 util.printout("Making manifest for "..repo)
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
30
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
31 local ok, err = manif.make_manifest(repo, deps.get_deps_mode(flags))
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
32 if ok then
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
33 util.printout("Generating index.html for "..repo)
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
34 index.make_index(repo)
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
35 end
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
36 return ok, err
d137f631bad5 <GreyKnight> (cd luabuild/luarocks-2.0.12; make install)
HackBot
parents:
diff changeset
37 end