supplierdeeply

CHDK svn revision in get_buildinfo() incorrect

  • 3 Replies
  • 1083 Views
CHDK svn revision in get_buildinfo() incorrect
« on: 19 / October / 2013, 11:04:32 »
Advertisements
Just a quick note to log that the SVN revision returned from the Lua get_buildinfo() function is currently incorrect for installation zip files created on the autobuild server.

Code: [Select]
bi=get_buildinfo()
print(bi.build_revision)
prints out    0

This also affects the Revision reported by the Miscellaneous | Show Build Info menu item.

Script workaround :

Code: [Select]
if ( tonumber(bi.build_revision) > 0 ) then
    build = tonumber(bi.build_revision)
else
    build = tonumber(string.sub(bi.build_number,7,10))
end
Apparently this bug crept in last year during the merge of the CHDK-DE and CHDK code base.
« Last Edit: 19 / October / 2013, 12:00:20 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11443
Re: CHDK svn revision in get_buildinfo() incorrect
« Reply #1 on: 19 / October / 2013, 15:49:40 »
Hacki said he would look into fixing this. However, people who want to make scripts that detect versions from before the fix will still need to check both variants.

My understanding is that the autobuild had a special hack to add the SVN rev to the build number. Later, we added the ability to have svn rev in it's own field, but no one checked how that interacted with the autobuild.

I would suggest
Code: [Select]
build = tonumber(string.match(bi.build_number,'-(%d+)$'))
Which will be independent of the string length or number of digits in the svn rev, and return nil if for strings that don't end in -svnrev
Don't forget what the H stands for.

Re: CHDK svn revision in get_buildinfo() incorrect
« Reply #2 on: 25 / October / 2013, 21:55:19 »
This issue was fixed effective 2013/10/25 - CHDK build 3176.  Downloads from the autobuild now reflect the correct SVN revision number.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11443
Re: CHDK svn revision in get_buildinfo() incorrect
« Reply #3 on: 26 / October / 2013, 19:44:33 »
This fix made the autobuild stop putting the svn rev in the zip name. This may have impacted some of the setup tools.

I've changed the zip build commands to include this automatically, without a special case on the autobuild server. If an svn rev isn't available, 0 will be used instead.
Don't forget what the H stands for.


 

Related Topics