Utilities

class spkrepo.utils.SPK(stream)[source]

SPK utilities

Parameters:stream (fileobj) – SPK file stream
BOOLEAN_INFO = {'startable', 'support_conf_folder'}

Boolean INFO keys

REQUIRED_INFO = {'firmware', 'arch', 'displayname', 'version', 'package', 'description'}

Required keys in the INFO file

SIGNATURE_FILENAME = 'syno_signature.asc'

Signature filename

conf_filename_re = re.compile('^conf/.+$')

Regex for files in conf

icon_filename_re = re.compile('^PACKAGE_ICON(?:_(?P<size>120|256))?\\.PNG$')

Regex for icons in files

icon_info_re = re.compile('^package_icon(?:_(?P<size>120|256))?$')

Regex for icons in INFO

info_line_re = re.compile('^(?P<key>\\w+)="(?P<value>.*)"$', re.MULTILINE)

Regex for a line of the INFO file

package_re = re.compile('^[\\w-]+$')

Regex for package in INFO file

script_filename_re = re.compile('^scripts/.+$')

Regex for files in scripts

sign(timestamp_url, gnupghome)[source]

Sign the package

Parameters:
  • timestamp_url – url for the remote timestamping
  • gnupghome – path to the gnupg home
unsign()[source]

Remove the signature file of the package

wizard_filename_re = re.compile('^WIZARD_UIFILES/(?P<process>install|upgrade|uninstall)_uifile(?:_[a-z]{3})?$')

Regex for a wizard filename