520N/A## -*- coding: utf-8 -*-
520N/A## The contents of this file are subject to the terms of the
520N/A## Common Development and Distribution License (the "License").
520N/A## You may not use this file except in compliance with the License.
520N/A## See the License for the specific language governing permissions
520N/A## and limitations under the License.
520N/A## When distributing Covered Code, include this CDDL HEADER in each
520N/A## If applicable, add the following below this CDDL HEADER, with the
520N/A## fields enclosed by brackets "[]" replaced with your own identifying
520N/A## information: Portions Copyright [yyyy] [name of copyright owner]
520N/A## Copyright 2009, 2013 Oracle
and/or its affiliates. All rights reserved.
520N/A catalog = g_vars["catalog"]
520N/A config = g_vars["config"]
520N/A request = g_vars["request"]
520N/A<%def name="page_title(g_vars)"><%
520N/A return "Package Catalog"
520N/A <p>Information about packages is not available when the server
520N/A is operating in mirror mode.</p>
520N/A <p>This package repository is empty or no default publisher has
520N/A # Add an "All" selection so that user can view entire catalog.
520N/A if selected_val == val:
520N/A if versions and selected_val != "" and not selected_match:
520N/A # Either a version wasn't already selected, or the version
520N/A # provided didn't match a valid one, so default to the first in
520N/A selected_match = versions[1][0]
520N/A selected_val = versions[1][1]
520N/A <label for="version">Release and Branch</label>
520N/A <select id="version" name="version">
520N/A if val == selected_val:
520N/A attrs = 'selected="selected" '
<input id="submit-browse" type="submit"
name="action" value="Browse"/>
<input id="show-all-versions" type="checkbox"
name="show_all_versions" value="1"/>
<label for="show-all-versions" title="By
default, only the latest versions of packages are shown. To show all versions,
check this checkbox.">Show all versions</label>
<input id="show-obsolete" type="checkbox"
name="show_obsolete" value="1"/>
<label for="show-obsolete" title="By
default, obsolete packages are not shown. To show obsolete
packages, check this checkbox.">Show obsolete packages</label>
<input id="show-renamed" type="checkbox"
name="show_renamed" value="1"/>
<label for="show-renamed" title="By
default, renamed packages are not shown. To show renamed
packages, check this checkbox.">Show renamed packages</label>
<input id="show-all-versions" type="checkbox"
name="show_all_versions" value="1"/>
<label for="show-all-versions" title="By
default, only the latest versions of packages are shown. To show all versions,
check this checkbox and click Refresh.">Show all versions</label>
<input id="show-obsolete" type="checkbox"
name="show_obsolete" value="1"/>
<label for="show-obsolete" title="By
default, obsolete packages are not shown. To show obsolete
packages, check this checkbox.">Show obsolete packages</label>
<input id="show-renamed" type="checkbox"
name="show_renamed" value="1"/>
<label for="show-renamed" title="By
default, renamed packages are not shown. To show renamed
packages, check this checkbox.">Show renamed packages</label>
<input id="submit-browse" type="submit"
name="action" value="Refresh"/>
<div class="yui-b results">
<table summary="A list of packages available in the repository
restricted by the specified listing criteria.">
<th scope="row">Name</th>
# Output each FMRI that we have in the catalog.
if selected_val and selected_match:
# Entries need to be in descending version order.
% for pfmri, states in flist:
if not show_all_versions and pkg_name in found:
# For renames and obsoletes, only use package state for the
# The pkg_name should only be added to the list of stems
# to omit if the latest version of the package listed is
# renamed or obsolete. If not all versions are being
# shown, then this is the latest version.
if not (show_renamed or show_obsolete):
# Only possible states are OBSOLETE or RENAMED.
if not show_all_versions or \
if not show_obsolete and \
if not show_all_versions or \
if not show_renamed and \
if not show_all_versions or \
if show_all_versions and pkg_name in omit_stems:
# Terminal version found that is allowed by selected
# filter criteria; so omit all versions of that package.
if rclass is None or rclass == ' class="odd"':
# XXX the .p5i extension is a bogus hack because
# packagemanager requires it and shouldn't.
<a title="Package Information Summary"
title="Launch the Package Manager and install this package"
href="${p5ihref}">Install</a>
<a title="Package Manifest"
href="${mhref}">Manifest</a>
<td colspan="4" scope="row">${total} package(s)</td>