aboutsummaryrefslogtreecommitdiff
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)
downloadalpine_aports-12a1110ce1298bd19803c6b22ec9dca4e6162cc1.tar.bz2
alpine_aports-12a1110ce1298bd19803c6b22ec9dca4e6162cc1.tar.xz
alpine_aports-12a1110ce1298bd19803c6b22ec9dca4e6162cc1.zip
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 0000000000..1c75549e8d
--- /dev/null
+++ b/main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch
@@ -0,0 +1,93 @@
1From 2a5a80d9c3ace1fce642c1bbee6efe98d6bf7215 Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Mon, 14 Apr 2014 09:14:46 +0000
4Subject: [PATCH] buildrepo: make sure we flush stdout on info output
5
6We introduce a printf-like function 'info'
7---
8 buildrepo.lua | 30 +++++++++++++++++++-----------
9 1 file changed, 19 insertions(+), 11 deletions(-)
10
11diff --git a/buildrepo.lua b/buildrepo.lua
12index 7093141..005b548 100755
13--- a/buildrepo.lua
14+++ b/buildrepo.lua
15@@ -6,10 +6,12 @@ local lfs = require("lfs")
16
17 local function warn(formatstr, ...)
18 io.stderr:write(("WARNING: %s\n"):format(formatstr:format(...)))
19+ io.stderr:flush()
20 end
21
22 local function err(formatstr, ...)
23 io.stderr:write(("ERROR: %s\n"):format(formatstr:format(...)))
24+ io.stderr:flush()
25 end
26
27 local function fatal(exitcode, formatstr, ...)
28@@ -17,6 +19,11 @@ local function fatal(exitcode, formatstr, ...)
29 os.exit(exitcode)
30 end
31
32+local function info(formatstr, ...)
33+ io.stdout:write(("%s\n"):format(formatstr:format(...)))
34+ io.stdout:flush()
35+end
36+
37 local function parse_opts(opthelp, raw_args)
38 local valid_opts = {}
39 local opts = {}
40@@ -179,10 +186,12 @@ for _,repo in pairs(args) do
41 if not db:known_deps_exists(aport) then
42 warn("%s: Skipped due to missing dependencies", aport.pkgname)
43 elseif not (opts.s and skip_aport(aport)) then
44- io.write(("%d/%d %d/%d %s/%s %s\n"):format(tried, #pkgs,
45+ info("%d/%d %d/%d %s/%s %s-r%s",
46+ tried, #pkgs,
47 totally_built,
48 stats[repo].relevant_aports,
49- repo, aport.pkgname, aport.pkgver))
50+ repo, aport.pkgname,
51+ aport.pkgver, aport.pkgrel)
52 if build_aport(aport, repodest, logdir) then
53 built = built + 1
54 else
55@@ -203,7 +212,7 @@ for _,repo in pairs(args) do
56 local apkrepodir = ("%s/%s/%s"):format(repodest, repo, abuild.arch)
57 for file in lfs.dir(apkrepodir) do
58 if file:match("%.apk$") and not keep[file] then
59- print("Deleting ", file)
60+ info("Deleting %s", file)
61 if not opts.n then
62 os.remove(("%s/%s"):format(apkrepodir, file))
63 deleted = deleted + 1
64@@ -214,7 +223,7 @@ for _,repo in pairs(args) do
65
66 -- generate new apkindex
67 if not opts.n then
68- print("Updating apk index")
69+ info("Updating apk index")
70 apkrepo.update_index(("%s/%s"):format(repodest, repo),
71 abuild.arch, db:git_describe())
72 end
73@@ -225,11 +234,10 @@ for _,repo in pairs(args) do
74 end
75
76 for repo,stat in pairs(stats) do
77- print(repo.." built:", stat.built)
78- print(repo.." tried:", stat.tried)
79- print(repo.." deleted:", stat.deleted)
80- print(repo.." time:", stat.time)
81- print(repo.." total built:", stat.relevant_aports - stat.tried + stat.built)
82- print(repo.." total relevant aports:", stat.relevant_aports)
83- print(repo.." total aports:", stat.total_aports)
84+ info("%s built:\t%d", repo, stat.built)
85+ info("%s tried:\t%d", repo, stat.tried)
86+ info("%s deleted:\t%d", repo, stat.deleted)
87+ info("%s total built:\t%d", repo, stat.relevant_aports - stat.tried + stat.built)
88+ info("%s total relevant aports:\t%d", repo, stat.relevant_aports)
89+ info("%s total aports:\t%d", repo, stat.total_aports)
90 end
91--
921.9.2
93
diff --git a/main/lua-aports/APKBUILD b/main/lua-aports/APKBUILD
index fc2d48c878..bfcb93fec9 100644
--- a/main/lua-aports/APKBUILD
+++ b/main/lua-aports/APKBUILD
@@ -1,7 +1,7 @@
1# Maintainer: Natanael Copa <ncopa@alpinelinux.org> 1# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2pkgname=lua-aports 2pkgname=lua-aports
3pkgver=0.3 3pkgver=0.3
4pkgrel=0 4pkgrel=1
5pkgdesc="Lua modules for parsing aports tree" 5pkgdesc="Lua modules for parsing aports tree"
6url="http://dev.alpinelinux.org/archive/lua-aports/" 6url="http://dev.alpinelinux.org/archive/lua-aports/"
7arch="noarch" 7arch="noarch"
@@ -13,6 +13,7 @@ install=""
13replaces="abuild" 13replaces="abuild"
14subpackages="" 14subpackages=""
15source="http://dev.alpinelinux.org/archive/lua-aports/lua-aports-$pkgver.tar.xz 15source="http://dev.alpinelinux.org/archive/lua-aports/lua-aports-$pkgver.tar.xz
16 0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch
16 " 17 "
17 18
18_builddir="$srcdir"/lua-aports-$pkgver 19_builddir="$srcdir"/lua-aports-$pkgver
@@ -35,6 +36,9 @@ package() {
35 make DESTDIR="$pkgdir" install || return 1 36 make DESTDIR="$pkgdir" install || return 1
36} 37}
37 38
38md5sums="d03218ceb198a339363e452dd6c3102b lua-aports-0.3.tar.xz" 39md5sums="d03218ceb198a339363e452dd6c3102b lua-aports-0.3.tar.xz
39sha256sums="f8e4ce1a60a61b9a6515ce36ceb56830da1bc0f0dd7300346bda357d9bb55fcd lua-aports-0.3.tar.xz" 40a08c4b5af2bacf5eb03550cd8c6b2a2c 0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch"
40sha512sums="e82bb3191958a123bcf16c17b2338cd0370d60b970ab15ac9f645972cf2b409618fd1c5b927ba854fb82468ab74d21dfd3cc1e363b513aa220905c4f89417a8b lua-aports-0.3.tar.xz" 41sha256sums="f8e4ce1a60a61b9a6515ce36ceb56830da1bc0f0dd7300346bda357d9bb55fcd lua-aports-0.3.tar.xz
425133f3080cfe642fe75d6d3e13bd28896a843094b112969067108f15446cf31f 0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch"
43sha512sums="e82bb3191958a123bcf16c17b2338cd0370d60b970ab15ac9f645972cf2b409618fd1c5b927ba854fb82468ab74d21dfd3cc1e363b513aa220905c4f89417a8b lua-aports-0.3.tar.xz
443e53f03d8bffab3fb7818e166bc9fbf31e078c4b20f895cdbbec21145182231660d376b257b74e6db1379e42f5b4edf8bef77dba5adbc596a7cf85663ce4bbe1 0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch"