summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xap.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/ap.in b/ap.in
index bc9d075..81b11f6 100755
--- a/ap.in
+++ b/ap.in
@@ -1,6 +1,7 @@
#!/usr/bin/lua
require("aports")
+require("lfs")
local db
@@ -105,6 +106,14 @@ if cmd == nil then
return
end
+if #repodirs == 0 then
+ if lfs.attributes("APKBUILD") then
+ repodirs[1] = string.gsub(lfs.currentdir(), "(.*)/.*", "%1")
+ else
+ repodirs[1] = lfs.currentdir()
+ end
+end
+
if subcmd[cmd] and type(subcmd[cmd].run) == "function" then
db = aports.new(repodirs)
subcmd[cmd].run(opts)