pkg_install script framework

Jörg Sonnenberger

What's wrong? (I)

  • Around 30KB of shell fragments in mk/pkginstall
  • Copied and merged into various +INSTALL / +DEINSTALL scripts
  • Fix a bug — must rebuild the packages

What's wrong? (II)

  • No easy way to aggregate actions over change sets
  • Requires direct interaction with pkgdb
  • Difficult to debug and extract data

Solution — pkg_install side (I)

  • +PKGDATA file
  • JSON dictionary
  • Index: data type ("user", "info")
  • Corresponding: /usr/pkg/libexec/pkg_install/${data type}

Solution — pkg_install side (II)

  • Query API as program and library
  • Open question: how/where to store state
  • Open question: script order

Solution — pkgsrc side

  • Rewrite mk/pkginstall to just create +PKGDATA appropiately
  • Refactor existing scripts as standalone packages