Bryan Kadzban wrote:
> Bruce Dubbs wrote:
>> Doing some debugging, I'm making some progress.  I made some debug 
>> printouts and in the first case got:
>>
>>    required_pkgconfig_version 999.999
>>
>> but in the second
>>
>>    required_pkgconfig_version a=b
>>
>> (which for some reason returns a positive number for
>> compare_versions ("0.26", "a=b") but that's a nonsense comparison due to 
>> the invalid command line parsing.
> 
> rpmvercmp() is screwy (in pkg.c).  It compares the two as numbers (since
> the first char of the first string is a digit), but ends up doing it
> piecewise: comparing "0" to "" (since the first char of the second arg
> is not a digit).  This triggers a line preceded with a comment pointing
> at RH bugzilla, bug 50977 -- the code returns 1 if the first item was
> numeric, and -1 otherwise.
> 
> But the real bug is below.
> 
>> I'm continuing to check.
> 
> This looked interesting, so I started digging as well.  I think I found it.
> 
> poptGetNextOption, after it invokes the callback for
> --define-variable=a=b (the operation of which sets the longArg local
> variable), does not reset longArg to NULL.  So on the next time through
> its loop (after invoking the --define-variable callback, before invoking
> the --atleast-pkgconfig-version callback), on line 389 of popt.c, sets
> con->os->nextArg to longArg (the old "a=b" string).  What it should do
> is set nextArg to nextCharArg (the next item on the command line).  This
> happens if longArg is NULL.
> 
> Adding a "longArg = NULL;" as the first line of the "while (!done) {"
> loop makes the tests pass.  I don't *think* it breaks anything else, but
> I don't know for sure.
> 
> Short patch attached.  It can probably be turned into a sed.

LOL.  I just figured that out before I got your post.  Thanks for 
confirming.  The real fix will be for pkg-config upstream maintainers to 
integrate the latest popt into the code base.

   -- Bruce


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to