summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-14 09:16:19 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-04-14 09:16:19 +0000
commit12a1110ce1298bd19803c6b22ec9dca4e6162cc1 (patch)
tree5d583a120a083b3ecc230508cb638c5619fa40df
parentdf0f8b4f9ac278bf02d3f2234ab83376bba27161 (diff)
downloadaports-12a1110ce1298bd19803c6b22ec9dca4e6162cc1.tar.bz2
aports-12a1110ce1298bd19803c6b22ec9dca4e6162cc1.tar.xz
main/lua-aports: flush stdout
-rw-r--r--main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch93
-rw-r--r--main/lua-aports/APKBUILD12
2 files changed, 101 insertions, 4 deletions
diff --git a/main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch b/main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch
new file mode 100644
index 000000000..1c75549e8
--- /dev/null
+++ b/main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch
@@ -0,0 +1,93 @@
+From 2a5a80d9c3ace1fce642c1bbee6efe98d6bf7215 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 14 Apr 2014 09:14:46 +0000
+Subject: [PATCH] buildrepo: make sure we flush stdout on info output
+
+We introduce a printf-like function 'info'
+---
+ buildrepo.lua | 30 +++++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/buildrepo.lua b/buildrepo.lua
+index 7093141..005b548 100755
+--- a/buildrepo.lua
++++ b/buildrepo.lua
+@@ -6,10 +6,12 @@ local lfs = require("lfs")
+
+ local function warn(formatstr, ...)
+ io.stderr:write(("WARNING: %s\n"):format(formatstr:format(...)))
++ io.stderr:flush()
+ end
+
+ local function err(formatstr, ...)
+ io.stderr:write(("ERROR: %s\n"):format(formatstr:format(...)))
++ io.stderr:flush()
+ end
+
+ local function fatal(exitcode, formatstr, ...)
+@@ -17,6 +19,11 @@ local function fatal(exitcode, formatstr, ...)
+ os.exit(exitcode)
+ end
+
++local function info(formatstr, ...)
++ io.stdout:write(("%s\n"):format(formatstr:format(...)))
++ io.stdout:flush()
++end
++
+ local function parse_opts(opthelp, raw_args)
+ local valid_opts = {}
+ local opts = {}
+@@ -179,10 +186,12 @@ for _,repo in pairs(args) do
+ if not db:known_deps_exists(aport) then
+ warn("%s: Skipped due to missing dependencies", aport.pkgname)
+ elseif not (opts.s and skip_aport(aport)) then
+- io.write(("%d/%d %d/%d %s/%s %s\n"):format(tried, #pkgs,
++ info("%d/%d %d/%d %s/%s %s-r%s",
++ tried, #pkgs,
+ totally_built,
+ stats[repo].relevant_aports,
+- repo, aport.pkgname, aport.pkgver))
++ repo, aport.pkgname,
++ aport.pkgver, aport.pkgrel)
+ if build_aport(aport, repodest, logdir) then
+ built = built + 1
+ else
+@@ -203,7 +212,7 @@ for _,repo in pairs(args) do
+ local apkrepodir = ("%s/%s/%s"):format(repodest, repo, abuild.arch)
+ for file in lfs.dir(apkrepodir) do
+ if file:match("%.apk$") and not keep[file] then
+- print("Deleting ", file)
++ info("Deleting %s", file)
+ if not opts.n then
+ os.remove(("%s/%s"):format(apkrepodir, file))
+ deleted = deleted + 1
+@@ -214,7 +223,7 @@ for _,repo in pairs(args) do
+
+ -- generate new apkindex
+ if not opts.n then
+- print("Updating apk index")
++ info("Updating apk index")
+ apkrepo.update_index(("%s/%s"):format(repodest, repo),
+ abuild.arch, db:git_describe())
+ end
+@@ -225,11 +234,10 @@ for _,repo in pairs(args) do
+ end
+
+ for repo,stat in pairs(stats) do
+- print(repo.." built:", stat.built)
+- print(repo.." tried:", stat.tried)
+- print(repo.." deleted:", stat.deleted)
+- print(repo.." time:", stat.time)
+- print(repo.." total built:", stat.relevant_aports - stat.tried + stat.built)
+- print(repo.." total relevant aports:", stat.relevant_aports)
+- print(repo.." total aports:", stat.total_aports)
++ info("%s built:\t%d", repo, stat.built)
++ info("%s tried:\t%d", repo, stat.tried)
++ info("%s deleted:\t%d", repo, stat.deleted)
++ info("%s total built:\t%d", repo, stat.relevant_aports - stat.tried + stat.built)
++ info("%s total relevant aports:\t%d", repo, stat.relevant_aports)
++ info("%s total aports:\t%d", repo, stat.total_aports)
+ end
+--
+1.9.2
+
diff --git a/main/lua-aports/APKBUILD b/main/lua-aports/APKBUILD
index fc2d48c87..bfcb93fec 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.3
-pkgrel=0
+pkgrel=1
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-make-sure-we-flush-stdout-on-info-output.patch
"
_builddir="$srcdir"/lua-aports-$pkgver
@@ -35,6 +36,9 @@ package() {
make DESTDIR="$pkgdir" install || return 1
}
-md5sums="d03218ceb198a339363e452dd6c3102b lua-aports-0.3.tar.xz"
-sha256sums="f8e4ce1a60a61b9a6515ce36ceb56830da1bc0f0dd7300346bda357d9bb55fcd lua-aports-0.3.tar.xz"
-sha512sums="e82bb3191958a123bcf16c17b2338cd0370d60b970ab15ac9f645972cf2b409618fd1c5b927ba854fb82468ab74d21dfd3cc1e363b513aa220905c4f89417a8b lua-aports-0.3.tar.xz"
+md5sums="d03218ceb198a339363e452dd6c3102b lua-aports-0.3.tar.xz
+a08c4b5af2bacf5eb03550cd8c6b2a2c 0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch"
+sha256sums="f8e4ce1a60a61b9a6515ce36ceb56830da1bc0f0dd7300346bda357d9bb55fcd lua-aports-0.3.tar.xz
+5133f3080cfe642fe75d6d3e13bd28896a843094b112969067108f15446cf31f 0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch"
+sha512sums="e82bb3191958a123bcf16c17b2338cd0370d60b970ab15ac9f645972cf2b409618fd1c5b927ba854fb82468ab74d21dfd3cc1e363b513aa220905c4f89417a8b lua-aports-0.3.tar.xz
+3e53f03d8bffab3fb7818e166bc9fbf31e078c4b20f895cdbbec21145182231660d376b257b74e6db1379e42f5b4edf8bef77dba5adbc596a7cf85663ce4bbe1 0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch"