[Lxr-commits] CVS: lxr source,1.44,1.44.2.1
Brought to you by:
ajlittoz
From: Malcolm B. <mb...@us...> - 2005-02-14 22:58:29
|
Update of /cvsroot/lxr/lxr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5377 Modified Files: Tag: bk-dev-branch source Log Message: Remove uses of toreal() except for with CVS module. These should probably be removed as well... Index: source =================================================================== RCS file: /cvsroot/lxr/lxr/source,v retrieving revision 1.44 retrieving revision 1.44.2.1 diff -u -d -r1.44 -r1.44.2.1 --- source 2 Sep 2004 15:26:42 -0000 1.44 +++ source 14 Feb 2005 22:58:20 -0000 1.44.2.1 @@ -27,8 +27,8 @@ $CVSID = '$Id$ '; use strict; -use lib '.'; # for Local.pm -use lib do { $0 =~ m{(.*)/} ? "$1/lib" : "lib" }; # if LXR modules are in ./lib +use lib '.'; # for Local.pm +use lib do { $0 =~ m{(.*)/} ? "$1/lib" : "lib" }; # if LXR modules are in ./lib use LXR::Common qw(:html); use Local; @@ -43,8 +43,9 @@ $img = "/icons/folder.gif"; } - return fileref("<img align=\"bottom\" border=\"0\" src=\"$img\" alt=\"folder\">", "", - $dir . $node); + return fileref( + "<img align=\"bottom\" border=\"0\" src=\"$img\" alt=\"folder\">", + "", $dir . $node); } sub dirname { @@ -76,7 +77,8 @@ } else { $img = "/icons/generic.gif"; } - return fileref("<img align=\"bottom\" border=\"0\" src=\"$img\" alt=\"\">", "", $dir . $node); + return fileref("<img align=\"bottom\" border=\"0\" src=\"$img\" alt=\"\">", + "", $dir . $node); } sub filename { @@ -121,8 +123,11 @@ my @t = gmtime($file_time); my ($sec, $min, $hour, $mday, $mon, $year) = @t; - return - sprintf("%04d-%02d-%02d %02d:%02d:%02d", $year + 1900, $mon + 1, $mday, $hour, $min, $sec); + return sprintf( + "%04d-%02d-%02d %02d:%02d:%02d", + $year + 1900, + $mon + 1, $mday, $hour, $min, $sec + ); } sub bgcolor { @@ -145,8 +150,7 @@ @nodes = $files->getdir($dir, $release); unless (@nodes) { - print( "<p align=\"center\">\n<i>The directory " - . $files->toreal($dir, $release) + print( "<p align=\"center\">\n<i>The directory " . $dir . " does not exist.</i>\n"); print( "\<p align=\"center\">\n<i>This directory might exist in other versions, try 'Show attic files' or select a different Version.</i>\n" @@ -154,12 +158,6 @@ if $files->isa("LXR::Files::CVS") and !$HTTP->{'param'}->{'showattic'}; - #FIXME what does this do? - if ($files->toreal($dir, $release) =~ m#(.+[^/])[/]*$#) { - if (-e $1) { - warning("Unable to open " . $files->toreal($dir, $release)); - } - } return; } @@ -175,9 +173,10 @@ 'namelink' => sub { dirname(@_, $node, $dir) }, 'filesize' => sub { '-' }, 'modtime' => sub { modtime(@_, $node, $dir) }, - 'bgcolor' => sub { bgcolor(@_, $line++) }, - 'css' => sub { rowclass(@_, $line++) }, - 'description' => sub { descexpand(@_, $node, $dir, $release) } + 'bgcolor' => sub { bgcolor(@_, $line++) }, + 'css' => sub { rowclass(@_, $line++) }, + 'description' => + sub { descexpand(@_, $node, $dir, $release) } ) ); } else { @@ -193,7 +192,9 @@ 'css' => sub { rowclass(@_, $line++) }, 'description' => sub { ( - $files->toreal($dir . $node, $release) =~ m|/Attic/| + $files->isa('LXR::Files::CVS') + && $files->toreal($dir . $node, $release) =~ + m|/Attic/| ? "<i>In Attic</i> " : "" ) @@ -269,7 +270,9 @@ } $b = $a; - $a .= ' ' x (6 - length($a)) . $files->getauthor($pathname, $a); + $a .= + ' ' x (6 - length($a)) + . $files->getauthor($pathname, $a); $a .= ' ' x (16 - length($a)); } } @@ -286,37 +289,37 @@ } } else { - print("\<p align=\"center\">\n<i>The file $pathname does not exist.</i>\n"); + print( + "\<p align=\"center\">\n<i>The file $pathname does not exist.</i>\n" + ); print( "\<p align=\"center\">\n<i>This file might exist in other versions, try 'Show attic files' or select a different Version.</i>\n" ) if $files->isa("LXR::Files::CVS") and !$HTTP->{'param'}->{'showattic'}; - if (-f $files->toreal($pathname, $release)) { - warning("Unable to open " . $files->toreal($pathname, $release)); - } } } } +} httpinit; if ($config->filter && $pathname !~ $config->filter) { - makeheader('source'); - print("\<p align=\"center\">\n<i>The file $pathname does not exist.</i>\n"); - makefooter('source'); - exit; + makeheader('source'); + print("\<p align=\"center\">\n<i>The file $pathname does not exist.</i>\n"); + makefooter('source'); + exit; } # If the file is html then simply pump it out. if ($pathname =~ /\.(html)$/ || $HTTP->{'param'}->{'raw'}) { - printfile(1); + printfile(1); } else { - my $type = ($pathname !~ m|/$| ? 'source' : 'sourcedir'); + my $type = ($pathname !~ m|/$| ? 'source' : 'sourcedir'); - makeheader($type); - printfile(0); - makefooter($type); + makeheader($type); + printfile(0); + makefooter($type); } httpclean; |