diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2022-12-11 14:08:12 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-01-19 20:34:48 +0000 |
| commit | cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab (patch) | |
| tree | 644243403d9fd16a258d550301dcd4e252eca624 /kaios | |
| parent | 1eba6388bfed72e21a4525ef7a1c6c18d857b703 (diff) | |
| download | puzzles-cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab.zip puzzles-cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab.tar.gz puzzles-cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab.tar.bz2 puzzles-cc2e94ab2bbbcfcbb2eee58c5878917fadb721ab.tar.xz | |
kaios: Put version numbers in manifest files
This only happens if something edits manifest.pl to provide a version
number, but Buildscr can do that. KaiOS manifests are documented as
requiring dotted-decimal version numbers. In fact, the restrictions are
much stricter than that, and unacceptable version numbers can break the
KaiStore developer portal. YY.MM.DD version numbers seem to be
acceptable.
Diffstat (limited to 'kaios')
| -rwxr-xr-x | kaios/manifest.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kaios/manifest.pl b/kaios/manifest.pl index 36fc195..9379902 100755 --- a/kaios/manifest.pl +++ b/kaios/manifest.pl @@ -9,6 +9,9 @@ use JSON::PP; die "usage: manifest.pl <name> <displayname> <description> <objective>"; my ($name, $displayname, $description, $objective) = @ARGV; +# This can be overridden by the build script. +my $version = "Unidentified build"; + # Limits from # https://developer.kaiostech.com/docs/getting-started/main-concepts/manifest length($displayname) <= 20 or die "Name too long: $displayname"; @@ -17,6 +20,18 @@ $objective .= " Part of Simon Tatham's Portable Puzzle Collection."; # https://developer.kaiostech.com/docs/distribution/submission-guideline length($objective) <= 220 or die "Description too long: $objective"; +my $decvers; +if ($version =~ /^20(\d\d)(\d\d)(\d\d)\./) { + # Fabricate a dotted-decimal version number as required by KaiOS. + # The precise requirements are unclear and violating them leads to + # messes in the KaiStore that can only be resolved by Developer + # Support. Specifically, uploading a bad version number as the + # first upload of an app can make it impossible to upload a new + # version. I hope that three components of two digits each will + # be acceptable. + $decvers = join('.', $1+0, $2+0, $3+0); +} + print encode_json({ name => $displayname, subtitle => $description, @@ -31,6 +46,9 @@ print encode_json({ url => "https://bjh21.me.uk", }, default_locale => "en-GB", + locales => [ ], categories => ["games"], + type => "web", cursor => JSON::PP::false, + $decvers ? (version => $decvers) : (), }) |