diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-09-25 09:26:10 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-09-25 09:26:10 +0200 |
commit | 59454e5ebbb0b3b5e6383b3b00edb131007110a7 (patch) | |
tree | 059e08ad0dd2f0c630065968f00f485f9fc25bf7 /buildrepo.lua | |
parent | 12efc4c795640c6293f755d3d1d301aa422f546c (diff) | |
download | lua-aports-59454e5ebbb0b3b5e6383b3b00edb131007110a7.tar.bz2 lua-aports-59454e5ebbb0b3b5e6383b3b00edb131007110a7.tar.xz |
buildrepo: add support for pre/postrepo hooks
Diffstat (limited to 'buildrepo.lua')
-rwxr-xr-x | buildrepo.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/buildrepo.lua b/buildrepo.lua index 311cc88..adb73ec 100755 --- a/buildrepo.lua +++ b/buildrepo.lua @@ -68,6 +68,14 @@ local function plugins_postbuild(...) return run_plugins(pluginsdir, "postbuild", ...) end +local function plugins_prerepo(...) + return run_plugins(pluginsdir, "prerepo", ...) +end + +local function plugins_postrepo(...) + return run_plugins(pluginsdir, "postrepo", ...) +end + local function logfile_path(logdirbase, repo, aport) if logdirbase == nil then return nil @@ -173,6 +181,9 @@ for _,repo in pairs(args) do stats[repo].relevant_aports = relevant_aports stats[repo].total_aports = total_aports + -- run prerepo hooks + plugins_prerepo(repo, aportsdir, repodest, abuild.arch, stats[repo]) + -- find out what needs to be built for aport in db:each_need_build() do table.insert(pkgs, aport.pkgname) @@ -237,6 +248,9 @@ for _,repo in pairs(args) do stats[repo].tried = tried stats[repo].deleted = deleted stats[repo].time = os.clock() - start_time + + -- run portrepo hooks + plugins_postrepo(repo, aportsdir, repodest, abuild.arch, stats[repo]) end for repo,stat in pairs(stats) do |