git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] Makefile: Fix compilation of windows resource file

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2014, 23:48 UTC
Message-ID
<xmqqk3dssxpb.fsf@gitster.dls.corp.google.com>
In-Reply-To
<52DEF9F2.1000905@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 9 quoted lines
>> Note that I am merely guessing that "short-digit" version numbers
>> are acceptable by now after seeing
>> 
>>     https://sourceware.org/ml/binutils/2012-07/msg00199.html
>
> Ah, nice find!
>
> I will test your patch (below) and let you know soon, but it looks
> good to me. (I can't test it tonight, unfortunately.)

One thing to note is that I don't know why the existing code dropped the fourth digit from the maintenance series. The updated one will give you "1,8,5,3,0" (because I just have a hardcoded ",0" at the end for no good reason there), and if the missing fourth digit in the original was a deliberate workaround for this file having an upper limit of the number of digits (like "four"), this change will break it, so if that is the case, you may have to count and stop the loop early, perhaps like...

Show 9 quoted lines
>> diff --git a/gen-version-string.sh b/gen-version-string.sh
>> new file mode 100755
>> index 0000000..00af718
>> --- /dev/null
>> +++ b/gen-version-string.sh
>> @@ -0,0 +1,13 @@
>> +#!/bin/sh
>> +
>> +IFS=.- result=
Add
	num_digits=0
here, and...
Show 5 quoted lines
>> +for v in $1
>> +do
>> +	if expr "$v" : '[0-9][0-9]*$' >/dev/null
>> +	then
>> +		result=$result${result:+,}$v
... insert these here.
                num_digits=$(( $num_digits + 1 ))
                if test $num_digits = 4
                then
                        break
                fi
Show 20 quoted lines
>> +	else
>> +		break
>> +	fi
>> +done
>> +echo "$result"
>> diff --git a/git.rc b/git.rc
>> index bce6db9..6f2a8d2 100644
>> --- a/git.rc
>> +++ b/git.rc
>> @@ -1,6 +1,6 @@
>>  1 VERSIONINFO
>> -FILEVERSION     MAJOR,MINOR,PATCH,0
>> -PRODUCTVERSION  MAJOR,MINOR,PATCH,0
>> +FILEVERSION     VERSIONSTRING,0
>> +PRODUCTVERSION  VERSIONSTRING,0
>>  BEGIN
>>    BLOCK "StringFileInfo"
>>    BEGIN
>> .
>> 
Previous: Ramsay JonesNext: Johannes Sixt
Message 5 of 15 in “Makefile: Fix compilation of windows resource file”
  1. Makefile: Fix compilation of windows resource fileRamsay Jones, Jan 20, 2014
  2. Junio C HamanoJan 21, 2014
  3. Junio C HamanoJan 21, 2014
  4. Ramsay JonesJan 21, 2014
  5. Junio C HamanoJan 21, 2014
  6. Johannes SixtJan 22, 2014
  7. Junio C HamanoJan 22, 2014
  8. Johannes SixtJan 22, 2014
  9. Junio C HamanoJan 22, 2014
  10. Junio C HamanoJan 22, 2014
  11. Makefile: Fix compilation of Windows resource fileJohannes Sixt, Jan 23, 2014
  12. Pat ThoytsJan 23, 2014
  13. Johannes SixtJan 23, 2014
  14. Pat ThoytsJan 23, 2014
  15. Junio C HamanoJan 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.