summaryrefslogtreecommitdiffstats
path: root/aports/pkg.lua
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-01-24 09:50:12 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-01-24 09:50:12 +0000
commit7ec5edd27709b5b7687f6dc232d4c6030701a913 (patch)
tree5f227f2dbbf29547a34a88982d2eae0139d7a98e /aports/pkg.lua
parent7fa77aa695e2a3e618cff50df0e4e0a4dc5cefc5 (diff)
downloadlua-aports-7ec5edd27709b5b7687f6dc232d4c6030701a913.tar.bz2
lua-aports-7ec5edd27709b5b7687f6dc232d4c6030701a913.tar.xz
pkg: use luafilesystem to detect file existance
Diffstat (limited to 'aports/pkg.lua')
-rw-r--r--aports/pkg.lua8
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)