[Lxr-dev] [ lxr-Bugs-565811 ] unreadable files can terminate genxref !! includes FIX
Brought to you by:
ajlittoz
From: <no...@so...> - 2002-09-06 12:36:54
|
Bugs item #565811, was opened at 2002-06-07 06:25 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=565811&group_id=27350 Category: Lang support Group: v0.9.1 Status: Closed Resolution: Fixed Priority: 5 Submitted By: Gregor Hartmann (grex) Assigned to: Nobody/Anonymous (nobody) Summary: unreadable files can terminate genxref !! includes FIX Initial Comment: When an unreadable file is encountered whos language cannot be determined by the filename the file is opened to see if it is a script. The file is opened using FileHandle to read the first line. however if new FileHandle fails, this is not checked and getline terminates the program with following error: Can't call method "getline" on an undefined value at lib/LXR/Lang.pm line 47. I changed some lines in lib/LXR/Lang.pl to fix this. The files are then treated as if no language was found. I Added two lines of context above and below starting at line 41 in lib/LXR/Lang.pl if (!defined $lang) { # Try to see if it's a script my $shebang; my $fh = $files->getfilehandle($pathname, $release); if ( 1 ) { $fh->getline =~ /^\#!\s*(\S+)/s; $shebang = $1; } else { $shebang = ""; } my %filetype = %{$config->filetype}; my %inter = %{$config->interpreters}; ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2002-09-06 05:36 Message: Logged In: NO Hi, How can unreadable/invisible files be excluded from index generation completely?. I have integrated LXR with config'n management system, ClearCase, which used views which filters what files/dirs (elements) that applied. The problem is that these files/dirs are still included in mysql index generation. In LXR release 0.9.1, I also made fixes to make genxref able to generate versions with such unreadable files. However, did not manage to exclude such entries completely. How about you - any suggestions/fixes? See below for an example BR Sverre Torjussen (Ericsson/Norway) > It seems as though 'invisible' files/dirs (or nonexisting not just not > readable as in this case) are still presented in lxr0.9.2. Here is an > example. > > (root) krem:/space/lxr/src_root>ls -l /view/lxr_CRH109338_LAST1/clearcase/semafor/GR_FuncBlocks_002/cnh160583_ip > /view/lxr_CRH109338_LAST1/clearcase/semafor/GR_FuncBlocks_002/cnh160583_ip/doc: No such file or directory > total 3 > -r--r--r-- 1 etomvs eto-semafor 228 May 3 17:56 1551_cnh160583.cfg > drwxrwxrwx 2 etohajn eto-semafor 27 May 3 17:55 config > drwxrwxrwx 2 etohajn eto-semafor 30 May 3 17:55 includeg > > In this case, the 'doc' dir is still presented by lxr. > > How can this be excluded? > ---------------------------------------------------------------------- Comment By: Malcolm Box (mbox) Date: 2002-07-28 17:47 Message: Logged In: YES user_id=215386 Fixed in current CVS ---------------------------------------------------------------------- Comment By: Gregor Hartmann (grex) Date: 2002-06-07 07:46 Message: Logged In: YES user_id=559509 that should be a if ( $fh ) instead of if ( 1 ) of course up there ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=565811&group_id=27350 |