VERSION command needs improvements

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
samo79
Posts: 555
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

VERSION command needs improvements

Post by samo79 »

I think we need some improvements for the VERSION command, i use the latest 53.5 availible on the Update 3 and some problems still for checking strings with certain software, in particular i note problems with 2 software, CodeAudio (68k) from Denill and AmiArcadia 68k binary from James Jacobs

The first (CodeAudio) is an E program, and it seems it fail to catch the version number once we open it to check the version, Daniel say:
I think C:Version looks for a .cdata chunk in the file but since this
is an Amiga-E program there are no chunks and then C:Version will only
search a number bytes at the beginning of the program. But CodeAudio is
to big and the version string is too far away so it is not found. Nothing
I can do about it. It works on OS3 though since OS3 C:Version will scan
the entire file until it finds the version.
So the same binary works fine under AmigaOS 3.x but fails to check the command VERSION under AmigaOS 4.x

The other program i tested is AmiArcadia, this is what James discovered during our port from 68k to OS4
Version:

(a) Version strings which are not prepended by a NUL ($00) byte are not
parsed correctly.
(b) Multiple version strings in one file confuse the parser.
(c) "If I create a file with nothing but the OS3 executable identifier
($000003F3) at the beginning followed by a valid version string, the
Version command won't find the version. If the executable identifier
is replaced with anything else (binary or alphanumeric) then the
Version command works. My suspicion is that if the Version command
finds an OS3 executable identifier at the beginning of a file, it only
looks for a version string in a particular type of Amiga OS hunk. If
that's not the case then it is a complete mystery to me. Regardless,
the Version command should get fixed for the next OS4 release."
More info at: http://amigan.1emu.net/releases/ami-code.txt

So would be cool if VERSION command can be fixed on OS4 almost to support any AmigaOS 3.x behaviours
User avatar
Rigo
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 349
Joined: Mon Jan 17, 2011 9:42 pm

Re: VERSION command needs improvements

Post by Rigo »

The format of the version string is well documented, and the Version command should not be altered to cope with malformed strings. If the version command does not detect the $VER cookie correctly, chances are it's the application.

Simon
User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 920
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: VERSION command needs improvements

Post by ChrisH »

@samo79
A description of the $VER formation is given here:
http://openamiga.org/?function=viewpage&pageid=16

@samo79 & Simon
I took a look at CodeAudio, and it's $VER information is completely broken: Instead of using spaces between the different parts, it uses null (terminating zero) characters! It is unreasonable to expect OS4 to handle something so broken.

But I also looked at AmiArcadia, and it's $VER information looked quite VALID at first glance. It has a \0 before $VER:, spaces between items, etc. For fun I wrote an incomplete clone of Version, which I call SimpleVersion. It correctly extracts the $VER information from AmiArcadia, but OS4's command does not. You can download the executable & (PortablE based) source code here:
http://cshandley.co.uk/temp/SimpleVersion.lha

AmiArcadia that I used for testing can be found here:
http://aminet.net/package/misc/emu/AmiArcadia

@Simon
It might be worth creating a BugZilla entry for this?

(EDIT: Uploaded new version of SimpleVersion, which now returns the same error codes as Version, and fixes one instance where an undefined return code would be returned.)
User avatar
samo79
Posts: 555
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

Re: VERSION command needs improvements

Post by samo79 »

@ChrisH
I took a look at CodeAudio, and it's $VER information is completely broken: Instead of using spaces between the different parts, it uses null (terminating zero) characters! It is unreasonable to expect OS4 to handle something so broken.
Altrought even if broken it seems ok under AmigaOS 3.x, aniway i will point Denill to this thread :)
But I also looked at AmiArcadia, and it's $VER information looked quite VALID at first glance. It has a \0 before $VER:, spaces between items, etc. For fun I wrote an incomplete clone of Version, which I call SimpleVersion. It correctly extracts the $VER information from AmiArcadia, but OS4's command does not. You can download the executable & (PortablE based) source code here:
http://cshandley.co.uk/temp/SimpleVersion.lha
Same here, your test bin give me a version output without any text (as CodeAudio)
I test it on AmigaOS 4.1 Update 3 (Version 53.5, 19-Feb.2011)
AmiArcadia that I used for testing can be found here:
http://aminet.net/package/misc/emu/AmiArcadia
Yes is the correct one, only 68k bin of AmiArcadia have this problem with Version, conversely the Version command on the OS4 bin of AmiArcadia works perfectly, if you like to try you can download it from:

http://os4depot.net/?function=showfile& ... rcadia.lha

I will link this thread to James Jacobs aswell (the original author of AmiArcadia)

Thanks a lot for your testing and help ;)
xenic
Posts: 1165
Joined: Sun Jun 19, 2011 12:06 am

Re: VERSION command needs improvements

Post by xenic »

Rigo wrote:The format of the version string is well documented, and the Version command should not be altered to cope with malformed strings. If the version command does not detect the $VER cookie correctly, chances are it's the application.Simon
Is that why the version command doesn't return any version information for any of the files in the SObjs or Python directories :-)
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 920
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: VERSION command needs improvements

Post by ChrisH »

xenic wrote:Is that why the version command doesn't return any version information for any of the files in the SObjs or Python directories :-)
No, it is because SObjs don't usually contain $VER info (as they usually originate from Windows/Linux world, not Amiga world). Although I found that the 3rd-party SOBJS:liballegro.so does, and it works fine with Version.
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: VERSION command needs improvements

Post by ssolie »

xenic wrote:Is that why the version command doesn't return any version information for any of the files in the SObjs or Python directories :-)
No, it is because I didn't feel it was necessary to add version strings to all those modules. Nothing more.
ExecSG Team Lead
xenic
Posts: 1165
Joined: Sun Jun 19, 2011 12:06 am

Re: VERSION command needs improvements

Post by xenic »

ssolie wrote:
xenic wrote:Is that why the version command doesn't return any version information for any of the files in the SObjs or Python directories :-)
No, it is because I didn't feel it was necessary to add version strings to all those modules. Nothing more.
I know. I just like to poke you guys in the ribs occasionally. Guess I have a wierd sense of humor :-)
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 920
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: VERSION command needs improvements

Post by ChrisH »

@samo79
Just to let you know that this problem has now been officially reported & logged... although I cannot promise when (or even if) anything will get done about it.
User avatar
samo79
Posts: 555
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

Re: VERSION command needs improvements

Post by samo79 »

ChrisH wrote:@samo79
Just to let you know that this problem has now been officially reported & logged... although I cannot promise when (or even if) anything will get done about it.
Ah it's a good news then :-)
Post Reply