[PATCH] setup: fix handling of -X.Y releases

Yaakov Selkowitz yselkowitz@cygwin.com
Tue Dec 9 16:42:00 GMT 2014


On 2014-12-09 04:34, Corinna Vinschen wrote:
> On Dec  8 16:03, Yaakov Selkowitz wrote:
>> --- package_source.cc	17 Apr 2006 16:13:17 -0000	2.10
>> +++ package_source.cc	8 Dec 2014 21:43:15 -0000
>> @@ -52,9 +52,9 @@ packagesource::set_canonical (char const
>>     while (bend && (tmp = strchr (bend + 1, '-')))
>>       bend = tmp;
>>     if (bend)
>> -    bend = strchr (bend, '.');
>> +    bend = strstr (bend, ".tar");
>>     else
>> -    bend = strchr (bstart, '.');
>> +    bend = strstr (bstart, ".tar");
>>
>>     if (!bend)
>>       bend = strchr (bstart, '\0');
>
> That's the only change necessary to fix this?  Nice.

I believe so, AFAICS the issue was only cosmetic (the .Y being dropped 
during the progress indicator).  I don't see any other cases where '.' 
is assumed to indicate the file extension of a package.

> Would it make sense to extend the search string to ".tar." (trailing dot)
> to make sure we're really hitting the suffix?  Or does the above code have
> to take non-compressed tar archive names into account?

I don't know for sure; just ".tar" is used in other relevant places in 
setup.

--
Yaakov



More information about the Cygwin-apps mailing list