text stringlengths 0 834k |
|---|
set rebuildhtml 1 |
PPM3: |
set rebuild-html 1 |
END |
sub smry_unicode { ""notes about unicode author names"" } |
sub help_unicode { <<'END' } |
unicode -- Notes About Unicode Author Names |
Description |
CPAN author names are defined to be in Unicode. Unicode is an |
international standard ISO 10646, defining the *Universal Character Set |
(UCS)*. UCS contains all characters of all other character set |
standards. For more information about Unicode, see |
http://www.unicode.org/. |
The CPAN authors website is located at your local CPAN mirror under |
/authors/00whois.html. For example, you can view it at |
http://www.cpan.org/authors/00whois.html. This page can be rendered by |
Mozilla 0.9.8 and Internet Explorer 5.0, but you may have to install |
extra language packs to view all the author names. |
By default, PPM3 renders all characters as Latin1 when it prints them to |
your console. Characters outside the Latin1 range (0-255) are not |
printed at all. |
If your console can render UTF-8 characters, you can tell PPM3 not to |
recode characters by using one of the following environment variables: |
* LC_ALL |
* LC_CTYPE |
* LANG |
* PPM_LANG |
PPM3 requires one of these environment variables to contain the string |
'UTF-8'. For example, the following setting make PPM3 print |
beautifully-formatted authors in RedHat Linux 7.2 (assumes you're using |
a Bourne shell): |
$ PPM_LANG='en_US.UTF-8' xterm -u8 -e ppm3 |
Linux and Solaris users should refer to xterm for more information about |
setting up xterm to display UTF-8 characters. |
END |
#============================================================================ |
# Utility Functions |
#============================================================================ |
sub sort_fields { qw(name title author abstract version repository) } |
sub sort_pkgs { |
my $o = shift; |
my $field = lc shift; |
my @pkgs = @_; |
my $targ = $o->conf('target'); |
my $filt = sub { $_[0]->getppd_obj($targ)->result->$field }; |
if ($field eq 'name') { |
return dictsort $filt, @pkgs; |
} |
if ($field eq 'title') { |
return dictsort $filt, @pkgs; |
} |
if ($field eq 'author') { |
return dictsort $filt, @pkgs; |
} |
if ($field eq 'abstract') { |
return dictsort $filt, @pkgs; |
} |
if ($field eq 'repository') { |
return dictsort sub { $_[0]->repository->name }, @pkgs; |
} |
if ($field eq 'version') { |
return sort { |
my $pa = $a->getppd_obj($targ)->result; |
my $pb = $b->getppd_obj($targ)->result; |
$pb->uptodate($pa->version_osd) <=> $pa->uptodate($pb->version_osd) |
} @pkgs; |
} |
@pkgs; |
} |
sub find_index { |
my $entry = shift || ''; |
my $index = shift; |
$index = 0 unless defined $index; |
for (my $i=0; $i<@_; $i++) { |
return $index + $i if $entry eq $_[$i]; |
} |
return $index - 1; |
} |
sub bounded { |
my $lb = shift; |
my $d = shift; |
my $ub = shift; |
return ($d >= $lb and $d <= $ub); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.