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

Bug 76339

Summary: gensync(0.1.0) from app-portage/gentoolkit-dev-0.2.0_pre4 fails to parse config file
Product: Gentoo Linux Reporter: Drake Wyrm <lilwyrm>
Component: Current packagesAssignee: Portage Tools Team <tools-portage>
Status: VERIFIED INVALID    
Severity: normal    
Priority: High    
Version: 2004.3   
Hardware: All   
OS: Linux   
URL: http://www.haell.com/~wyrm/projects/bugs/gensync/
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to fix gensync

Description Drake Wyrm 2005-01-01 12:50:15 UTC
The function ConfigDefaults._init_from_file in gensync(0.1.0) from app-portage/gentoolkit-dev-0.2.0_pre4 fails to properly parse "/etc/gensync/gensync.conf". Given the syntax of "gensync.conf", there would be three space-separated values in a well-formed line. The _init_from_file function parses for two values.

The attached patch, while sloppy, allows gensync to parse it's config file with the given syntax. An alternative approach would be to remove the spaces from beside the "=" character in the config file and change line 40 of gensync to read

	(attrib, value) = x.split("=")

All things considered, that would be a lot cleaner.
Comment 1 Drake Wyrm 2005-01-01 12:51:35 UTC
Created attachment 47330 [details, diff]
patch to fix gensync
Comment 2 Emil Beinroth 2005-01-30 12:23:18 UTC
Hm, if I look at my gensync it already does
(attrib, value) = x.split("=")
and strip whitespaces from both sides of attrib and value.

Perhaps you meant app-portage/gentoolkit-dev-0.2.0_pre2 .. in that case look at
http://bugs.gentoo.org/show_bug.cgi?id=44777 :)
Comment 3 Drake Wyrm 2005-01-30 23:28:16 UTC
Nope.

The x.split("=") you mention is in a different section where it's parsing a different file.

I meant _pre4. That's the one I installed when I wanted to try gensync. Sure wish somebody hadn't marked #44777 fixed. I might have been able to find that bug instead of filing this one.
Comment 4 Emil Beinroth 2005-01-31 15:19:23 UTC
Hm, funny thing:
appro ~ # wget "http://bugs.gentoo.org/attachment.cgi?id=47330&action=view"
--00:14:26--  http://bugs.gentoo.org/attachment.cgi?id=47330&action=view
           => `attachment.cgi?id=47330&action=view'
....
00:14:26 (5.17 MB/s) - `attachment.cgi?id=47330&action=view' saved [542/542]

appro ~ # patch --dry-run -p0 -d /usr/bin/ < \
attachment.cgi\?id\=47330\&action\=view
patching file gensync
Hunk #1 FAILED at 34.
1 out of 1 hunk FAILED -- saving rejects to file gensync.rej
appro ~ # 

and if I compare your patch http://bugs.gentoo.org/attachment.cgi?id=47330&action=view with the patch from the other bug http://bugs.gentoo.org/attachment.cgi?id=27458&action=view , I can clearly see that this already has been fixed.
Perhaps your should emerge -va gentoolkit-dev and look at the version .. then try to patch pre4 with your diff.
Comment 5 Drake Wyrm 2005-02-01 01:08:58 UTC
Hmmm.... I must be on crack or something. I swear I had _pre4 installed this morning when I wrote comment #3, but this evening I only had _pre3 installed. Upon upgrading, it seems the problem is indeed fixed in _pre4. I apologize to all for the noise, and thank you Emil for pointing out my confusion.