aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-10-21 15:41:32 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-10-21 16:58:35 +0200
commit5395cf24cde9abb3039bcbf00191692db088356d (patch)
tree5215d9358bdf8d4932217e8fb7a18b227ef843ba
parentf4b4becf64c5f530001671162900a23220c70edc (diff)
main/aports-build: fix build error reporting
use mosquitto_pub config for setting user/password for mqtt broker (cherry picked from commit ce37163bafdc0f945efca6b9c9ad32ac64a1f68d) (cherry picked from commit fa0f6c3878af3c71dfde329c7b01b74b429fede2)
-rw-r--r--main/aports-build/APKBUILD8
-rw-r--r--main/aports-build/report-build-errors.lua20
2 files changed, 25 insertions, 3 deletions
diff --git a/main/aports-build/APKBUILD b/main/aports-build/APKBUILD
index 7e9d595e70b..67abeaaa6fb 100644
--- a/main/aports-build/APKBUILD
+++ b/main/aports-build/APKBUILD
@@ -1,6 +1,6 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=aports-build
-pkgver=1.5.3
+pkgver=1.5.4
pkgrel=0
pkgdesc="MQTT based build-on-git-push scripts for Alpine Linux"
url="https://alpinelinux.org"
@@ -46,7 +46,9 @@ package() {
EOF
}
-sha512sums="81c039c6999fddde2489fccdc48b29760c80ea1ff5265cc2d7f73d6575e0173a0f51b89a4d49e5100e2d841b6260adc48e4ab00e8608d52b3b69b17a590467ad aports-build
+sha512sums="
+81c039c6999fddde2489fccdc48b29760c80ea1ff5265cc2d7f73d6575e0173a0f51b89a4d49e5100e2d841b6260adc48e4ab00e8608d52b3b69b17a590467ad aports-build
821035bda47152c341ec94bf960fa67e3377051826712ceb74f39103e6e422777b6e082231bfb87865653d2b93b7d3154cfc24abf65a52e3e66da69412dd7e41 aports-build.initd
62ed5cb6d1fef03fa707512c8c99c572a91e64706ebcc2e7097108811818615618bab908292d0ba0ad2afe93a27333d9c91deb347d6c99703eb8983d1ee5f480 mqtt-exec.aports-build.confd
-cf0d8e65e517857ee781e451a1d3e6404cd72aeb5c7dba25017229ff79c4c43425712d2fcbbaad89af45a358e86f33467ac1df47e8fba0f30f81d84794e1206c report-build-errors.lua"
+939ba54ab4159bc8fcd0cb08f16f67dac05d29c77005da6fca0463048ab991765665b35f2feb978bfd8409bd13fdbdf3d47a7652df842e76504d076ac040c337 report-build-errors.lua
+"
diff --git a/main/aports-build/report-build-errors.lua b/main/aports-build/report-build-errors.lua
index 275b213f863..3621765783a 100644
--- a/main/aports-build/report-build-errors.lua
+++ b/main/aports-build/report-build-errors.lua
@@ -6,6 +6,26 @@ local f = io.open("/proc/sys/kernel/hostname")
hostname = f:read()
f:close()
+local function read_mosquitto_conf()
+ local cfg = {}
+ local f = io.open((os.getenv("XDG_CONFIG_HOME") or "").."/mosquitto_pub") or io.open((os.getenv("HOME") or "").."/.config/mosquitto_pub")
+ if f == nil then
+ return cfg
+ end
+ for line in f:lines() do
+ key,value = line:match("^%-%-([^ ]+)%s+(.*)")
+ if key and value then
+ cfg[key] = value
+ end
+ end
+ f:close()
+ return cfg
+end
+local mcfg = read_mosquitto_conf()
+publish.hostname = mcfg.hostname or "localhost"
+publish.username = mcfg.username
+publish.password = mcfg.pw
+
local m = {}
function shell_escape(args)