Commit 19159b18 authored by Eli Schwartz's avatar Eli Schwartz Committed by Holger Levsen
Browse files

*.py: use distro agnostic variable names in configurable settings

Using e.g. DEBIAN_BASE to find the jenkins basedir ending in archlinux/
was confusing me a lot until I figured this out. It makes sense to use
variable names that do not imply something they are not, in order to
prevent other people from being similarly confused.
parent 72543b35
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -99,19 +99,19 @@ TEMP_PATH = conf_distro['tempdir']

REPRODUCIBLE_STYLES = os.path.join(BASE, conf_distro['css'])

DEBIAN_URI = '/' + conf_distro['distro_root']
DEBIAN_BASE = os.path.join(BASE, conf_distro['distro_root'])

DBD_URI = os.path.join(DEBIAN_URI, conf_distro['diffoscope_html'])
DBDTXT_URI = os.path.join(DEBIAN_URI, conf_distro['diffoscope_txt'])
LOGS_URI = os.path.join(DEBIAN_URI, conf_distro['buildlogs'])
DIFFS_URI = os.path.join(DEBIAN_URI, conf_distro['logdiffs'])
NOTES_URI = os.path.join(DEBIAN_URI, conf_distro['notes'])
ISSUES_URI = os.path.join(DEBIAN_URI, conf_distro['issues'])
RB_PKG_URI = os.path.join(DEBIAN_URI, conf_distro['packages'])
RBUILD_URI = os.path.join(DEBIAN_URI, conf_distro['rbuild'])
HISTORY_URI = os.path.join(DEBIAN_URI, conf_distro['pkghistory'])
BUILDINFO_URI = os.path.join(DEBIAN_URI, conf_distro['buildinfo'])
DISTRO_URI = '/' + conf_distro['distro_root']
DISTRO_BASE = os.path.join(BASE, conf_distro['distro_root'])

DBD_URI = os.path.join(DISTRO_URI, conf_distro['diffoscope_html'])
DBDTXT_URI = os.path.join(DISTRO_URI, conf_distro['diffoscope_txt'])
LOGS_URI = os.path.join(DISTRO_URI, conf_distro['buildlogs'])
DIFFS_URI = os.path.join(DISTRO_URI, conf_distro['logdiffs'])
NOTES_URI = os.path.join(DISTRO_URI, conf_distro['notes'])
ISSUES_URI = os.path.join(DISTRO_URI, conf_distro['issues'])
RB_PKG_URI = os.path.join(DISTRO_URI, conf_distro['packages'])
RBUILD_URI = os.path.join(DISTRO_URI, conf_distro['rbuild'])
HISTORY_URI = os.path.join(DISTRO_URI, conf_distro['pkghistory'])
BUILDINFO_URI = os.path.join(DISTRO_URI, conf_distro['buildinfo'])
DBD_PATH = BASE + DBD_URI
DBDTXT_PATH = BASE + DBDTXT_URI
LOGS_PATH = BASE + LOGS_URI
@@ -123,12 +123,12 @@ RBUILD_PATH = BASE + RBUILD_URI
HISTORY_PATH = BASE + HISTORY_URI
BUILDINFO_PATH = BASE + BUILDINFO_URI

REPRODUCIBLE_JSON = os.path.join(DEBIAN_BASE, conf_distro['json_out'])
REPRODUCIBLE_TRACKER_JSON = os.path.join(DEBIAN_BASE, conf_distro['tracker.json_out'])
REPRODUCIBLE_JSON = os.path.join(DISTRO_BASE, conf_distro['json_out'])
REPRODUCIBLE_TRACKER_JSON = os.path.join(DISTRO_BASE, conf_distro['tracker.json_out'])

REPRODUCIBLE_URL = conf_distro['base_url']
DEBIAN_URL = urljoin(REPRODUCIBLE_URL, conf_distro['distro_root'])
DEBIAN_DASHBOARD_URI = os.path.join(DEBIAN_URI, conf_distro['landing_page'])
DISTRO_URL = urljoin(REPRODUCIBLE_URL, conf_distro['distro_root'])
DISTRO_DASHBOARD_URI = os.path.join(DISTRO_URI, conf_distro['landing_page'])
JENKINS_URL = conf_distro['jenkins_url']

# global package set definitions
@@ -178,7 +178,7 @@ log.debug("BUILDINFO_PATH:\t" + BUILDINFO_PATH)
log.debug("REPRODUCIBLE_JSON:\t" + REPRODUCIBLE_JSON)
log.debug("JENKINS_URL:\t\t" + JENKINS_URL)
log.debug("REPRODUCIBLE_URL:\t" + REPRODUCIBLE_URL)
log.debug("DEBIAN_URL:\t" + DEBIAN_URL)
log.debug("DISTRO_URL:\t" + DISTRO_URL)

if args.ignore_missing_files:
    log.warning("Missing files will be ignored!")
@@ -346,7 +346,7 @@ def create_main_navigation(suite=defaultsuite, arch=defaultarch,
        'arch_nav': {
            'arch_list': arch_list
        } if len(arch_list) else '',
        'debian_uri': DEBIAN_DASHBOARD_URI,
        'debian_uri': DISTRO_DASHBOARD_URI,
        'cross_suite_arch_nav': True if suite_arch_nav_template else False,
    }
    if suite != 'experimental':
+3 −3
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ def _gen_files_html(header, entries):
    return html

