From nobody Sat Jan 24 17:52:58 2026 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dz2T63pn0z6PP1w for ; Sat, 24 Jan 2026 17:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dz2T62hDlz46NN for ; Sat, 24 Jan 2026 17:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769277178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A7rvf8QGxsIHePumU3Wff9Og/ioUQ/EMzuTy/6qgFeo=; b=KamL6B6Ubmlgyz3FFDJ3MZlKRT2vEKf9b9abCuBB3d0I/b0InCMiVabomaDj7mkeOS/gij 5lE6ZOZgdhbV4eU/K1kfpNpUmAs49oljEFo2cFtgGGpMJBUNvKIgUEsA0HuB2RT4APfFXl Dqee8wKmleKN8yT3q8qpTC+hWYevmi68XNrh5WVBEZdXCuSMDQVXCM34P8GiXqSq4Imfkc XzFfiKq4MGHirnOdEvcbqT1ATM/nr1mi1aF80rtnyCLQBlHB8Vx3szzIQr/14Za39sm4aJ sfGEc6ZvMmy4cTJf8sD1GL9PWUcTMSOFcCBnknFObheucujB+BdTrDmvsL6Lzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769277178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A7rvf8QGxsIHePumU3Wff9Og/ioUQ/EMzuTy/6qgFeo=; b=MsyXlwQhFkNzipYZducubQgYiHgDf4LGWbQmopP09X66c4cwrAnEO1bUGCxuk7+cS+9j6w uPG9vCAHwRS35PWLljKFsIPhuwi9QfBX5/74O7bzkISSoE76EKMmEKRGDp4F4Je4Pb5D6Z Xxzd6AftyMHmVKSYIMUTOIysOYZgdj9uvZy+agNPb5UOt5ekV1Zxlf+wBtMtjGnj+L66Pp ef4SZOrrctuFN0j9HqB5OLNr6vg5QNtDrU9I9ERy7PmQj/EZwR2Jve8THt08NpmUIo/vKu 3eYQ5RuN7fNptm2WVMpv+DijA0EBM2UELY500MBy9zaLzyX+Hjd9K79/BrNvuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769277178; a=rsa-sha256; cv=none; b=JM7WPFmerv2IPJlCn6JA0Th2fY6wyiR84HiY2Gyhf539KDP8sjYQEaJbE9MSoQLUm18id1 P5ZFSlWFZCjcE+kCNc9xfI2jk16OJMH4X2LuUtBtWWjx1734Wj6x8J2RkYCsqr8LkG5BHR Y0DnE2uz5M6NjHKmnDG0smvWD1FwC7ZXnTMpz1FrOgy3RLCgC+tVk1lM65x4aYC2RVD1my YPDZIaqk94dWLqf2l4kxYMeGKqE/NwfKMQpwJxcbKrijfvxUNbYtlkJsFji4NoPba8sUnn MnNm8zVwlLINA9uMRArLhxLulO/U12pUtyuBa5tQSOAOIRuou5xI1mTQYFsyXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dz2T62HSjz1F6K for ; Sat, 24 Jan 2026 17:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4171a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 24 Jan 2026 17:52:58 +0000 To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Wolfram Schneider Subject: git: 5987e8a98d - main - ports.cgi: show links to available packages List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5987e8a98d4c307168ffee2fab598a652ed47585 Auto-Submitted: auto-generated Date: Sat, 24 Jan 2026 17:52:58 +0000 Message-Id: <697506fa.4171a.39c0db93@gitrepo.freebsd.org> The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/doc/commit/?id=5987e8a98d4c307168ffee2fab598a652ed47585 commit 5987e8a98d4c307168ffee2fab598a652ed47585 Author: Wolfram Schneider AuthorDate: 2026-01-24 17:51:34 +0000 Commit: Wolfram Schneider CommitDate: 2026-01-24 17:51:34 +0000 ports.cgi: show links to available packages For a given port, display a link list of all available packages for all supported architectures and releases/branches. --- website/content/en/cgi/ports.cgi | 212 ++++++++++++++++++++++++++++++++++----- 1 file changed, 189 insertions(+), 23 deletions(-) diff --git a/website/content/en/cgi/ports.cgi b/website/content/en/cgi/ports.cgi index d5214284f6..ab61799190 100755 --- a/website/content/en/cgi/ports.cgi +++ b/website/content/en/cgi/ports.cgi @@ -29,6 +29,8 @@ use POSIX qw(strftime); use Time::Local; +use JSON; + use warnings; our $hsty_base; @@ -49,6 +51,8 @@ p#section_links, div#footer { max-width: 50em; } hr { margin-left: 0em; max-width: 50em; } a:link { text-decoration:none; } a:hover { text-decoration:underline; } +table, th, td { border: 1px solid black; border-collapse: collapse; } +th, td { padding-left: 0.5em; padding-right: 0.5em; } @@ -61,6 +65,9 @@ my $max; my $debug = 1; +# feature flags +my $enable_packages_link = 1; + sub init_variables { $localPrefix = '/usr/ports'; # ports prefix @@ -129,20 +136,18 @@ sub dec { return ($_); } -# $indent is a bit of optional data processing I put in for -# formatting the data nicely when you are emailing it. -# This is derived from code by Denis Howe -# and Thomas A Fine sub decode_form { - local ( $form, *data, $indent, $key, $_ ) = @_; - foreach $_ ( split( /&/, $form ) ) { - ( $key, $_ ) = split( /=/, $_, 2 ); - $_ =~ s/\+/ /g; # + -> space + local ( $form, *data ) = @_; + + foreach my $line ( split( /&/, $form ) ) { + my ( $key, $val ) = split( /=/, $line, 2 ); + $val = "" if !defined $val; + + $val =~ s/\+/ /g; # + -> space $key =~ s/\+/ /g; # + -> space - $_ =~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig; # undo % escapes + $val =~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig; # undo % escapes $key =~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig; # undo % escapes - $_ =~ s/[\r\n]+/\n\t/g if defined($indent); # indent data after \n - $data{$key} = $_; + $data{$key} = $val; } } @@ -266,6 +271,9 @@ sub out { $rdepends //= ""; $counter++; $pathB = $path; + my $port_path = $path; + $port_path =~ s,/usr/ports/,,; + $pathB =~ s/^$localPrefix/ports/o; $path =~ s/^$localPrefix/$remotePrefixFtp/o; @@ -284,9 +292,14 @@ sub out { qq{
$version
\n}; print qq{
}, &escapeHTML($comment), qq{
\n}; - print qq[Description :\n]; + print qq[Description\n]; + + print qq[: Changes\n]; + print qq[: Packages\n] + if $enable_packages_link; - print qq[Changes
\n]; + print qq[
\n]; print qq{Maintained by: ) { + chomp; + next if !(m,^(.*?)-(.*?)\.yaml:(.*),); + + my $arch = $1; + my $rel = $1; + my $snapshot = $2; + my $path = "$1/$2"; + my $perl = decode_json($3); + + $arch =~ s,.*%3A,,; + if ( $rel =~ /^FreeBSD%3A(\d+)%3A/ ) { + $rel = ":$1:"; + } + + if ( $. == 1 ) { + print qq[

$perl->{"name"}: $perl->{"comment"}

\n]; + + print qq[homepage:
] . $perl->{"www"} . "
\n"; + print qq[FreeBSD ports git: ] + . $perl->{"origin"} + . qq[
\n]; + print qq[maintainer: ], $perl->{"maintainer"}, "
\n"; + + print qq[

Description

\n]; + print "
", $perl->{"desc"}, "
\n"; + print qq[

