diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 09:50:12 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 09:50:12 +0000 |
commit | 7ec5edd27709b5b7687f6dc232d4c6030701a913 (patch) | |
tree | 5f227f2dbbf29547a34a88982d2eae0139d7a98e /aports | |
parent | 7fa77aa695e2a3e618cff50df0e4e0a4dc5cefc5 (diff) | |
download | lua-aports-7ec5edd27709b5b7687f6dc232d4c6030701a913.tar.bz2 lua-aports-7ec5edd27709b5b7687f6dc232d4c6030701a913.tar.xz |
pkg: use luafilesystem to detect file existance
Diffstat (limited to 'aports')
-rw-r--r-- | aports/pkg.lua | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/aports/pkg.lua b/aports/pkg.lua index 8cacbd8..01d8502 100644 --- a/aports/pkg.lua +++ b/aports/pkg.lua @@ -1,6 +1,7 @@ local M = {} local abuild = require('aports.abuild') +local lfs = require('lfs') -- return a key list with makedepends and depends function M.all_deps(p) @@ -90,12 +91,7 @@ end function M.apk_file_exists(pkg, name) -- technically we check if it is readable... local filepath = M.get_apk_file_path(pkg, name) - local f = io.open(filepath) - if f == nil then - return false - end - f:close() - return true + return lfs.attributes(filepath) ~= nil end function M.arch_enabled(pkg) |