summaryrefslogtreecommitdiff
path: root/bin/gitano-post-receive-hook.in
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-08-28 13:05:21 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2016-08-28 13:05:21 +0100
commit6e01e8ad9889db2a7a650be9eb6cfd76dce46cba (patch)
tree459ec0b2e23c782c059a394b47b39a5b80f57566 /bin/gitano-post-receive-hook.in
parent7210d1a2cfb33e870901629b2423a2f183c08954 (diff)
downloadgitano-6e01e8ad9889db2a7a650be9eb6cfd76dce46cba.tar.gz
Performed i18n on all bin/*.in
Diffstat (limited to 'bin/gitano-post-receive-hook.in')
-rw-r--r--bin/gitano-post-receive-hook.in36
1 files changed, 18 insertions, 18 deletions
diff --git a/bin/gitano-post-receive-hook.in b/bin/gitano-post-receive-hook.in
index 020cf04..b9de48b 100644
--- a/bin/gitano-post-receive-hook.in
+++ b/bin/gitano-post-receive-hook.in
@@ -44,21 +44,21 @@ gitano.config.repo_path(repo_root)
local admin_repo = gall.repository.new((repo_root or "") .. "/gitano-admin.git")
if not admin_repo then
- gitano.log.fatal("Unable to locate administration repository. Cannot continue");
+ gitano.log.fatal(gitano.i18n.expand("ERROR_NO_ADMIN_REPO"));
end
local admin_head = admin_repo:get(admin_repo.HEAD)
if not admin_head then
- gitano.log.fatal("Unable to find the HEAD of the administration repository. Cannot continue");
+ gitano.log.fatal(gitano.i18n.expand("ERROR_BAD_ADMIN_REPO"));
end
local config, msg = gitano.config.parse(admin_head)
if not config then
- gitano.log.critical("Unable to parse administration repository.")
+ gitano.log.critical(gitano.i18n.expand("ERROR_CANNOT_PARSE_ADMIN"))
gitano.log.critical(" * " .. (msg or "No error?"))
- gitano.log.fatal("Cannot continue")
+ gitano.log.fatal(gitano.i18n.expand("ERROR_CANNOT_CONTINUE"))
end
-- Now, are we an admin?
@@ -74,13 +74,13 @@ end
local repo, msg = gitano.repository.find(config, project)
if not repo then
- gitano.log.critical("Unable to locate repository.")
+ gitano.log.critical(gitano.i18n.expand("ERROR_CANNOT_LOCATE_REPO"))
gitano.log.critical(" * " .. (tostring(msg)))
- gitano.log.fatal("Cannot continue")
+ gitano.log.fatal(gitano.i18n.expand("ERROR_CANNOT_CONTINUE"))
end
if repo.is_nascent then
- gitano.log.fatal("Repository " .. repo.name .. " is nascent")
+ gitano.log.fatal(gitano.i18n.expand("ERROR_REPO_IS_NASCENT", {name=repo.name}))
end
-- Post-receive is not allowed to prevent updates, instead on stdin we get
@@ -99,7 +99,7 @@ end
-- that the updates (if any) will have been applied
if updates["refs/gitano/admin"] then
- local msg = "<" .. repo.name .. ">" .. " Any changes to admin ref have been applied."
+ local msg = gitano.i18n.expand("CHANGES_TO_ADMINREF_APPLIED", {name=repo.name})
gitano.log.chat(msg)
gitano.log.syslog.info(msg)
@@ -107,12 +107,12 @@ end
local function report_repo(reponame, repo, msg)
if repo then
- local s = "<" .. reponame ..">" .. " Any changes to hooks etc have been applied"
+ local s = gitano.i18n.expand("CHANGES_TO_HOOKS_APPLIED", {name=repo.name})
gitano.log.chat(s)
gitano.log.syslog.info(s)
else
- gitano.log.crit("<" .. reponame .. ">", "Unable to process:", msg)
+ gitano.log.crit(gitano.i18n.expand("ERROR_UNABLE_TO_PROCESS", {name=repo.name, msg=msg}))
end
end
@@ -121,7 +121,7 @@ if repo.name == "gitano-admin" and updates[admin_repo.HEAD] then
gitano.log.syslog.info("Updating gitano-admin")
- local msg = "Scanning repositories to apply hook/rules updates..."
+ local msg = gitano.i18n.expand("SCANNING_FOR_UPDATES")
gitano.log.chat(msg)
gitano.log.syslog.info(msg)
@@ -130,7 +130,7 @@ if repo.name == "gitano-admin" and updates[admin_repo.HEAD] then
gitano.log.crit(msg)
end
- msg = "All repositories updated where possible."
+ msg = gitano.i18n.expand("ALL_UPDATES_DONE")
gitano.log.chat(msg)
gitano.log.syslog.info(msg)
@@ -140,16 +140,16 @@ if repo.name == "gitano-admin" and updates[admin_repo.HEAD] then
})
local how, why = proc:wait()
if how ~= "exit" or why ~= 0 then
- gitano.log.crit("Updating SSH keys didn't work?")
+ gitano.log.crit(gitano.i18n.expand("ERROR_UPDATE_SSH_NOT_WORK"))
end
elseif repo.name ~= "gitano-admin" then
-- Not gitano-admin at all, so run the update-server-info stuff
- gitano.log.info("Updating server info for dumb HTTP transport")
+ gitano.log.info(gitano.i18n.expand("UPDATE_HTTP_INFO"))
local ok, err = repo.git:update_server_info()
if not ok then
gitano.log.warn(err)
end
- gitano.log.info("Updating last-modified date")
+ gitano.log.info(gitano.i18n.expand("UPDATE_LASTMOD_DATE"))
local shas = {}
for _, t in pairs(updates) do
shas[#shas+1] = t.newsha
@@ -164,7 +164,7 @@ if repo:uses_hook("post-receive") then
gitano.log.debug("Configuring for post-receive hook")
gitano.actions.set_supple_globals("post-receive")
- local msg = "Running repository post-receive hook"
+ local msg = gitano.i18n.expand("RUNNING_POST_RECEIVE_HOOK")
gitano.log.info(msg)
gitano.log.syslog.info(msg)
@@ -177,9 +177,9 @@ if repo:uses_hook("post-receive") then
}
local ok, msg = gitano.supple.run_hook("post-receive", repo, info, updates)
if not ok then
- gitano.log.crit(msg or "No reason given, but errored somehow.")
+ gitano.log.crit(msg or gitano.i18n.expand("ERROR_NO_ERROR_FOUND"))
end
- gitano.log.info("Finished")
+ gitano.log.info(gitano.i18n.expand("FINISHED"))
end
gitano.log.syslog.close()