diff --git a/website/content/en/cgi/ports.cgi b/website/content/en/cgi/ports.cgi
index 40570635a4..90c15c592e 100755
--- a/website/content/en/cgi/ports.cgi
+++ b/website/content/en/cgi/ports.cgi
@@ -1,885 +1,910 @@
#!/usr/local/bin/perl -T
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 1996-2026 Wolfram Schneider
The FreeBSD Ports and Packages Collection offers a simple way for
users and administrators to install applications.
Package Name searches for the name of a port or distribution.
Description searches case-insensitive in a short comment about the port.
All searches case-insensitive for the package name and in the
description about the port.
Maintainer searches for the email address of the port maintainer.
Requires searches for ports which depends on this port.
Handbook: Using the Ports Collection
You may also search the
ports manual pages.
The script ports.cgi use the file
$ports_database
as database for its operations. $ports_database is updated automatically every
two hours.
For other FreeBSD Releases INDEX files, please look at
https://download.freebsd.org/ports/index/
@{[ &last_update_message ]}
General questions about FreeBSD ports should be sent to
the $mailtoList mailing list.
}
. qq{Category $1}
. "
\n\n";
$out_sec = $1;
}
}
$rdepends //= "";
$counter++;
$pathB = $path;
my $port_path = $path;
$port_path =~ s,/usr/ports/,,;
$pathB =~ s/^$localPrefix/ports/o;
$path =~ s/^$localPrefix/$remotePrefixFtp/o;
$descfile =~ s/^$localPrefix/$remotePrefixFtp/o;
$version = &encode_url($version);
+ $email = &check_freebsd_mailing_list($email) if $enable_check_freebsd_mailing_list;
#$version =~ s/[\+,]/X/g;
local ($l) = $path;
$l =~ s%^$remotePrefixFtp%$remotePrefixRepo/log%o;
local ($t) = $path;
$t =~ s%^$remotePrefixFtp%$remotePrefixRepo/tree%o;
$descfile =~ s%^$remotePrefixFtp%$remotePrefixRepo/plain%o;
print
qq{
\n};
print qq[Description\n];
print qq[: Changes\n];
print qq[: Packages\n]
if $enable_packages_link;
print qq[
\n];
print qq{Maintained by: $email
\n};
local (@s) = split( /\s+/, $sections );
if ( $#s > 0 ) {
print qq{Also listed in: };
foreach (@s) {
print qq{$_ }
if $_ ne $out_sec;
}
print "
\n";
}
if ( $bdepends || $rdepends ) {
local ($flag) = 0;
local ($last) = '';
print qq{Requires: };
foreach ( sort split( /\s+/, "$bdepends $rdepends" ) ) {
# delete double entries
next if $_ eq $last;
$last = $_;
print ", " if $flag;
$flag++;
print qq{$_};
}
print "
\n";
}
print qq[$perl->{"name"}: ], escapeHTML( $perl->{"comment"} ),
qq[
\n];
print qq[homepage: ] . $perl->{"www"} . "
\n";
print qq[FreeBSD ports git: ]
. $perl->{"origin"}
. qq[
\n];
- print qq[maintainer: ], $perl->{"maintainer"}, "
\n";
+
+ my $maintainer = $perl->{"maintainer"};
+ $maintainer = &check_freebsd_mailing_list($maintainer) if $enable_check_freebsd_mailing_list;
+ print qq[maintainer: $maintainer
\n];
print qq[Description
\n];
print "", escapeHTML( $perl->{"desc"} ), "\n";
print qq[Download packages in *.pkg format
\n];
print $no_javascript_warning, $pkg_javascript;
print qq{\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"};
my $flavor = $perl->{"annotations"}->{"flavor"} // "";
# show flavor
if ($flavor) {
$release = $release . " (" . $flavor . ")";
}
$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
&& index( $flavor, $filter ) < 0;
}
next if $counter >= $max;
$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 "Release <> \n};
print
qq{ Version <> \n};
print
qq{ Build Time <> \n};
print qq{\n";
print " \n";
$hash->{'version'}->{$version}++;
$hash->{'arch'}->{$arch}++;
$hash->{'release'}->{$rel}++;
$hash->{'flavor'}->{$flavor}++ if $flavor ne "";
$hash->{'snapshot'}->{$snapshot}++
if $snapshot eq 'latest' || $snapshot eq 'quarterly';
}
if ( $counter || $. >= 1 ) {
print <", qq[$release \n];
print "", $version, " \n";
print qq[], $time, " \n";
print "
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) = ();
local ( $key, $name, $text );
foreach $key ( sort keys %today ) {
next if $today{$key} !~ /$query/oi;
next if $counter >= $max;
@a = split( /\|/, $today{$key} );
$name = $a[0]; #$name =~ s/(\W)/\\$1/g;
$text = $a[3]; #$text =~ s/(\W)/\\$1/g;
if ( $section ne "all" ) {
next if $a[6] !~ /\b$section\b/;
}
#warn "$stype:$query: $name $text\n";
if ( $stype eq "name" && $name =~ /$query/o ) {
&out( $today{$key} );
}
elsif ( $stype eq "text" && $text =~ /$query/oi ) {
&out( $today{$key} );
}
elsif ( $stype eq "all"
&& ( $text =~ /$query/oi || $name =~ /$query/io ) )
{
&out( $today{$key} );
}
elsif ( $stype eq 'maintainer' && $a[5] =~ /$query/io ) {
&out( $today{$key} );
}
elsif (
$stype eq 'requires'
&& ( defined $a[7] && $a[7] =~ /$query/io
|| ( defined $a[8] && $a[8] =~ /$query/io ) )
)
{
&out( $today{$key} );
}
}
}
sub forms {
print qq{
@{[ &footer_links ]}
};
}
sub check_query {
my ( $query, $sourceid ) = @_;
$query =~ s/"/ /g;
$query =~ s/^\s+//;
$query =~ s/\s+$//;
# XXX: Firefox opensearch autocomplete workarounds
if ( $sourceid eq 'opensearch' ) {
# remove space before a dot
$query =~ s/ \././g;
# remove space between double colon
$query =~ s/: :/::/g;
}
return $query;
}
sub check_input {
if ($query) {
$stype = "all" if !$stype;
if (
!(
$stype eq "name"
|| $stype eq "text"
|| $stype eq "maintainer"
|| $stype eq "requires"
|| $stype eq "all"
|| $stype eq "pkg"
)
)
{
print
"unknown search type, use `all', `text', `name', 'requires', or `maintainer'\n";
warn "unknown search type ``", escapeHTML($stype),
"'', use `all', `text', `name', 'requires', or `maintainer'\n"
if $debug >= 1;
&exit(0);
}
}
$max = int($max);
if ( $max <= 0 || $max > $max_hits ) {
my $old_max = $max;
$max = $enable_packages_link
&& $stype eq 'pkg' ? $max_hits_pkg : $max_hits_default;
warn "reset max=$old_max to $max\n";
}
}
sub help {
print <FreeBSD Ports Search Help
External Links
Documentation
Updates
Copyright
Copyright (c) 1996-2026 Wolfram Schneider <wosch\@FreeBSD.org>
Misc
Questions
EOF
}
sub footer_links {
return <
Number of results: $counter_message\n
\n"; print &footer_links; } print qq{