summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-01-24 08:14:57 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-01-24 08:14:57 +0000
commit3edf6fa2e00d097b984d45e90719e67f17e9957c (patch)
tree1e4263546bea5deb7bc655f7d27554cb843163bd
parent244893613d8ea281eb411dc6243b628bdf5b5bb4 (diff)
downloadlua-aports-3edf6fa2e00d097b984d45e90719e67f17e9957c.tar.bz2
lua-aports-3edf6fa2e00d097b984d45e90719e67f17e9957c.tar.xz
buildrepo: check if log dir exist before try create it
-rwxr-xr-xbuildrepo.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/buildrepo.lua b/buildrepo.lua
index 4b1fdd4..9edfa23 100755
--- a/buildrepo.lua
+++ b/buildrepo.lua
@@ -68,7 +68,9 @@ local function build_aport(aport, repodest, logdir, skip_failed)
local log
if logdir ~= nil then
local dir = ("%s/%s"):format(logdir, aport.pkgname)
- assert(lfs.mkdir(dir), dir)
+ if not lfs.attributes(dir) then
+ assert(lfs.mkdir(dir), dir)
+ end
local logfile = ("%s/%s-%s-r%s.log"):format(dir, aport.pkgname, aport.pkgver, aport.pkgrel)
log = io.open(logfile, "w")
else
@@ -149,7 +151,9 @@ for _,repo in pairs(args) do
if logdirbase ~= nil then
logdir = ("%s/%s"):format(logdirbase, repo)
- assert(lfs.mkdir(logdir), logdir)
+ if not lfs.attributes(logdir) then
+ assert(lfs.mkdir(logdir), logdir)
+ end
end
-- build packages