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
@@ -1,645 +1,811 @@
#!/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.
@{[ &last_update_message ]}
General questions about FreeBSD ports should be sent to
-$mailtoList
+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);
#$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[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: $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"}: $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 "Release Version Build Time \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 <", 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 ) {
warn "reset max=$max to $max_hits_default\n";
$max = $max_hits_default;
}
}
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 hits: $counter_message\n
\n"; + print "Number of results: $counter_message\n
\n"; print &footer_links; } print qq{