How to define "repo manager" for custom package manager?

I’m attempting to define a custom package manager so I can add the --no-install-recommends flag. (This flag used to be present by default for the apt package manager, but it was removed by this commit for some reason).

I don’t see any way to override the flags for a pre-defined package manager, so I created my own custom-manager replacement:

  custom-manager:
    clean:
      cmd: apt-get
      flags:
        - clean
    install:
      cmd: apt-get
      flags:
        - install
        - --no-install-recommends
    remove:
      cmd: apt-get
      flags:
        - remove
        - --auto-remove
    refresh:
      cmd: apt-get
      flags:
        - update
    update:
      cmd: apt-get
      flags:
        - dist-upgrade
    flags:
      - --yes

However, build-dir now fails:

I: Base system installed successfully.
Error: Failed to manage repositories: No repository handler present

and I don’t see how to define a “repository handler”.

Ideally, it would be nice to just be able to override the flags for pre-defined package managers so I can specify that I want to add --no-install-recommends to the flags for install without having to define a whole new custom manager.

@monstermunchkin

Distrobuilder doesn’t support custom repo handlers. However, the same can be achieved by using a post-unpack action. These actions are run after the repo handler and before installing/removing packages.

@eddy I guess your PR solves the issue you had, doesn’t it?

Indeed it does! :wink:

I wanted to try and help out with this great project a little bit, so I opened that PR to provide a cleaner way to install packages with options. That way users can avoid having to put their special-case package install lines in a post-unpack action.