From 0b7321b84e16bfdab36ad3ec12077ae054a63af3 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 14 May 2016 13:44:47 +0200 Subject: reproducible debian: restructure navigation --- bin/reproducible_common.py | 77 ++++++++++++++++++++++---------- bin/reproducible_common.sh | 92 +++++++++++++++++++++++++++++---------- bin/reproducible_html_packages.py | 21 ++------- 3 files changed, 125 insertions(+), 65 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 0bc374a7..e71eb713 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -165,11 +165,10 @@ html_footer = Template(""" """ % (JOB_FOOTER, JENKINS_URL)) -html_head_page = Template((tab*2).join(""" +html_head_page = Template((tab*2).join(("""

$page_title

-
""".splitlines(True))) - +$project_links +
""" % REPRODUCIBLE_URL ).splitlines(True))) html_foot_page_style_note = Template((tab*2).join("""

@@ -233,6 +237,24 @@ html_foot_page_style_note = Template((tab*2).join(""" indicates a closed bug. In cases of several bugs, the symbol is repeated.

""".splitlines(True))) +html_project_links = Template((tab*2).join(""" + +""".splitlines(True))) url2html = re.compile(r'((mailto\:|((ht|f)tps?)\://|file\:///){1}\S+)') @@ -299,16 +321,18 @@ def convert_into_hms_string(duration): def _gen_pkg_sets_link(suite, arch): html = '' if suite != 'experimental': - html = '
  • package sets
  • ' + html = '
  • package sets
  • ' return html - -def _gen_links(suite, arch): - html = '
  • Architectures:' +def _gen_arch_links(suite, arch): + html = '
  • ' for a in ARCHS: - html += ' ' + a + '' + html += ' ' + a + '' html += '
  • ' - html += '
  • Suites:' + return html + +def _gen_suite_links(suite, arch): + html = '
  • ' for s in SUITES: html += ' ' + s + '' html += '
  • ' @@ -324,14 +348,19 @@ def write_html_page(title, body, destfile, suite=defaultsuite, arch=defaultarch, page_title=title, meta_refresh=meta_refresh) if not noheader: - links = _gen_links(suite, arch) - pkgsetslink = _gen_pkg_sets_link(suite, arch) + link_archs = _gen_arch_links(suite, arch) + link_suites = _gen_suite_links(suite, arch) + link_pkgsets = _gen_pkg_sets_link(suite, arch) + project_links=html_project_links.substitute() + html += html_head_page.substitute( page_title=title, suite=suite, arch=arch, - links=links, - pkgsetslink=pkgsetslink) + link_archs=link_archs, + link_suites=link_suites, + link_pkgsets=link_pkgsets, + project_links=project_links) html += body if style_note: html += html_foot_page_style_note.substitute() diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index cb9eb3b5..57fb10ba 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -181,10 +181,12 @@ write_icon() { } write_page_header() { + # this is really quite uncomprehensible and should be killed + # the solution is to write all html pages with python… rm -f $PAGE MAINVIEW="dashboard" ALLSTATES="reproducible FTBR FTBFS depwait not_for_us 404 blacklisted" - ALLVIEWS="issues notes no_notes scheduled last_24h last_48h all_abc notify dd-list pkg_sets suite_stats arch repositories dashboard" + ALLVIEWS="notes no_notes pkg_sets last_24h last_48h all_abc arch scheduled suite_stats dd-list dashboard issues repositories notify" GLOBALVIEWS="issues scheduled notify repositories dashboard" SUITEVIEWS="dd-list suite_stats" SPOKENTARGET["issues"]="issues" @@ -199,7 +201,7 @@ write_page_header() { SPOKENTARGET["pkg_sets"]="package sets" SPOKENTARGET["suite_stats"]="suite: $SUITE" SPOKENTARGET["repositories"]="repositories overview" - SPOKENTARGET["dashboard"]="dashboard" + SPOKENTARGET["dashboard"]="Debian dashboard" write_page "" write_page "" write_page "" @@ -210,14 +212,8 @@ write_page_header() { else write_page "

    $2

    " fi - write_page "
    • Package states:" - write_page "
      • " - for MY_STATE in $ALLSTATES ; do - set_icon $MY_STATE - write_icon - write_page " " - done - write_page "
    • " + write_page "
        " + write_page "
      • $SUITE/$ARCH:
          " for TARGET in $ALLVIEWS ; do if [ "$TARGET" = "pkg_sets" ] && [ "$SUITE" = "experimental" ] ; then # no pkg_sets are tested in experimental @@ -236,30 +232,78 @@ write_page_header() { BASEURL="/$SUITE" fi done - if [ "$TARGET" = "suite_stats" ] ; then - for i in $SUITES ; do - write_page "
        • suite: $i
        • " - done - elif [ "$TARGET" = "scheduled" ] ; then + # prepare unsorted lists + if [ "$TARGET" = "notes" ] ; then + write_page "
        • Notes
            " + elif [ "$TARGET" = "last_24h" ] ; then + write_page "
          • Recently tested:
              " + fi + # prepare links + if [ "$TARGET" = "scheduled" ] ; then write_page "
            • ${SPOKEN_TARGET}
            • " elif [ "$TARGET" = "notify" ] ; then write_page "
            • ${SPOKEN_TARGET}
            • " elif [ "$TARGET" = "arch" ] ; then - for LINKARCH in ${ARCHS} ; do - if [ "$ARCH" = "$LINKARCH" ] ; then - continue - else - write_page "
            • arch: $LINKARCH
            • " - fi + write_page "
            • Architectures:
              • " + for i in ${ARCHS} ; do + write_page " $i" done + write_page "
              • " + elif [ "$TARGET" = "suite_stats" ] ; then + write_page "
              • Suites:
                • " + for i in $SUITES ; do + write_page " $i" + done + write_page "
                • " + elif [ "$TARGET" = "dashboard" ] ; then + write_page "
                • ${SPOKEN_TARGET}
                    " else + # finally, write link write_page "
                  • ${SPOKEN_TARGET}
                  • " fi + # close unsorted lists (and package states loop) + if [ "$TARGET" = "all_abc" ] ; then + write_page "
                • " + elif [ "$TARGET" = "last_48h" ] ; then + write_page "
              • " + elif [ "$TARGET" = "notify" ] ; then + write_page "
            • " + elif [ "$TARGET" = "scheduled" ] ; then + write_page "
          • " + elif [ "$TARGET" = "dd-list" ] ; then + write_page "
        • " + elif [ "$TARGET" = "no_notes" ] ; then + write_page "
      • " + # after notes we have package states + write_page "
      • Package states:" + write_page "
        • " + for MY_STATE in $ALLSTATES ; do + set_icon $MY_STATE + write_icon + write_page " " + done + write_page "
      • " + fi done - write_page "
      • wiki
      • " - write_page "
      • blog
      • " - write_page "
      • Reproducible-builds.org
      • " write_page "
      " + # project links + write_page "
        " + write_page "
      • Reproducible Builds projects links" + write_page "
      • " + write_page "
      " + # end project links write_page "
    " write_page "
    " if [ "$1" = "$MAINVIEW" ] ; then diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py index fc59f3e1..fe64450d 100755 --- a/bin/reproducible_html_packages.py +++ b/bin/reproducible_html_packages.py @@ -39,25 +39,10 @@ html_package_page = Template((tab*2).join(("""
  • Test history
  • - - ${suites_links} - - +${project_links}