Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 2714

Summary: lintool reports the string literal "use" as an error when it's part of a message
Product: Gentoo Linux Reporter: Sandy McArthur <Sandy>
Component: [OLD] DevelopmentAssignee: Karl Trygve Kalleberg (RETIRED) <karltk>
Severity: minor    
Priority: Low    
Version: 1.0   
Hardware: x86   
OS: Linux   
Package list:
Runtime testing required: ---

Description Sandy McArthur 2002-05-13 22:11:51 UTC
I first noticed this on the dev-lang/icc-6.0.ebuild . If you run `lintool
icc-6.0.ebuild` it complains about 1 USE error. If you edit the ebuild and
change the one occurent of "use" to something else the error goes away.

I'll admit it's diffcult to dectect if "use" it a command or a string literal
and here is the best/eaiest case I can think of off the top of my head.

When a use is found, take the substring before the "use", remove any esacped
quotes (\").
If there is an even number of quotes then it is a command.
If there is an odd number you need to count the number of back ticks "`".
If there is an odd number of back ticks "`" then it is a comand.

You should probably account for single quotes but I think that will complicate
the code a lot more.

This won't prevent all false errors but it's easier than writing a shell
interpeter which would be needed to do it right.
Comment 1 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2002-05-14 18:32:23 UTC
Fixed for now. Not all false positives have been removed. I suggest we simply
rewrite the sentences slightly for the rest ;P