On Wed, 26 Aug 2026 00:34:05 GMT, Alexander Matveev <[email protected]> wrote:
>> Add optional validation of the value of the `--linux-menu-group` option >> using the desktop-file-validate command. >> >> If the command is not available, jpackage doesn't validate the value of the >> `--linux-menu-group` option. >> >> Additionally, this command enhances validation of desktop files created by >> jpackage in the test code. It turned out that jpackage was producing desktop >> files that failed validation with some versions of the desktop-file-validate >> command. It was a minor incompatibility due to missing the trailing >> semicolon (;) in the value of the `MimeType` and `Categories` entries. Fixed >> accordingly. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBuilder.java > line 211: > >> 209: try { >> 210: Files.createDirectories(probeFile.getParent()); >> 211: Files.write(probeFile, List.of( > > Do we need to delete this file? Also, should we add real values for name, > exec, etc...? Do we want to validate entire file with all values we creating? We don't need to delete this file because it is (should be) within the work directory. We need to validate the value of jpackage's `--linux-menu-group` option, which directly translates into the `Categories` entry in the desktop file. So we validate only the `Categories` entry here. Other mandatory entries in the desktop file should be 100% valid and pass validation. In this setup, if validation fails, we know the cause without parsing the command output. > Do we want to validate entire file with all values we creating? Good suggestion. Even though it goes beyond the planned scope of this enhancement, I think it makes sense to add it to this patch. Will work on it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32523#discussion_r3863480411
