summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-06-09 16:56:41 +0200
committerYorhel <git@yorhel.nl>2021-06-09 16:56:43 +0200
commita96aeb6310f48ec616154c1be7e40ccbfbd0a3a2 (patch)
treeef0d95dd3b7a9cab3c65a3217af1f3942c8696db
parent98e4f014ba242f026102274c4849d9e4de1e2eb2 (diff)
Fix /man/* redirects
Forgot to update these functions in the rewrite.
-rwxr-xr-xwww/index.pl11
1 files changed, 4 insertions, 7 deletions
diff --git a/www/index.pl b/www/index.pl
index f8e7b46..b0a9235 100755
--- a/www/index.pl
+++ b/www/index.pl
@@ -717,7 +717,7 @@ TUWF::get qr{/(?<name>[^/]+)(?:/(?<hash>[0-9a-f]{8}))?} => sub {
# Unfortunately, even in the permalink format with the hash, we don't know
# from which package we're supposed to get the man page. This info is
# needed in order to do .so substitution, so we can substitute files from
- # the same package as the requested man page. Use the dbManPref logic here
+ # the same package as the requested man page. Use the man_pref logic here
# to deterministically select a good package.
my($man, undef) = $shorthash
? man_pref undef, sql 'm.name =', \$name, 'AND', sql_hash_prefix 'm.hash', $shorthash
@@ -897,19 +897,16 @@ TUWF::get qr{/man/([^/]+)/(.+)} => sub {
my $man;
if($path !~ m{/}) { # (1)
- ($man) = tuwf->dbManPrefName($path, sysid => $sysid);
+ ($man) = man_pref_name $path, sql 's.id IN', $sysid;
} else {
$path =~ s{/([^/]+)$}{};
my $name = $1;
- my($pkg, $ver) = pkg_frompath(sql('system IN', $sysid), $path); # Handles (2) and (3)
+ my($pkg, $ver) = pkg_frompath sql('system IN', $sysid), $path; # Handles (2) and (3)
return tuwf->resNotFound if !$pkg;
- my $verid = tuwf->dbVali('SELECT id FROM package_versions WHERE package =', \$pkg->{id}, 'AND version =', \$ver);
- return tuwf->resNotFound if $ver && !$verid;
-
- ($man) = tuwf->dbManPrefName($name, sysid => $sysid, pkgid => $pkg->{id}, pkgver => $verid);
+ ($man) = man_pref_name $name, sql 's.id IN', $sysid, 'AND p.id =', \$pkg->{id}, $ver ? ('AND v.version =', \$ver) : ();
}
return tuwf->resNotFound if !$man;