diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 08:14:57 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 08:14:57 +0000 |
commit | 3edf6fa2e00d097b984d45e90719e67f17e9957c (patch) | |
tree | 1e4263546bea5deb7bc655f7d27554cb843163bd /buildrepo.lua | |
parent | 244893613d8ea281eb411dc6243b628bdf5b5bb4 (diff) | |
download | lua-aports-3edf6fa2e00d097b984d45e90719e67f17e9957c.tar.bz2 lua-aports-3edf6fa2e00d097b984d45e90719e67f17e9957c.tar.xz |
buildrepo: check if log dir exist before try create it
Diffstat (limited to 'buildrepo.lua')
-rwxr-xr-x | buildrepo.lua | 8 |
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 |