Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env expansion not working for global replaces, conflicts #589

Closed
2 tasks done
mayocream opened this issue Dec 13, 2022 · 2 comments · Fixed by #593
Closed
2 tasks done

Env expansion not working for global replaces, conflicts #589

mayocream opened this issue Dec 13, 2022 · 2 comments · Fixed by #593
Assignees
Labels
bug Something isn't working

Comments

@mayocream
Copy link

What happened?

Env expansion introduced in #548 only works for deb.Overrides, but not working for global replaces, conflicts.

How can we reproduce this?

Example config file:

name: "mayo"
arch: ${ARCH}
platform: "linux"
version: 1.0.0
section: "default"
priority: "extra"
maintainer: "Mayo"
vendor: "Mayo Inc."
license: "ASL 2.0"
replaces:
  - foobar
  - ${REPLACE_BLA}
conflicts:
  - mercurial
  - ${CONFLICTS_BLA}
contents:
- src: /tmp/mayo
  dst: /usr/local/bin

Result:

$ REPLACE_BLA=mayo nfpm pkg -f tests/nfpm.yaml -p deb
new Debian package, version 2.0.
size 740 bytes: control archive=386 bytes.
     1 bytes,     0 lines      conffiles            
   223 bytes,    10 lines      control              
    50 bytes,     1 lines      md5sums              
Package: mayo
Version: 1.0.0
Section: default
Priority: extra
Architecture: amd64
Maintainer: Mayo
Installed-Size: 0
Replaces: foobar, ${REPLACE_BLA}
Conflicts: mercurial, ${CONFLICTS_BLA}
Description: no description given

nfpm version

nfpm version nfpm version 2.22.2
commit: 66760061ee255a163cbc77c7193826c15837fc0a
built at: 2022-11-30T12:46:25Z
built by: goreleaser
module version: v2.22.2, checksum: h1:K/how1xpNJC4xHpgMKQwE46iJp8+h0iTxWhhMYizhAA=

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

# Packages it replaces. (overridable)
# This will expand any env var you set in the field, e.g. ${REPLACE_BLA}
# the env var approach can be used to account for differences in platforms
replaces:
- foobar
- ${REPLACE_BLA}

@mayocream mayocream added the bug Something isn't working label Dec 13, 2022
@djgilcrease djgilcrease assigned djgilcrease and unassigned caarlos0 Dec 13, 2022
@djgilcrease
Copy link
Contributor

Will get to this tomorrow

@mayocream
Copy link
Author

mayocream commented Dec 13, 2022

Will get to this tomorrow

Just wonder is it feasible to make env expansion also work on name config field? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants