libappstream

Module functions

source

Functions§

  • Returns the component-ID of the current distribution based on contents of the /etc/os-release file. This function is a shorthand for as_distro_details_get_cid
  • Get a list of the default Freedesktop and AppStream categories that software components (especially GUI applications) can be sorted into in software centers.
  • Get a list of the default Freedesktop and AppStream categories that software components (especially GUI applications) can be sorted into in software centers.
  • Searches the known list of SPDX license exception IDs.
  • Checks the licence string to check it being a valid licence. NOTE: SPDX licenses can’t typically contain brackets.
  • Searches the known list of SPDX license IDs.
  • Check if the given license is for free-as-in-freedom software. A free software license is either approved by the Free Software Foundation or the Open Source Initiative.
  • Check if the metadata license is suitable for mixing with other metadata and redistributing the bundled result (this means we prefer permissive licenses here, to not require people shipping catalog metadata to perform a full license review).
  • Tests license ID against the vetted list of licenses that can be used for metainfo metadata. This function will not work for license expressions, if you need to test an SPDX license expression for compliance, please use as_license_is_metadata_license insread.
  • Get a translated license name for the given SPDX ID.
  • Converts a non-SPDX license into an SPDX format string where possible.
  • Get a web URL to the license text and more license information for an SPDX license identifier.
  • Converts XML description markup into other forms of text.
  • Splits up a long line into an array of smaller strings, each being no longer than line_len. Words are not split.
  • Tokenizes the SPDX license string (or any simarly formatted string) into parts. Any license parts of the string e.g. “LGPL-2.0+” are prefexed with “@”, the conjunctive replaced with “&”, the disjunctive replaced with “|” and the WITH operator for license exceptions replaced with “^”. Brackets are added as indervidual tokens and other strings are appended into single tokens where possible.
  • Builds an identifier string unique to the individual dataset using the supplied information.
  • Get the component-id part of the data-id.
  • Checks two data IDs for equality allowing globs to match, whilst also allowing clients to whitelist sections that have to match.
  • Checks if a data ID is valid i.e. has the correct number of sections.
  • Get a human-readable, translated name of the desktop environment represented by the given ID.
  • Get a human-readable, translated name of the combination of GUI environment and style. E.g. “plasma:dark” becomes “Plasma (Dark)”.
  • Retrieve the raw search token weight for the given tag name that AppStream uses internally for searching. This can be used to implement separate, but compatible search logic.
  • Guess the ComponentScope that applies to a given path.
  • Installs an AppStream MetaInfo, AppStream Metadata Catalog or AppStream Icon tarball file to the right place on the filesystem. Please note that this function does almost no validation and may guess missing values such as icon sizes and origin names. Ensure your metadata is good before installing it.
  • Checks if the submitted desktop environment ID is known and valid.
  • Checks if the given identifier is a valid, known GUI environment style.
  • Test if the given string is a valid platform triplet recognized by AppStream.
  • Searches the known list of TLDs we allow for AppStream IDs. This excludes internationalized names.
  • Calculates if one locale is compatible with another. When doing the calculation the locale and language code is taken into account if possible.
  • Converts a POSIX locale string to the corresponding IETF BCP47 format. If the given locale is already in BCP47 format, no change will be done.
  • Sorts all components in cpts into the Category categories listed in categories.
  • Compare alpha and numeric segments of two software versions, considering flags.
  • Compare alpha and numeric segments of two software versions.
  • Compare two version numbers and check if the given version comparator matches.
  • Get the version of the AppStream library that is currently used at runtime as a string.