aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-04-07 08:52:51 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2016-04-07 08:53:57 +0200
commita94f0b6bc60aa1dcbdfa7341e4777a15d22bd9e3 (patch)
tree251cff0c9e9a6287ec748a07a99eb6f23db26765 /main
parentf7aa406280632e7bf39a5b7d982a042930ea1989 (diff)
downloadaports-a94f0b6bc60aa1dcbdfa7341e4777a15d22bd9e3.tar.bz2
aports-a94f0b6bc60aa1dcbdfa7341e4777a15d22bd9e3.tar.xz
main/lua-aports: fix buildrepo -d
Diffstat (limited to 'main')
-rw-r--r--main/lua-aports/0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch113
-rw-r--r--main/lua-aports/APKBUILD12
2 files changed, 121 insertions, 4 deletions
diff --git a/main/lua-aports/0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch b/main/lua-aports/0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch
new file mode 100644
index 0000000000..6d7f6dd63e
--- /dev/null
+++ b/main/lua-aports/0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch
@@ -0,0 +1,113 @@
+From 4de3a72e08487d44b2d4a57e7334d97cdebb8770 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 7 Apr 2016 08:47:52 +0200
+Subject: [PATCH] buildrepo: fix bug when repodest is set with buildrepo -d
+
+we need to use the specified repodest when checking if package is built
+or not
+---
+ aports/db.lua | 14 +++++++++-----
+ aports/pkg.lua | 13 +++++++++----
+ buildrepo.lua | 2 +-
+ 3 files changed, 19 insertions(+), 10 deletions(-)
+
+diff --git a/aports/db.lua b/aports/db.lua
+index 45e394e..09afaeb 100644
+--- a/aports/db.lua
++++ b/aports/db.lua
+@@ -116,7 +116,7 @@ local function apkbuilds_open(aportsdir, repos)
+ return obj
+ end
+
+-local function init_apkdb(aportsdir, repos)
++local function init_apkdb(aportsdir, repos, repodest)
+ local pkgdb = {}
+ local revdeps = {}
+ local apkbuilds = apkbuilds_open(aportsdir, repos)
+@@ -125,7 +125,7 @@ local function init_apkdb(aportsdir, repos)
+ if pkgdb[a.pkgname] == nil then
+ pkgdb[a.pkgname] = {}
+ end
+- pkg.init(a)
++ pkg.init(a, repodest)
+ table.insert(pkgdb[a.pkgname], a)
+ -- add subpackages to package db
+ local k,v
+@@ -296,11 +296,15 @@ function Aports:known_deps_exists(pkg)
+ return true
+ end
+
+-function M.new(aportsdir, ...)
++function M.new(aportsdir, repos, repodest)
+ local h = Aports
+ h.aportsdir = aportsdir
+- h.repos = {...}
+- h.apks, h.revdeps = init_apkdb(aportsdir, h.repos)
++ if type(repos) == "table" then
++ h.repos = repos
++ else
++ h.repos = { repos }
++ end
++ h.apks, h.revdeps = init_apkdb(aportsdir, h.repos, repodest)
+ if h.apks == nil then
+ return nil, h.revdeps
+ end
+diff --git a/aports/pkg.lua b/aports/pkg.lua
+index 9689ecf..b99bf68 100644
+--- a/aports/pkg.lua
++++ b/aports/pkg.lua
+@@ -59,11 +59,12 @@ function M.get_apk_file_name(pkg, name)
+ end
+
+ function M.get_apk_file_path(pkg, name)
+- if abuild.pkgdest ~= nil and abuild.pkgdest ~= "" then
++ local repodest = pkg.repodest or abuild.repodest
++ if pkg.repodest == nil and abuild.pkgdest ~= nil and abuild.pkgdest ~= "" then
+ return abuild.pkgdest.."/"..M.get_apk_file_name(pkg, name)
+ end
+- if abuild.repodest ~= nil and abuild.repodest ~= "" then
+- return abuild.repodest.."/"..M.get_repo_name(pkg).."/"..abuild.arch.."/"..M.get_apk_file_name(pkg, name)
++ if repodest ~= nil and repodest ~= "" then
++ return repodest.."/"..M.get_repo_name(pkg).."/"..abuild.arch.."/"..M.get_apk_file_name(pkg, name)
+ end
+ return pkg.dir.."/"..M.get_apk_file_name(pkg, name)
+ end
+@@ -71,6 +72,9 @@ end
+ function M.apk_file_exists(pkg, name)
+ -- technically we check if it is readable...
+ local filepath = M.get_apk_file_path(pkg, name)
++ if lfs.attributes(filepath) == nil then
++ io.stderr:write(("DEBUG: path=%s\n"):format(filepath))
++ end
+ return lfs.attributes(filepath) ~= nil
+ end
+
+@@ -110,10 +114,11 @@ function M.each_dependency(pkg)
+ end
+
+
+-function M.init(pkg)
++function M.init(pkg, repodest)
+ for k,v in pairs(M) do
+ pkg[k] = v
+ end
++ pkg.repodest = repodest
+ end
+
+ return M
+diff --git a/buildrepo.lua b/buildrepo.lua
+index adb73ec..c665711 100755
+--- a/buildrepo.lua
++++ b/buildrepo.lua
+@@ -157,7 +157,7 @@ end
+
+ stats = {}
+ for _,repo in pairs(args) do
+- local db = require('aports.db').new(aportsdir, repo)
++ local db = require('aports.db').new(aportsdir, repo, repodest)
+ local pkgs = {}
+ local unsorted = {}
+ local logdir = nil
+--
+2.8.0
+
diff --git a/main/lua-aports/APKBUILD b/main/lua-aports/APKBUILD
index e67c4331b8..5840ea1533 100644
--- a/main/lua-aports/APKBUILD
+++ b/main/lua-aports/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-aports
pkgver=0.5
-pkgrel=1
+pkgrel=2
pkgdesc="Lua modules for parsing aports tree"
url="http://dev.alpinelinux.org/archive/lua-aports/"
arch="noarch"
@@ -13,6 +13,7 @@ install=""
replaces="abuild"
subpackages=""
source="http://dev.alpinelinux.org/archive/lua-aports/lua-aports-$pkgver.tar.xz
+ 0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch
"
_builddir="$srcdir"/lua-aports-$pkgver
@@ -35,6 +36,9 @@ package() {
make DESTDIR="$pkgdir" install || return 1
}
-md5sums="068ddedda0968d3e000637d2db8da4cd lua-aports-0.5.tar.xz"
-sha256sums="fb7ff16a884ed17f6856dc241ec17f0d1586f6d07b83dc5aebc1b320b772d4a9 lua-aports-0.5.tar.xz"
-sha512sums="7047f0c902c8f65e8a45ed221e793dd0a0c8abf77f85b21b2d23c4f3c19ab12d9862565615718223ff2633465b85026f260bba4d5851a898475974c93f40797d lua-aports-0.5.tar.xz"
+md5sums="068ddedda0968d3e000637d2db8da4cd lua-aports-0.5.tar.xz
+a77c2c306a12e0a36e137405aed8b695 0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch"
+sha256sums="fb7ff16a884ed17f6856dc241ec17f0d1586f6d07b83dc5aebc1b320b772d4a9 lua-aports-0.5.tar.xz
+c459d311ccf2c573cfb462e4f14a4d2ee68df4abde3047aa0539c396d520c208 0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch"
+sha512sums="7047f0c902c8f65e8a45ed221e793dd0a0c8abf77f85b21b2d23c4f3c19ab12d9862565615718223ff2633465b85026f260bba4d5851a898475974c93f40797d lua-aports-0.5.tar.xz
+9981f30ad04a9c96290c90aada76c9a42979f61387b193b8b1c5f758961822f8e158c01ac76bf587aad7f34f29f8c0dc7443246db406171967d62fc53db26e8b 0001-buildrepo-fix-bug-when-repodest-is-set-with-buildrep.patch"