libxpkg Introduction
libxpkg is a set of standard libraries that help with writing xpkg package files. Using it allows convenient access to xlings runtime information and implementation of multi-version coexistence.
Main Goals
- Cross-platform and portability, improving compatibility of xpkg package files
- Provide easy-to-use interfaces for obtaining runtime information
- Interfaces related to xlings tool modules
- Some convenient functional modules for xpkg writing
Module Introduction
| Module | Description |
|---|---|
| xim.libxpkg.pkginfo | Get runtime package information |
| xim.libxpkg.xvm | Multi-version manager API |
| xim.libxpkg.system | Get runtime-related system information and some system tools |
| xim.libxpkg.log | Log printing module |
| xim.libxpkg.pkgmanager | Package management module, providing installation and uninstallation dependency interfaces |
Usage Example
lua
package = {
-- ...
}
-- Import related modules
import("xim.libxpkg.pkginfo")
import("xim.libxpkg.log")
-- ...
function install()
-- Use API to print the version of the currently requested installation package, and its expected installation directory
log.warn("this is a debug...")
log.info("version: %s", pkginfo.version())
log.info("installdir: %s", pkginfo.install_dir())
return true
end
--- ...libxpkg source code implementation
