Skip to content

Expand variables in file_info fields #903

@aleroza

Description

@aleroza

Is your feature request related to a problem? Please describe.

I'm unable to use NFPM in configurations like this when I externally set 'owner' and 'group' as environment variables beforehand. The same issue occurs with 'mode' and 'mtime', but in those cases, NFPM returns an error about incorrect types.

contents:
  - src: ./build/pkg_root
    dst: ${PACKAGE_PREFIX}
    type: tree
    file_info:
      owner: ${PACKAGE_USER}
      group: ${PACKAGE_GROUP}
      mode: ${PACKAGE_MODE}
      mtime: ${PACKAGE_MTIME}
    expand: true

Describe the solution you'd like

Expand environment variables in file_info fields

Describe alternatives you've considered

In my case, the only alternatives are to use a separate nfpm.yaml file or the same user for different packages. However, these approaches feel too complicated and not ideal.

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

NFPM v2.41.2

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions