aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch')
-rw-r--r--main/lua-aports/0001-buildrepo-make-sure-we-flush-stdout-on-info-output.patch93
1 files changed, 93 insertions, 0 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 @@
+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
+