From 4c5d14f22d1cfa691759545c78cc7d6b8d1e7db0 Mon Sep 17 00:00:00 2001 From: minexew Date: Sun, 26 Mar 2017 20:53:12 +0200 Subject: [PATCH] Pkg: add post-install-doc, fmt version 11 --- PACKAGES.md | 15 ++++++++++++++- Pkg/Pkg.HC | 11 ++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/PACKAGES.md b/PACKAGES.md index bf9b01a7..3fa337d8 100644 --- a/PACKAGES.md +++ b/PACKAGES.md @@ -20,6 +20,9 @@ The manifest is a key-value format, using exactly one Tab character as delimiter - `installdir` (string, default *NULL*) - `iso.c` (string - see below, default *NULL*) - `size` (int - download size in bytes, default 0) + - `post-install-doc` (string, default *NULL*) + + Name of file to open after package installation. Must be an absolute path. Currently ignored keys: @@ -37,7 +40,17 @@ This is somewhat confusing, which makes it a perfect fit for TempleOS. `size` is ambiguous if the package provides multiple download formats. It's not a big deal. +pkgmin +------ + +To maximize compatibility with systems in the wild, you should generally use the lowest `pkgmin` that's suitable for your package. + +Format versions are described below: + + - 10 - Initial public release + - 11 - Adds support for `post-install-doc` (Shrine 5.03.1) + Dependency resolution --------------------- -...is not implemented on purpose, to keep things simple. +...is omitted on purpose, to keep things simple. diff --git a/Pkg/Pkg.HC b/Pkg/Pkg.HC index 1c451834..84e7e2f3 100644 --- a/Pkg/Pkg.HC +++ b/Pkg/Pkg.HC @@ -9,7 +9,7 @@ #define PKG_EOSVERSION (-20005) #define PKG_EUNSUITABLE (-20006) -#define PKG_VERSION 10 +#define PKG_VERSION 11 static U8* PKG_BASE_URL = "http://shrineupd.clanweb.eu/packages"; static U8* PKG_LOCAL_REPO = "::/Misc/Packages"; @@ -25,6 +25,7 @@ class CPkgInfo { U8* version; U8* installdir; U8* iso_c; + U8* post_install_doc; }; // TODO: Is there a built-in for this? @@ -49,6 +50,7 @@ U0 PkgInfoInit(CPkgInfo* pinf) { pinf->version = 0; pinf->installdir = 0; pinf->iso_c = 0; + pinf->post_install_doc = 0; } U0 PkgInfoFree(CPkgInfo* pinf) { @@ -56,6 +58,7 @@ U0 PkgInfoFree(CPkgInfo* pinf) { Free(pinf->version); Free(pinf->installdir); Free(pinf->iso_c); + Free(pinf->post_install_doc); PkgInfoInit(pinf); } @@ -93,6 +96,7 @@ I64 PkgParseManifest(CPkgInfo* pinf, U8* manifest) { else if (!StrCmp(key, "version")) { Free(pinf->version); pinf->version = StrNew(value); } else if (!StrCmp(key, "installdir")) { Free(pinf->installdir); pinf->installdir = StrNew(value); } else if (!StrCmp(key, "iso.c")) { Free(pinf->iso_c); pinf->iso_c = StrNew(value); } + else if (!StrCmp(key, "post-install-doc")) { Free(pinf->post_install_doc); pinf->post_install_doc = StrNew(value); } else { /* unrecognized keys are simply ignored */ } key = end; @@ -209,6 +213,11 @@ I64 PkgInstallISOC(CPkgInfo* pinf, U8* iso_c) { // Register package as installed error = PkgRegister(pinf); + + // Display post-install doc + if (pinf->post_install_doc) { + Ed(pinf->post_install_doc); + } } else error = PKG_EMOUNT;