Download packages in *.pkg format

\n]; + print qq{\n}; + print qq{\n}; + print +qq{\n}; + print qq{\n}; + print qq{\n}; + } + + my $release = $perl->{"abi"} . " " . $snapshot; + my $time = $perl->{"annotations"}->{"build_timestamp"} // ""; + my $version = $perl->{"version"}; + my $repopath = $perl->{"repopath"}; + + $time =~ s/\+\d{4}$//; + $time =~ s/T(\d\d):(\d\d):(\d\d)$/ $1:$2/; + + my $pkg_opt = $repopath; + $pkg_opt =~ s,.*/,,; + $pkg_opt =~ s,\~.*,,; + + if ($filter) { + next + if index( $release, $filter ) < 0 + && index( $pkg_opt, $filter ) < 0 + && index( $version, $filter ) < 0 + && index( $time, $filter ) < 0; + } + + $counter++; + + my $info = + $time + ? qq[pkg: $pkg_opt\n size: $perl->{"pkgsize"} bytes\n git_hash: $perl->{"annotations"}->{"port_git_hash"}\n ] + . qq[ports_top_git_hash: $perl->{"annotations"}->{"ports_top_git_hash"}\nchecksum: $perl->{"sum"}\n] + : ""; + + print "\n"; + print "\n]; + print "\n"; + print qq[\n"; + + print "\n"; + + $hash->{'version'}->{$version}++; + $hash->{'arch'}->{$arch}++; + $hash->{'release'}->{$rel}++; + $hash->{'snapshot'}->{$snapshot}++ + if $snapshot eq 'latest' || $snapshot eq 'quarterly'; + } + + if ( $counter || $. >= 1 ) { + print < +
ReleaseVersionBuild Time
", qq[$release", $version, "], $time, "
+
+EOF + + foreach my $key ( sort keys %$hash ) { + print "", escapeHTML($key), ": \n"; + my $flag = 0; + foreach my $k ( sort keys %{ $hash->{$key} } ) { + print " - " if $flag++; + print qq[], escapeHTML($k), + "\n"; + } + print "
\n"; + } + + if ( $filter ne "" ) { + print escapeHTML(">>>"), qq[ reset filter ], escapeHTML("<<<"), "\n"; + } + + } + + return $counter; +} + # search and output sub search_ports { local (@a) = (); @@ -450,6 +593,7 @@ sub check_input { || $stype eq "maintainer" || $stype eq "requires" || $stype eq "all" + || $stype eq "pkg" ) ) { @@ -497,6 +641,9 @@ description about the port.
Changes
Read the latest changes via the git repo
+ +
Packages
+
List of available packages for all supported releases and branches

Documentation

@@ -537,7 +684,7 @@ Copyright (c) 1996-2026 Wolfram Schneide

Questions

General questions about FreeBSD ports should be sent to -$mailtoList +the $mailtoList mailing list.

@{[ &footer_links ]} @@ -565,9 +712,10 @@ $path_info = &env('PATH_INFO') // ""; $section = $form{'sektion'}; $section = 'all' if ( !$section ); -$query = $form{'query'} // ""; -$stype = $form{'stype'} // ""; -$sourceid = $form{'sourceid'} // ""; +$query = $form{'query'} // ""; +$stype = $form{'stype'} // ""; +$sourceid = $form{'sourceid'} // ""; +$pkg_filter = $form{'pkg_filter'} // ""; $script_name = &env('SCRIPT_NAME'); $max = $form{'max'} // $max_hits_default; @@ -598,7 +746,13 @@ if ( !$query && $query_string =~ /^([^=&]+)$/ ) { @sec = &readcoll; $query = &check_query( $query, $sourceid ); -&forms; + +# no search menu for packages links +if ( $enable_packages_link && $stype eq 'pkg' ) { +} +else { + &forms; +} if ( $query_string eq "" || !$query ) { print &html_footer; @@ -616,8 +770,19 @@ $query =~ s/([^\w\^])/\\$1/g; # search if ($query) { - &readindex( *today, *msec ); - &search_ports; + my $q = ""; + if ( $query =~ m,^([A-Za-z0-9\-]+)(\\/)([A-Za-z0-9\-_\+\.\\]+)$, ) { + $q = "$1$2$3"; + $q =~ s,\\,,g; + } + + if ( $q ne "" && $enable_packages_link && $stype eq 'pkg' ) { + $counter = &package_links( $q, $pkg_filter ); + } + else { + &readindex( *today, *msec ); + &search_ports; + } } if ( !$counter ) { @@ -626,18 +791,19 @@ if ( !$counter ) { Sorry, nothing found. You may look for other FreeBSD Search Services

+@{[ &footer_links ]} EOF } -else { - print "\n"; +if ($counter) { + print "\n" if $stype ne 'pkg'; my $counter_message = $counter; if ( $counter >= $max ) { $counter_message .= " (max hit limit reached)"; warn "$counter_message: query=$query stype=$stype section=$section\n" if $debug >= 1; } - print "

Number of hits: $counter_message\n

\n"; + print "

Number of results: $counter_message\n

\n"; print &footer_links; }