commit:     49897929ba1fc87d8ba34eb67441f1ab185a09ed
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 13:51:30 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 13:51:30 2019 +0000
URL:        https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=49897929

gentoo-ci: Support matching maintainers and projects

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 cgi-bin/get-git-file.sh | 19 ++++++++++++++++++-
 pkgcheck2html           |  2 +-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/cgi-bin/get-git-file.sh b/cgi-bin/get-git-file.sh
index 09f2575..5b7b8fc 100755
--- a/cgi-bin/get-git-file.sh
+++ b/cgi-bin/get-git-file.sh
@@ -12,6 +12,21 @@ main() {
        local commit=${qs%%;*}
        qs=${qs#*;}
        local file=${qs%%;*}
+       [[ ${qs} == *\;* ]] && qs=${qs#*;} || qs=
+
+       local filter_maint= projects=
+       while [[ -n ${qs} ]]; do
+               local q=${qs%%;*}
+               case ${q} in
+                       maintainer=*)
+                               filter_maint="--maintainer ${q#maintainer=}"
+                               ;;
+                       include-projects)
+                               projects=--projects
+                               ;;
+               esac
+               [[ ${qs} == *\;* ]] && qs=${qs#*;} || qs=
+       done
 
        if [[ ${repo} == */* ]]; then
                echo "DANGER! SOMEONE TRIES TO ABUSE ME!" >&2
@@ -63,7 +78,9 @@ main() {
                local ts=$(TZ=UTC git log --format='%cd' --date=iso-local -1 | 
cut -d' ' -f1-2)
 
                git cat-file -p "${tree[2]}" \
-                       | PYTHONIOENCODING=utf8 python 
"${topdir}"/pkgcheck2html/pkgcheck2html.py ${verbose} -t "${ts}" -
+                       | PYTHONIOENCODING=utf8 python \
+                       "${topdir}"/pkgcheck2html/pkgcheck2html.py ${verbose} \
+                       ${filter_maint} ${projects} -t "${ts}" -
        else
                git cat-file -p "${tree[2]}"
        fi

diff --git a/pkgcheck2html b/pkgcheck2html
index d933d7f..4a5cbf6 160000
--- a/pkgcheck2html
+++ b/pkgcheck2html
@@ -1 +1 @@
-Subproject commit d933d7f51a5b3b8dd1bcff37c84982b72bdf5ee3
+Subproject commit 4a5cbf61d19b42c25f754c71543122b2b300c8a9

Reply via email to