MediaArea / MediaInfoLib

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://mediaarea.net/MediaInfo
BSD 2-Clause "Simplified" License
636 stars 176 forks source link

Fix version number in some project files #2123

Closed g-maxime closed 1 month ago

JeromeMartinez commented 1 month ago

missing "v" in commit message ;-).

caoccao commented 1 month ago

I wonder if you are fine with my contributing a script that can update the version of all related files as a whole so that this kind of version mismatch will no longer be a pain? Here is a sample.

cjee21 commented 1 month ago

The current upgrade scripts are located here: https://github.com/MediaArea/MediaArea-Utils

If I understand correctly, I think the weakness of the current script is that it requires the previous version to be an exact match. So once it is out of sync, it will require manually fixing the mismatch.

I don't know how it went out of sync previously but a possibility in the future may be that someone edits something in an IDE that updates the project or resource files. IDEs will save 6 instead of 06 for example as minor version since starting with zero is technically invalid except for the strings section.

Maybe the script can be made more reliable by pattern matching instead of matching the previous version number?

caoccao commented 1 month ago

Interesting... The script I prefer works regardless of what the previous version is so that it can update all of them.

JeromeMartinez commented 1 month ago

IIRC it is the case, just that some files were not in the list of files to update and it was added Script is at https://github.com/MediaArea/MediaArea-Utils/blob/master/MediaInfoLib/UpgradeVersion.sh and we may accept patches if relevant.

cjee21 commented 1 month ago

IIRC it is the case, just that some files were not in the list of files to update and it was added

For some MSVC2022 projects it is true that it is not in the list and was fixed by that. But for files like MSVC2019 ones and Qt GUI, it was already in the list but it somehow got out of sync/mismatched and required manually fixing in this commit and the ones at MediaInfo. So I think there is room for improvement of the upgrade scripts.

Script is at https://github.com/MediaArea/MediaArea-Utils/blob/master/MediaInfoLib/UpgradeVersion.sh and we may accept patches if relevant.

MediaInfo one here: https://github.com/MediaArea/MediaArea-Utils/blob/master/MediaInfo/UpgradeVersion.sh If anyone patches the above, this should be patched similarly.

I am not that familiar with Linux commands and scripts but perhaps something like

[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*
[0-9]*,[0-9]*,[0-9]*,[0-9]*

instead of

$Version_old_major\.$Version_old_minor\.$Version_old_patch
$Version_old_major,$Version_old_minor,$Version_old_patch

would work better.

The ones with commas in .rc files should probably not have leading zeros in the digits.