From 32287f77bb39b29226fed3704f5ea303cfc953be Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 25 Aug 2013 18:11:39 +0200 Subject: [PATCH] www: Decrease importance of the section number in man page selection The distro comparisons are more important, because otherwise some man page lookups will result in receiving a very obscure man page from some old version of FreeBSD or Gentoo, when you're more likely to look for something modern. --- www/index.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/index.pl b/www/index.pl index 27d7415..2e9d0bf 100755 --- a/www/index.pl +++ b/www/index.pl @@ -469,15 +469,15 @@ sub getman { # Give lower priority to pages in a non-standard directory : !($a->{filename} =~ q{^/usr/share/man}) != !($b->{filename} =~ q{^/usr/share/man}) ? ($a->{filename} =~ q{^/usr/share/man} ? -1 : 1) - # Lower sections > higher sections (because 'man' does this as well) - : substr($a->{section},0,1) ne substr($b->{section},0,1) - ? $a->{section} cmp $b->{section} # Prefer Arch over other systems : ($a->{system} != 1 || $b->{system} != 1) && $self->{sysbyid}{$a->{system}}{name} ne $self->{sysbyid}{$b->{system}}{name} ? ($a->{system} == 1 ? -1 : 1) # Prefer a later system release over an older one : $a->{system} != $b->{system} && $self->{sysbyid}{$a->{system}}{name} eq $self->{sysbyid}{$b->{system}}{name} ? $self->{sysbyid}{$b->{system}}{relorder} <=> $self->{sysbyid}{$a->{system}}{relorder} + # Lower sections > higher sections (because 'man' does this as well) + : substr($a->{section},0,1) ne substr($b->{section},0,1) + ? $a->{section} cmp $b->{section} # Sections without appendix before sections with appendix : $a->{section} ne $b->{section} ? $a->{section} cmp $b->{section}