def create_breakages_graph(png_file, main_label):
    png_fullpath = os.path.join(DEBIAN_BASE, png_file)
    png_fullpath = os.path.join(DISTRO_BASE, png_file)
    table = "stats_breakages"
    columns = ["datum", "diffoscope_timeouts", "diffoscope_crashes"]
    query = "SELECT {fields} FROM {table} ORDER BY datum".format(
@@ -408,8 +408,8 @@ if __name__ == '__main__':
        html += '<p><b>COOL!!!</b> Everything is GOOD and not a single issue was '
        html += 'detected. <i>Enjoy!</i></p>'
    title = 'Breakage on the Debian pages of tests.reproducible-builds.org'
    destfile = DEBIAN_BASE + '/index_breakages.html'
    desturl = DEBIAN_URL + '/index_breakages.html'
    destfile = DISTRO_BASE + '/index_breakages.html'
    desturl = DISTRO_URL + '/index_breakages.html'

    left_nav_html = create_main_navigation(displayed_page='breakages')
    write_html_page(title, html, destfile, style_note=True,
+3 −3
Original line number Diff line number Diff line
@@ -72,11 +72,11 @@ for suite in SUITES:
            html += '\n'
        html += '</pre></p>'
        title = 'Maintainers of unreproducible packages in ' + suite
        destfile = DEBIAN_BASE + '/' + suite + '/index_dd-list.html'
        suite_arch_nav_template = DEBIAN_URI + '/{{suite}}/index_dd-list.html'
        destfile = DISTRO_BASE + '/' + suite + '/index_dd-list.html'
        suite_arch_nav_template = DISTRO_URI + '/{{suite}}/index_dd-list.html'
        left_nav_html = create_main_navigation(suite=suite, arch=arch,
            displayed_page='dd_list', no_arch=True,
            suite_arch_nav_template=suite_arch_nav_template)
        write_html_page(title, html, destfile, style_note=True,
                        left_nav_html=left_nav_html)
        log.info('%s/%s/index_dd-list.html published', DEBIAN_URL, suite)
        log.info('%s/%s/index_dd-list.html published', DISTRO_URL, suite)
+5 −5
Original line number Diff line number Diff line
@@ -772,15 +772,15 @@ def build_page(page, suite=None, arch=None):
            footnote = True if footnote1 else footnote
    suite_arch_nav_template = None
    if gpage:
        destfile = DEBIAN_BASE + '/index_' + page + '.html'
        desturl = DEBIAN_URL + '/index_' + page + '.html'
        destfile = DISTRO_BASE + '/index_' + page + '.html'
        desturl = DISTRO_URL + '/index_' + page + '.html'
        suite = defaultsuite  # used for the links in create_main_navigation
    else:
        destfile = DEBIAN_BASE + '/' + suite + '/' + arch + '/index_' + \
        destfile = DISTRO_BASE + '/' + suite + '/' + arch + '/index_' + \
                   page + '.html'
        desturl = DEBIAN_URL + '/' + suite + '/' + arch + '/index_' + \
        desturl = DISTRO_URL + '/' + suite + '/' + arch + '/index_' + \
                  page + '.html'
        suite_arch_nav_template = DEBIAN_URI + '/{{suite}}/{{arch}}/index_' + \
        suite_arch_nav_template = DISTRO_URI + '/{{suite}}/{{arch}}/index_' + \
                                  page + '.html'
    left_nav_html = create_main_navigation(
        suite=suite,
+5 −6
Original line number Diff line number Diff line
@@ -85,9 +85,9 @@ def generate_schedule(arch):
        html += link_package(pkg, row[1], row[2], bugs)
        html += '</code></td><td>'+convert_into_status_html(str(row[4]))+'</td><td>'+duration+'</td><td>' + avg_duration + '</td></tr>\n'
    html += '</table></p>\n'
    destfile = DEBIAN_BASE + '/index_' + arch + '_scheduled.html'
    desturl = DEBIAN_URL + '/index_' + arch + '_scheduled.html'
    suite_arch_nav_template = DEBIAN_URI + '/index_{{arch}}_scheduled.html'
    destfile = DISTRO_BASE + '/index_' + arch + '_scheduled.html'
    desturl = DISTRO_URL + '/index_' + arch + '_scheduled.html'
    suite_arch_nav_template = DISTRO_URI + '/index_{{arch}}_scheduled.html'
    left_nav_html = create_main_navigation(arch=arch, no_suite=True,
        displayed_page='scheduled', suite_arch_nav_template=suite_arch_nav_template)
    write_html_page(title=title, body=html, destfile=destfile, style_note=True,
@@ -190,8 +190,8 @@ def generate_oldies(arch):
            html += link_package(pkg, row[0], row[1], bugs)
            html += '</code></td><td>'+convert_into_status_html(str(row[3]))+'</td><td>' + row[4] + '</td></tr>\n'
        html += '</table></p>\n'
    destfile = DEBIAN_BASE + '/index_' + arch + '_oldies.html'
    desturl = DEBIAN_URL + '/index_' + arch + '_oldies.html'
    destfile = DISTRO_BASE + '/index_' + arch + '_oldies.html'
    desturl = DISTRO_URL + '/index_' + arch + '_oldies.html'
    left_nav_html = create_main_navigation(arch=arch)
    write_html_page(title=title, body=html, destfile=destfile, style_note=True,
                    refresh_every=60, left_nav_html=left_nav_html)
@@ -201,4 +201,3 @@ if __name__ == '__main__':
    for arch in ARCHS:
        generate_schedule(arch)
        generate_oldies(arch)
Loading