summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-11-23 12:11:29 +0100
committerErich Eckner <git@eckner.net>2017-11-23 12:11:29 +0100
commitecf11faf60dccaecfc6bbdbac2e19bc7db0dff7f (patch)
tree6975bcce8f05cd3c4aacdf5da065e483d1ed8aa3
parent175ab2ae8bc8dd69e5cbf780fca42f4c893560ad (diff)
downloadbuilder-ecf11faf60dccaecfc6bbdbac2e19bc7db0dff7f.tar.xz
bin/build-master-status: cleanup, make use of new function modification_revision_link() to print links (now also on build-master-status.html)
-rwxr-xr-xbin/build-master-status30
-rwxr-xr-xbin/common-functions20
2 files changed, 40 insertions, 10 deletions
diff --git a/bin/build-master-status b/bin/build-master-status
index ed0578d..c453427 100755
--- a/bin/build-master-status
+++ b/bin/build-master-status
@@ -229,7 +229,7 @@ if ${web}; then
'build slave'
printf '</tr>'
find "${work_dir}/package-states" -maxdepth 1 -name '*.locked' \
- -printf '%T@ <tr><td>%TY-%Tm-%Td %TH:%TM</td><td>%f ' \
+ -printf '%T@ %TY-%Tm-%Td %TH:%TM %f ' \
-execdir sed '
:a
$!{
@@ -241,12 +241,22 @@ if ${web}; then
sort -k1n,1 | \
sed '
s|^\S\+ ||
- s|$|</td></tr>|
- s|\.locked |</td><td>|
- s|\.\([^.]\+\)$|</p></td><td>\1|
- s|\.\([^.]\+\)$|</p></td><td><p style=\"font-size:8px\">\1|
- s|\.\([^.]\+\)$|</td><td><p style=\"font-size:8px\">\1|
- '
+ s|\.locked | |
+ s|\.\([^.]\+\)$| \1|
+ s|\.\([^.]\+\)$| \1|
+ s|\.\([^.]\+\)$| \1|
+ ' | \
+ while read -r date time pkg rev mod_rev repo slaves; do
+ printf '<tr>'
+ printf '<td>%s</td>' \
+ "${date} ${time}" \
+ "${pkg}" \
+ "<p style=\"font-size:8px\">${rev}</p>" \
+ "<p style=\"font-size:8px\">$(modification_revision_link "${mod_rev}" "${repo}" "${pkg}")</p>" \
+ "${repo}" \
+ "${slaves}"
+ printf '</tr>\n'
+ done
printf '%s\n' \
'</table>' \
'</body>' \
@@ -432,9 +442,9 @@ if ${web}; then
unset right
fi
printf '<tr>'
- if git -C "${repo_paths__archlinux32}" archive "${mod_rev}" -- "${repo}/${pkg}/PKGBUILD" > /dev/null 2>&1; then
- mod_rev="<a href=\"https://github.com/archlinux32/packages/tree/${mod_rev}/${repo}/${pkg}\">${mod_rev}</a>"
- fi
+ mod_rev=$(
+ modification_revision_link "${mod_rev}" "${repo}" "${pkg}"
+ )
build_error=$(
echo "${build_error}" | \
sed 's|,|, |g'
diff --git a/bin/common-functions b/bin/common-functions
index 6fc1773..b133373 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -1263,3 +1263,23 @@ next_sub_pkgrel() {
fi
)
}
+
+# modification_revision_link "${mod_rev}" "${repo}" "${pkg}"
+# print the given modification revision possibly with a html link to github
+
+modification_revision_link() {
+ local mod_rev="$1"
+ local repo="$2"
+ local pkg="$3"
+
+ if git -C "${repo_paths__archlinux32}" archive "${mod_rev}" -- "${repo}/${pkg}/PKGBUILD" > /dev/null 2>&1; then
+ printf '<a href="https://github.com/archlinux32/packages/tree/%s/%s/%s">%s</a>\n' \
+ "${mod_rev}" \
+ "${repo}" \
+ "${pkg}" \
+ "${mod_rev}"
+ else
+ printf '%s\n' \
+ "${mod_rev}"
+ fi
+}