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

Bug 157932

Summary: [PATCH] Typo patch for portage
Product: Portage Development Reporter: Andre Hinrichs <andre.hinrichs>
Component: UnclassifiedAssignee: Portage team <dev-portage>
Status: RESOLVED OBSOLETE    
Severity: trivial    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: typo patch
new patch file

Description Andre Hinrichs 2006-12-12 09:46:52 UTC
I started to search for typos in the whole system. As one of the first packages, here is a patch for the portage itself.
The patch will follow in a minute...

See also http://forums.gentoo.org/viewtopic-p-3778458.html#3778458
Comment 1 Andre Hinrichs 2006-12-12 09:49:23 UTC
Created attachment 103875 [details, diff]
typo patch
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2006-12-12 10:15:32 UTC
Not good: this patch includes at least one API change (stopped reading it after the first) and removes some stuff it shouldn't remove (like \n). I assume you just ran sed on the file, but you have to verify it manually (unless someone else wants to fix this patch).
Comment 3 Andre Hinrichs 2006-12-12 11:19:55 UTC
Created attachment 103883 [details, diff]
new patch file

sorry, thought, that was only a newline...
Is it not?
Found this by typing "portageq --help"
Anyway, removed that from the patch file.
Still... there is a change of a variable name. But I think typos in active code is more bad than typos in comments, don't you think so?
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-12-12 11:26:07 UTC
(In reply to comment #3)
> Created an attachment (id=103883) [edit]
> new patch file
> 
> sorry, thought, that was only a newline...
> Is it not?
> Found this by typing "portageq --help"
> Anyway, removed that from the patch file.
> Still... there is a change of a variable name. But I think typos in active code
> is more bad than typos in comments, don't you think so?
> 

Actually, typos in active code are forgiveable (typos or not the code is in a known working state)
Comment 5 Andre Hinrichs 2006-12-12 11:59:44 UTC
I would suggest to add substitute functions in case of mistyped function names. Here is an example:

do_seperate(a,b,c)
{
    obsolete_warning "please use do_separate instead"
    do_separate(a,b,c)
}

In case of compilable code (C,C++,JAVA) this could be a compiler warning.

But if the typo is a local variable name which is only used in the function (as in this patch) then this should not harm anything.

What do you think? And... is the patch ok or not?
Comment 6 Marius Mauch (RETIRED) gentoo-dev 2006-12-12 17:13:43 UTC
(In reply to comment #3)
> sorry, thought, that was only a newline...
> Is it not?

The \n is the separator that the description refers to.

> Still... there is a change of a variable name. But I think typos in active 
> code is more bad than typos in comments, don't you think so?

s/more bad/worse/ ;)
And no. If you fix a typo in code you have to fix all occurences, but if the typo is in a public symbol (like a function name or parameter) you can't do that as you don't have control over every possible caller (granted in this case there probably aren't any callers, didn't notice that the function was in repoman at first). But IMHO this kind of typo is mostly irrelevant anyway (I think everybody understands what is meant as it's phonetically correct).

(In reply to comment #5)
> I would suggest to add substitute functions in case of mistyped function 
> names.
> Here is an example:
> 
> do_seperate(a,b,c)
> {
>     obsolete_warning "please use do_separate instead"
>     do_separate(a,b,c)
> }

Thanks, I know how to write a wrapper function ;)
But wouldn't help in this case as the typo is in a parameter name.

> But if the typo is a local variable name which is only used in the function 
> (as in this patch) then this should not harm anything.

Just that it's not a local variable but a parameter. Ok, nobody actually calls functions defined in repoman (didn't notice the location at first) so you could probably get away with it in this case, but in portage.py for example breakage would be guaranteed.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-29 05:21:17 UTC
All of these typos are long fixed.