diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 07:54:23 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 07:54:23 +0000 |
commit | 244893613d8ea281eb411dc6243b628bdf5b5bb4 (patch) | |
tree | 3468992e0df54b9f3787b1905d444088306434ad | |
parent | fd217ba882e96885a8808ed94ec006191b292f96 (diff) | |
download | lua-aports-244893613d8ea281eb411dc6243b628bdf5b5bb4.tar.bz2 lua-aports-244893613d8ea281eb411dc6243b628bdf5b5bb4.tar.xz |
buildrepo: add support for -s, skip previously failed
-rwxr-xr-x | buildrepo.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/buildrepo.lua b/buildrepo.lua index d99527f..4b1fdd4 100755 --- a/buildrepo.lua +++ b/buildrepo.lua @@ -55,8 +55,14 @@ local function parse_opts(opthelp, raw_args) return opts, args end -local function build_aport(aport, repodest, logdir) - if not lfs.chdir(aport.dir) then +local function build_aport(aport, repodest, logdir, skip_failed) + local success, errmsg = lfs.chdir(aport.dir) + if not success then + err("%s", errmsg) + return nil + end + if skip_failed and lfs.attributes(aport.dir.."/src/") then + warn("%s: Skipped due to previous build failure", aport.pkgname) return nil end local log @@ -95,6 +101,7 @@ local opthelp = [[ -n Dry run. Don't acutally build or delete, just print -p Purge obsolete packages from REPODIR after build -r REPO Dependencies are found in REPO + -s Skip those who previously failed (src dir exists) ]] local function usage(exitcode) @@ -149,7 +156,7 @@ for _,repo in pairs(args) do count = 1 for aport in db:each_in_build_order(pkgs) do io.write(("%d/%d %s\n"):format(count, #pkgs, aport.pkgname)) - if build_aport(aport, repodest, logdir) then + if build_aport(aport, repodest, logdir, opts.s) then count = count + 1 else err("failed to build %s", aport.pkgname) |